uawdijnntqw1x1x1
IP : 18.224.65.100
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,show_source,eval,open_base
OS : Linux
PATH:
/
home
/
sudancam
/
public_html
/
..
/
.trash
/
tyblue.3
/
..
/
admin.1
/
controller
/
marketing
/
marketing.php
/
/
<?php namespace Opencart\Admin\Controller\Marketing; class Marketing extends \Opencart\System\Engine\Controller { public function index(): void { $this->load->language('marketing/marketing'); $this->document->setTitle($this->language->get('heading_title')); $url = ''; if (isset($this->request->get['filter_name'])) { $url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8')); } if (isset($this->request->get['filter_code'])) { $url .= '&filter_code=' . $this->request->get['filter_code']; } if (isset($this->request->get['filter_date_added'])) { $url .= '&filter_date_added=' . $this->request->get['filter_date_added']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $data['breadcrumbs'] = []; $data['breadcrumbs'][] = [ 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token']) ]; $data['breadcrumbs'][] = [ 'text' => $this->language->get('heading_title'), 'href' => $this->url->link('marketing/marketing', 'user_token=' . $this->session->data['user_token'] . $url) ]; $data['add'] = $this->url->link('marketing/marketing|form', 'user_token=' . $this->session->data['user_token'] . $url); $data['delete'] = $this->url->link('marketing/marketing|delete', 'user_token=' . $this->session->data['user_token']); $data['list'] = $this->getList(); $data['user_token'] = $this->session->data['user_token']; $data['header'] = $this->load->controller('common/header'); $data['column_left'] = $this->load->controller('common/column_left'); $data['footer'] = $this->load->controller('common/footer'); $this->response->setOutput($this->load->view('marketing/marketing', $data)); } public function list(): void { $this->load->language('marketing/marketing'); $this->response->setOutput($this->getList()); } protected function getList(): string { if (isset($this->request->get['filter_name'])) { $filter_name = $this->request->get['filter_name']; } else { $filter_name = ''; } if (isset($this->request->get['filter_code'])) { $filter_code = $this->request->get['filter_code']; } else { $filter_code = ''; } if (isset($this->request->get['filter_date_added'])) { $filter_date_added = $this->request->get['filter_date_added']; } else { $filter_date_added = ''; } if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'm.name'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; } if (isset($this->request->get['page'])) { $page = (int)$this->request->get['page']; } else { $page = 1; } $url = ''; if (isset($this->request->get['filter_name'])) { $url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8')); } if (isset($this->request->get['filter_code'])) { $url .= '&filter_code=' . $this->request->get['filter_code']; } if (isset($this->request->get['filter_date_added'])) { $url .= '&filter_date_added=' . $this->request->get['filter_date_added']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $data['action'] = $this->url->link('marketing/marketing|list', 'user_token=' . $this->session->data['user_token'] . $url); $data['marketings'] = []; $filter_data = [ 'filter_name' => $filter_name, 'filter_code' => $filter_code, 'filter_date_added' => $filter_date_added, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $this->config->get('config_pagination_admin'), 'limit' => $this->config->get('config_pagination_admin') ]; $this->load->model('marketing/marketing'); $marketing_total = $this->model_marketing_marketing->getTotalMarketings($filter_data); $results = $this->model_marketing_marketing->getMarketings($filter_data); foreach ($results as $result) { $data['marketings'][] = [ 'marketing_id' => $result['marketing_id'], 'name' => $result['name'], 'code' => $result['code'], 'clicks' => $result['clicks'], 'orders' => $result['orders'], 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), 'edit' => $this->url->link('marketing/marketing|form', 'user_token=' . $this->session->data['user_token'] . '&marketing_id=' . $result['marketing_id'] . $url) ]; } $url = ''; if (isset($this->request->get['filter_name'])) { $url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8')); } if (isset($this->request->get['filter_code'])) { $url .= '&filter_code=' . $this->request->get['filter_code']; } if (isset($this->request->get['filter_date_added'])) { $url .= '&filter_date_added=' . $this->request->get['filter_date_added']; } if ($order == 'ASC') { $url .= '&order=DESC'; } else { $url .= '&order=ASC'; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $data['sort_name'] = $this->url->link('marketing/marketing|list', 'user_token=' . $this->session->data['user_token'] . '&sort=m.name' . $url); $data['sort_code'] = $this->url->link('marketing/marketing|list', 'user_token=' . $this->session->data['user_token'] . '&sort=m.code' . $url); $data['sort_date_added'] = $this->url->link('marketing/marketing|list', 'user_token=' . $this->session->data['user_token'] . '&sort=m.date_added' . $url); $url = ''; if (isset($this->request->get['filter_name'])) { $url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8')); } if (isset($this->request->get['filter_code'])) { $url .= '&filter_code=' . $this->request->get['filter_code']; } if (isset($this->request->get['filter_date_added'])) { $url .= '&filter_date_added=' . $this->request->get['filter_date_added']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } $data['pagination'] = $this->load->controller('common/pagination', [ 'total' => $marketing_total, 'page' => $page, 'limit' => $this->config->get('config_pagination_admin'), 'url' => $this->url->link('marketing/marketing|list', 'user_token=' . $this->session->data['user_token'] . $url . '&page={page}') ]); $data['results'] = sprintf($this->language->get('text_pagination'), ($marketing_total) ? (($page - 1) * $this->config->get('config_pagination_admin')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination_admin')) > ($marketing_total - $this->config->get('config_pagination_admin'))) ? $marketing_total : ((($page - 1) * $this->config->get('config_pagination_admin')) + $this->config->get('config_pagination_admin')), $marketing_total, ceil($marketing_total / $this->config->get('config_pagination_admin'))); $data['filter_name'] = $filter_name; $data['filter_code'] = $filter_code; $data['filter_date_added'] = $filter_date_added; $data['sort'] = $sort; $data['order'] = $order; return $this->load->view('marketing/marketing_list', $data); } public function form(): void { $this->load->language('marketing/marketing'); $this->document->setTitle($this->language->get('heading_title')); $data['text_form'] = !isset($this->request->get['marketing_id']) ? $this->language->get('text_add') : $this->language->get('text_edit'); $url = ''; if (isset($this->request->get['filter_name'])) { $url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8')); } if (isset($this->request->get['filter_code'])) { $url .= '&filter_code=' . $this->request->get['filter_code']; } if (isset($this->request->get['filter_date_added'])) { $url .= '&filter_date_added=' . $this->request->get['filter_date_added']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $data['breadcrumbs'] = []; $data['breadcrumbs'][] = [ 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token']) ]; $data['breadcrumbs'][] = [ 'text' => $this->language->get('heading_title'), 'href' => $this->url->link('marketing/marketing', 'user_token=' . $this->session->data['user_token'] . $url) ]; $data['save'] = $this->url->link('marketing/marketing|save', 'user_token=' . $this->session->data['user_token']); $data['back'] = $this->url->link('marketing/marketing', 'user_token=' . $this->session->data['user_token'] . $url); if (isset($this->request->get['marketing_id'])) { $this->load->model('marketing/marketing'); $marketing_info = $this->model_marketing_marketing->getMarketing($this->request->get['marketing_id']); } if (isset($this->request->get['marketing_id'])) { $data['marketing_id'] = (int)$this->request->get['marketing_id']; } else { $data['marketing_id'] = 0; } $data['store'] = HTTP_CATALOG; if (!empty($marketing_info)) { $data['name'] = $marketing_info['name']; } else { $data['name'] = ''; } if (!empty($marketing_info)) { $data['description'] = $marketing_info['description']; } else { $data['description'] = ''; } if (!empty($marketing_info)) { $data['code'] = $marketing_info['code']; } else { $data['code'] = uniqid(); } $data['report'] = $this->getReport(); $data['user_token'] = $this->session->data['user_token']; $data['header'] = $this->load->controller('common/header'); $data['column_left'] = $this->load->controller('common/column_left'); $data['footer'] = $this->load->controller('common/footer'); $this->response->setOutput($this->load->view('marketing/marketing_form', $data)); } public function save(): void { $this->load->language('marketing/marketing'); $json = []; if (!$this->user->hasPermission('modify', 'marketing/marketing')) { $json['error']['warning'] = $this->language->get('error_permission'); } if ((utf8_strlen($this->request->post['name']) < 1) || (utf8_strlen($this->request->post['name']) > 32)) { $json['error']['name'] = $this->language->get('error_name'); } if (!$this->request->post['code']) { $json['error']['code'] = $this->language->get('error_code'); } $this->load->model('marketing/marketing'); $marketing_info = $this->model_marketing_marketing->getMarketingByCode($this->request->post['code']); if ($marketing_info && (!isset($this->request->post['marketing_id']) || ($this->request->post['marketing_id'] != $marketing_info['marketing_id']))) { $json['error']['code'] = $this->language->get('error_exists'); } if (!$json) { if (!$this->request->post['marketing_id']) { $json['marketing_id'] = $this->model_marketing_marketing->addMarketing($this->request->post); } else { $this->model_marketing_marketing->editMarketing($this->request->post['marketing_id'], $this->request->post); } $json['success'] = $this->language->get('text_success'); } $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function delete(): void { $this->load->language('marketing/marketing'); $json = []; if (isset($this->request->post['selected'])) { $selected = $this->request->post['selected']; } else { $selected = []; } if (!$this->user->hasPermission('modify', 'marketing/marketing')) { $json['error'] = $this->language->get('error_permission'); } if (!$json) { $this->load->model('marketing/marketing'); foreach ($selected as $marketing_id) { $this->model_marketing_marketing->deleteMarketing($marketing_id); } $json['success'] = $this->language->get('text_success'); } $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function report(): void { $this->load->language('marketing/marketing'); $this->response->setOutput($this->getReport()); } public function getReport(): string { if (isset($this->request->get['marketing_id'])) { $marketing_id = (int)$this->request->get['marketing_id']; } else { $marketing_id = 0; } if (isset($this->request->get['page'])) { $page = (int)$this->request->get['page']; } else { $page = 1; } $data['reports'] = []; $this->load->model('marketing/marketing'); $this->load->model('customer/customer'); $this->load->model('setting/store'); $results = $this->model_marketing_marketing->getReports($marketing_id, ($page - 1) * 10, 10); foreach ($results as $result) { $store_info = $this->model_setting_store->getStore($result['store_id']); if ($store_info) { $store = $store_info['name']; } elseif (!$result['store_id']) { $store = $this->config->get('config_name'); } else { $store = ''; } $data['reports'][] = [ 'ip' => $result['ip'], 'account' => $this->model_customer_customer->getTotalCustomersByIp($result['ip']), 'store' => $store, 'country' => $result['country'], 'date_added' => date($this->language->get('datetime_format'), strtotime($result['date_added'])), 'filter_ip' => $this->url->link('customer/customer', 'user_token=' . $this->session->data['user_token'] . '&filter_ip=' . $result['ip']) ]; } $report_total = $this->model_marketing_marketing->getTotalReports($marketing_id); $data['pagination'] = $this->load->controller('common/pagination', [ 'total' => $report_total, 'page' => $page, 'limit' => 10, 'url' => $this->url->link('marketing/marketing|report', 'user_token=' . $this->session->data['user_token'] . '&marketing_id=' . $marketing_id . '&page={page}') ]); $data['results'] = sprintf($this->language->get('text_pagination'), ($report_total) ? (($page - 1) * 10) + 1 : 0, ((($page - 1) * 10) > ($report_total - 10)) ? $report_total : ((($page - 1) * 10) + 10), $report_total, ceil($report_total / 10)); return $this->load->view('marketing/marketing_report', $data); } }
/home/sudancam/public_html/../.trash/tyblue.3/../admin.1/controller/marketing/marketing.php