uawdijnntqw1x1x1
IP : 3.12.74.170
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
/
.trash
/
quran
/
..
/
admin
/
model
/
extension
/
report
/
return.php
/
/
<?php class ModelExtensionReportReturn extends Model { public function getReturns($data = array()) { $sql = "SELECT MIN(r.date_added) AS date_start, MAX(r.date_added) AS date_end, COUNT(r.return_id) AS `returns` FROM `" . DB_PREFIX . "return` r"; if (!empty($data['filter_return_status_id'])) { $sql .= " WHERE r.return_status_id = '" . (int)$data['filter_return_status_id'] . "'"; } else { $sql .= " WHERE r.return_status_id > '0'"; } if (!empty($data['filter_date_start'])) { $sql .= " AND DATE(r.date_added) >= '" . $this->db->escape($data['filter_date_start']) . "'"; } if (!empty($data['filter_date_end'])) { $sql .= " AND DATE(r.date_added) <= '" . $this->db->escape($data['filter_date_end']) . "'"; } if (isset($data['filter_group'])) { $group = $data['filter_group']; } else { $group = 'week'; } switch($group) { case 'day'; $sql .= " GROUP BY YEAR(r.date_added), MONTH(r.date_added), DAY(r.date_added)"; break; default: case 'week': $sql .= " GROUP BY YEAR(r.date_added), WEEK(r.date_added)"; break; case 'month': $sql .= " GROUP BY YEAR(r.date_added), MONTH(r.date_added)"; break; case 'year': $sql .= " GROUP BY YEAR(r.date_added)"; break; } if (isset($data['start']) || isset($data['limit'])) { if ($data['start'] < 0) { $data['start'] = 0; } if ($data['limit'] < 1) { $data['limit'] = 20; } $sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit']; } $query = $this->db->query($sql); return $query->rows; } public function getTotalReturns($data = array()) { if (!empty($data['filter_group'])) { $group = $data['filter_group']; } else { $group = 'week'; } switch($group) { case 'day'; $sql = "SELECT COUNT(DISTINCT YEAR(date_added), MONTH(date_added), DAY(date_added)) AS total FROM `" . DB_PREFIX . "return`"; break; default: case 'week': $sql = "SELECT COUNT(DISTINCT YEAR(date_added), WEEK(date_added)) AS total FROM `" . DB_PREFIX . "return`"; break; case 'month': $sql = "SELECT COUNT(DISTINCT YEAR(date_added), MONTH(date_added)) AS total FROM `" . DB_PREFIX . "return`"; break; case 'year': $sql = "SELECT COUNT(DISTINCT YEAR(date_added)) AS total FROM `" . DB_PREFIX . "return`"; break; } if (!empty($data['filter_return_status_id'])) { $sql .= " WHERE return_status_id = '" . (int)$data['filter_return_status_id'] . "'"; } else { $sql .= " WHERE return_status_id > '0'"; } if (!empty($data['filter_date_start'])) { $sql .= " AND DATE(date_added) >= '" . $this->db->escape($data['filter_date_start']) . "'"; } if (!empty($data['filter_date_end'])) { $sql .= " AND DATE(date_added) <= '" . $this->db->escape($data['filter_date_end']) . "'"; } $query = $this->db->query($sql); return $query->row['total']; } }
/home/sudancam/.trash/quran/../admin/model/extension/report/return.php