uawdijnntqw1x1x1
IP : 3.15.21.79
Hostname : ns1.eurodns.top
Kernel : Linux ns1.eurodns.top 4.18.0-348.7.1.lve.el7h.x86_64 #1 SMP Fri Dec 24 19:28:54 UTC 2021 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
/
setting
/
setting.php
/
/
<?php namespace Opencart\Admin\Model\Setting; class Setting extends \Opencart\System\Engine\Model { public function getSettings(int $store_id = 0): array { $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "setting` WHERE `store_id` = '" . (int)$store_id . "' OR `store_id` = '0' ORDER BY `store_id` ASC"); return $query->rows; } public function getSetting(string $code, int $store_id = 0): array { $setting_data = []; $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(string $code, array $data, int $store_id = 0): void { $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)) . "', `serialized` = '1'"); } } } } public function deleteSetting(string $code, int $store_id = 0): void { $this->db->query("DELETE FROM `" . DB_PREFIX . "setting` WHERE `store_id` = '" . (int)$store_id . "' AND `code` = '" . $this->db->escape($code) . "'"); } public function getValue(string $key, int $store_id = 0): string { $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 ''; } } public function editValue(string $code = '', string $key = '', string|array $value = '', int $store_id = 0): void { 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/public_html/0d544/../../.trash/admin.1/model/setting/setting.php