uawdijnntqw1x1x1
IP : 3.12.165.202
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
/
0d544
/
..
/
..
/
.trash
/
admin.1
/
model
/
.
/
.
/
tool
/
upload.php
/
/
<?php namespace Opencart\Admin\Model\Tool; class Upload extends \Opencart\System\Engine\Model { public function addUpload(string $name, string $filename): string { $code = sha1(uniqid(mt_rand(), true)); $this->db->query("INSERT INTO `" . DB_PREFIX . "upload` SET `name` = '" . $this->db->escape($name) . "', `filename` = '" . $this->db->escape($filename) . "', `code` = '" . $this->db->escape($code) . "', `date_added` = NOW()"); return $code; } public function deleteUpload(int $upload_id): void { $this->db->query("DELETE FROM `" . DB_PREFIX . "upload` WHERE `upload_id` = '" . (int)$upload_id . "'"); } public function getUpload(int $upload_id): array { $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "upload` WHERE `upload_id` = '" . (int)$upload_id . "'"); return $query->row; } public function getUploadByCode(string $code): array { $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "upload` WHERE `code` = '" . $this->db->escape($code) . "'"); return $query->row; } public function getUploads(array $data = []): array { $sql = "SELECT * FROM `" . DB_PREFIX . "upload`"; $implode = []; if (!empty($data['filter_name'])) { $implode[] = "`name` LIKE '" . $this->db->escape((string)$data['filter_name'] . '%') . "'"; } if (!empty($data['filter_code'])) { $implode[] = "`code` LIKE '" . $this->db->escape((string)$data['filter_code'] . '%') . "'"; } if (!empty($data['filter_date_added'])) { $implode[] = "DATE(`date_added`) = DATE('" . $this->db->escape((string)$data['filter_date_added']) . "')"; } if ($implode) { $sql .= " WHERE " . implode(" AND ", $implode); } $sort_data = [ 'name', 'code', 'date_added' ]; if (isset($data['sort']) && in_array($data['sort'], $sort_data)) { $sql .= " ORDER BY `" . $data['sort'] . "`"; } else { $sql .= " ORDER BY `date_added`"; } if (isset($data['order']) && ($data['order'] == 'DESC')) { $sql .= " DESC"; } else { $sql .= " ASC"; } 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 getTotalUploads(array $data = []): int { $sql = "SELECT COUNT(*) AS `total` FROM `" . DB_PREFIX . "upload`"; $implode = []; if (!empty($data['filter_name'])) { $implode[] = "`name` LIKE '" . $this->db->escape((string)$data['filter_name'] . '%') . "'"; } if (!empty($data['filter_code'])) { $implode[] = "`code` LIKE '" . $this->db->escape((string)$data['filter_code'] . '%') . "'"; } if (!empty($data['filter_date_added'])) { $implode[] = "DATE(`date_added`) = DATE('" . $this->db->escape((string)$data['filter_date_added']) . "')"; } if ($implode) { $sql .= " WHERE " . implode(" AND ", $implode); } $query = $this->db->query($sql); return (int)$query->row['total']; } }
/home/sudancam/public_html/0d544/../../.trash/admin.1/model/././tool/upload.php