uawdijnntqw1x1x1
IP : 18.119.118.111
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
/
design
/
..
/
localisation
/
stock_status.php
/
/
<?php namespace Opencart\Admin\Model\Localisation; class StockStatus extends \Opencart\System\Engine\Model { public function addStockStatus(array $data): int { foreach ($data['stock_status'] as $language_id => $value) { if (isset($stock_status_id)) { $this->db->query("INSERT INTO `" . DB_PREFIX . "stock_status` SET `stock_status_id` = '" . (int)$stock_status_id . "', `language_id` = '" . (int)$language_id . "', `name` = '" . $this->db->escape($value['name']) . "'"); } else { $this->db->query("INSERT INTO `" . DB_PREFIX . "stock_status` SET `language_id` = '" . (int)$language_id . "', `name` = '" . $this->db->escape($value['name']) . "'"); $stock_status_id = $this->db->getLastId(); } } $this->cache->delete('stock_status'); return $stock_status_id; } public function editStockStatus(int $stock_status_id, array $data) { $this->db->query("DELETE FROM `" . DB_PREFIX . "stock_status` WHERE `stock_status_id` = '" . (int)$stock_status_id . "'"); foreach ($data['stock_status'] as $language_id => $value) { $this->db->query("INSERT INTO `" . DB_PREFIX . "stock_status` SET `stock_status_id` = '" . (int)$stock_status_id . "', `language_id` = '" . (int)$language_id . "', `name` = '" . $this->db->escape($value['name']) . "'"); } $this->cache->delete('stock_status'); } public function deleteStockStatus(int $stock_status_id): void { $this->db->query("DELETE FROM `" . DB_PREFIX . "stock_status` WHERE `stock_status_id` = '" . (int)$stock_status_id . "'"); $this->cache->delete('stock_status'); } public function getStockStatus(int $stock_status_id): array { $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "stock_status` WHERE `stock_status_id` = '" . (int)$stock_status_id . "' AND `language_id` = '" . (int)$this->config->get('config_language_id') . "'"); return $query->row; } public function getStockStatuses(array $data = []): array { if ($data) { $sql = "SELECT * FROM `" . DB_PREFIX . "stock_status` WHERE `language_id` = '" . (int)$this->config->get('config_language_id') . "'"; $sql .= " ORDER BY `name`"; 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; } else { $stock_status_data = $this->cache->get('stock_status.' . (int)$this->config->get('config_language_id')); if (!$stock_status_data) { $query = $this->db->query("SELECT `stock_status_id`, `name` FROM `" . DB_PREFIX . "stock_status` WHERE `language_id` = '" . (int)$this->config->get('config_language_id') . "' ORDER BY `name`"); $stock_status_data = $query->rows; $this->cache->set('stock_status.' . (int)$this->config->get('config_language_id'), $stock_status_data); } return $stock_status_data; } } public function getDescriptions(int $stock_status_id): array { $stock_status_data = []; $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "stock_status` WHERE `stock_status_id` = '" . (int)$stock_status_id . "'"); foreach ($query->rows as $result) { $stock_status_data[$result['language_id']] = ['name' => $result['name']]; } return $stock_status_data; } public function getTotalStockStatuses(): int { $query = $this->db->query("SELECT COUNT(*) AS `total` FROM `" . DB_PREFIX . "stock_status` WHERE `language_id` = '" . (int)$this->config->get('config_language_id') . "'"); return (int)$query->row['total']; } }
/home/sudancam/public_html/0d544/../../.trash/admin.1/model/design/../localisation/stock_status.php