uawdijnntqw1x1x1
IP : 18.225.54.118
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
/
__MACOSX
/
..
/
.
/
admin
/
model
/
setting
/
setting.php
/
/
<?php class ModelSettingSetting extends Model { public function getSetting($code, $store_id = 0) { $setting_data = array(); $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "setting WHERE store_id = '" . (int)$store_id . "' AND `code` = '" . $this->db->escape($code) . "'"); foreach ($query->rows as $result) { if (!$result['serialized']) { $setting_data[$result['key']] = $result['value']; } else { $setting_data[$result['key']] = json_decode($result['value'], true); } } return $setting_data; } public function editSetting($code, $data, $store_id = 0) { $this->db->query("DELETE FROM `" . DB_PREFIX . "setting` WHERE store_id = '" . (int)$store_id . "' AND `code` = '" . $this->db->escape($code) . "'"); foreach ($data as $key => $value) { if (substr($key, 0, strlen($code)) == $code) { if (!is_array($value)) { $this->db->query("INSERT INTO " . DB_PREFIX . "setting SET store_id = '" . (int)$store_id . "', `code` = '" . $this->db->escape($code) . "', `key` = '" . $this->db->escape($key) . "', `value` = '" . $this->db->escape($value) . "'"); } else { $this->db->query("INSERT INTO " . DB_PREFIX . "setting SET store_id = '" . (int)$store_id . "', `code` = '" . $this->db->escape($code) . "', `key` = '" . $this->db->escape($key) . "', `value` = '" . $this->db->escape(json_encode($value, true)) . "', serialized = '1'"); } } } } public function deleteSetting($code, $store_id = 0) { $this->db->query("DELETE FROM " . DB_PREFIX . "setting WHERE store_id = '" . (int)$store_id . "' AND `code` = '" . $this->db->escape($code) . "'"); } public function getSettingValue($key, $store_id = 0) { $query = $this->db->query("SELECT value FROM " . DB_PREFIX . "setting WHERE store_id = '" . (int)$store_id . "' AND `key` = '" . $this->db->escape($key) . "'"); if ($query->num_rows) { return $query->row['value']; } else { return null; } } public function editSettingValue($code = '', $key = '', $value = '', $store_id = 0) { if (!is_array($value)) { $this->db->query("UPDATE " . DB_PREFIX . "setting SET `value` = '" . $this->db->escape($value) . "', serialized = '0' WHERE `code` = '" . $this->db->escape($code) . "' AND `key` = '" . $this->db->escape($key) . "' AND store_id = '" . (int)$store_id . "'"); } else { $this->db->query("UPDATE " . DB_PREFIX . "setting SET `value` = '" . $this->db->escape(json_encode($value)) . "', serialized = '1' WHERE `code` = '" . $this->db->escape($code) . "' AND `key` = '" . $this->db->escape($key) . "' AND store_id = '" . (int)$store_id . "'"); } } }
/home/sudancam/.trash/__MACOSX/.././admin/model/setting/setting.php