Server IP : 127.0.0.1 / Your IP : 3.138.125.86 [ Web Server : nginx/1.20.1 System : Linux dropship.kaosunisex.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64 User : kaosunisex ( 1000) PHP Version : 7.3.33 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/kaosunisex/dropship.kaosunisex.com/admin/model/setting/ |
Upload File : |
<?php class ModelSettingModule extends Model { public function addModule($code, $data) { $this->db->query("INSERT INTO `" . DB_PREFIX . "module` SET `name` = '" . $this->db->escape($data['name']) . "', `code` = '" . $this->db->escape($code) . "', `setting` = '" . $this->db->escape(json_encode($data)) . "'"); } public function editModule($module_id, $data) { $this->db->query("UPDATE `" . DB_PREFIX . "module` SET `name` = '" . $this->db->escape($data['name']) . "', `setting` = '" . $this->db->escape(json_encode($data)) . "' WHERE `module_id` = '" . (int)$module_id . "'"); } public function deleteModule($module_id) { $this->db->query("DELETE FROM `" . DB_PREFIX . "module` WHERE `module_id` = '" . (int)$module_id . "'"); $this->db->query("DELETE FROM `" . DB_PREFIX . "layout_module` WHERE `code` LIKE '%." . (int)$module_id . "'"); } public function getModule($module_id) { $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "module` WHERE `module_id` = '" . (int)$module_id . "'"); if ($query->row) { return json_decode($query->row['setting'], true); } else { return array(); } } public function getModules() { $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "module` ORDER BY `code`"); return $query->rows; } public function getModulesByCode($code) { $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "module` WHERE `code` = '" . $this->db->escape($code) . "' ORDER BY `name`"); return $query->rows; } public function deleteModulesByCode($code) { $this->db->query("DELETE FROM `" . DB_PREFIX . "module` WHERE `code` = '" . $this->db->escape($code) . "'"); $this->db->query("DELETE FROM `" . DB_PREFIX . "layout_module` WHERE `code` LIKE '" . $this->db->escape($code) . "' OR `code` LIKE '" . $this->db->escape($code . '.%') . "'"); } }