uawdijnntqw1x1x1
IP : 3.144.46.9
Hostname : ns1.eurodns.top
Kernel : Linux ns1.eurodns.top 4.18.0-553.5.1.lve.1.el7h.x86_64 #1 SMP Fri Jun 14 14:24:52 UTC 2024 x86_64
Disable Function : mail,sendmail,exec,passthru,shell_exec,system,popen,curl_multi_exec,parse_ini_file,show_source,eval,open_base,symlink
OS : Linux
PATH:
/
home
/
sudancam
/
public_html
/
0d544
/
..
/
..
/
.trash
/
admin.2
/
..
/
quran
/
..
/
catalog.1
/
controller
/
product
/
review.php
/
/
<?php namespace Opencart\Catalog\Controller\Product; class Review extends \Opencart\System\Engine\Controller { public function review(): void { $this->load->language('product/product'); $this->load->model('catalog/review'); if (isset($this->request->get['page'])) { $page = (int)$this->request->get['page']; } else { $page = 1; } $data['reviews'] = []; $review_total = $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']); $results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 5, 5); foreach ($results as $result) { $data['reviews'][] = [ 'author' => $result['author'], 'text' => nl2br($result['text']), 'rating' => (int)$result['rating'], 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])) ]; } $data['pagination'] = $this->load->controller('common/pagination', [ 'total' => $review_total, 'page' => $page, 'limit' => 5, 'url' => $this->url->link('product/product|review', 'language=' . $this->config->get('config_language') . '&product_id=' . $this->request->get['product_id'] . '&page={page}') ]); $data['results'] = sprintf($this->language->get('text_pagination'), ($review_total) ? (($page - 1) * 5) + 1 : 0, ((($page - 1) * 5) > ($review_total - 5)) ? $review_total : ((($page - 1) * 5) + 5), $review_total, ceil($review_total / 5)); $this->response->setOutput($this->load->view('product/review', $data)); } public function write(): void { $this->load->language('product/product'); $json = []; if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 25)) { $json['error']['name'] = $this->language->get('error_name'); } if ((utf8_strlen($this->request->post['text']) < 25) || (utf8_strlen($this->request->post['text']) > 1000)) { $json['error']['text'] = $this->language->get('error_text'); } if (empty($this->request->post['rating']) || $this->request->post['rating'] < 0 || $this->request->post['rating'] > 5) { $json['error']['rating'] = $this->language->get('error_rating'); } // Captcha $this->load->model('setting/extension'); $extension_info = $this->model_setting_extension->getExtensionByCode('captcha', $this->config->get('config_captcha')); if ($extension_info && $this->config->get('captcha_' . $this->config->get('config_captcha') . '_status') && in_array('review', (array)$this->config->get('config_captcha_page'))) { $captcha = $this->load->controller('extension/' . $extension_info['extension'] . '/captcha/' . $extension_info['code'] . '|validate'); if ($captcha) { $json['error']['captcha'] = $captcha; } } if (!$json) { $this->load->model('catalog/review'); $this->model_catalog_review->addReview($this->request->get['product_id'], $this->request->post); $json['success'] = $this->language->get('text_success'); } $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } }
/home/sudancam/public_html/0d544/../../.trash/admin.2/../quran/../catalog.1/controller/product/review.php