first commit

This commit is contained in:
Konstantin
2026-05-30 09:27:58 +03:00
commit de0344d218
2371 changed files with 661486 additions and 0 deletions
@@ -0,0 +1,22 @@
<?php
class ModelLocalisationCountry extends Model {
public function getCountry($country_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "country WHERE country_id = '" . (int)$country_id . "' AND status = '1'");
return $query->row;
}
public function getCountries() {
$country_data = $this->cache->get('country.catalog');
if (!$country_data) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "country WHERE status = '1' ORDER BY name ASC");
$country_data = $query->rows;
$this->cache->set('country.catalog', $country_data);
}
return $country_data;
}
}
@@ -0,0 +1,36 @@
<?php
class ModelLocalisationCurrency extends Model {
public function getCurrencyByCode($currency) {
$query = $this->db->query("SELECT DISTINCT * FROM `" . DB_PREFIX . "currency` WHERE `code` = '" . $this->db->escape($currency) . "'");
return $query->row;
}
public function getCurrencies() {
$currency_data = $this->cache->get('currency');
if (!$currency_data) {
$currency_data = array();
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "currency` WHERE `status` = '1' ORDER BY `title` ASC");
foreach ($query->rows as $result) {
$currency_data[$result['code']] = array(
'currency_id' => $result['currency_id'],
'title' => $result['title'],
'code' => $result['code'],
'symbol_left' => $result['symbol_left'],
'symbol_right' => $result['symbol_right'],
'decimal_place' => $result['decimal_place'],
'value' => $result['value'],
'status' => $result['status'],
'date_modified' => $result['date_modified']
);
}
$this->cache->set('currency', $currency_data);
}
return $currency_data;
}
}
@@ -0,0 +1,35 @@
<?php
class ModelLocalisationLanguage extends Model {
public function getLanguage($language_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "language WHERE language_id = '" . (int)$language_id . "'");
return $query->row;
}
public function getLanguages() {
$language_data = $this->cache->get('catalog.language');
if (!$language_data) {
$language_data = array();
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "language WHERE status = '1' ORDER BY sort_order, name");
foreach ($query->rows as $result) {
$language_data[$result['code']] = array(
'language_id' => $result['language_id'],
'name' => $result['name'],
'code' => $result['code'],
'locale' => $result['locale'],
'image' => $result['image'],
'directory' => $result['directory'],
'sort_order' => $result['sort_order'],
'status' => $result['status']
);
}
$this->cache->set('catalog.language', $language_data);
}
return $language_data;
}
}
@@ -0,0 +1,8 @@
<?php
class ModelLocalisationLocation extends Model {
public function getLocation($location_id) {
$query = $this->db->query("SELECT location_id, name, address, geocode, telephone, fax, image, open, comment FROM " . DB_PREFIX . "location WHERE location_id = '" . (int)$location_id . "'");
return $query->row;
}
}
@@ -0,0 +1,22 @@
<?php
class ModelLocalisationOrderStatus extends Model {
public function getOrderStatus($order_status_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_status WHERE order_status_id = '" . (int)$order_status_id . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
return $query->row;
}
public function getOrderStatuses() {
$order_status_data = $this->cache->get('order_status.' . (int)$this->config->get('config_language_id'));
if (!$order_status_data) {
$query = $this->db->query("SELECT order_status_id, name FROM " . DB_PREFIX . "order_status WHERE language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY name");
$order_status_data = $query->rows;
$this->cache->set('order_status.' . (int)$this->config->get('config_language_id'), $order_status_data);
}
return $order_status_data;
}
}
@@ -0,0 +1,44 @@
<?php
class ModelLocalisationReturnReason extends Model {
public function getReturnReasons($data = array()) {
if ($data) {
$sql = "SELECT * FROM " . DB_PREFIX . "return_reason WHERE language_id = '" . (int)$this->config->get('config_language_id') . "'";
$sql .= " ORDER BY name";
if (isset($data['return']) && ($data['return'] == '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 {
$return_reason_data = $this->cache->get('return_reason.' . (int)$this->config->get('config_language_id'));
if (!$return_reason_data) {
$query = $this->db->query("SELECT return_reason_id, name FROM " . DB_PREFIX . "return_reason WHERE language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY name");
$return_reason_data = $query->rows;
$this->cache->set('return_reason.' . (int)$this->config->get('config_language_id'), $return_reason_data);
}
return $return_reason_data;
}
}
}
+22
View File
@@ -0,0 +1,22 @@
<?php
class ModelLocalisationZone extends Model {
public function getZone($zone_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone WHERE zone_id = '" . (int)$zone_id . "' AND status = '1'");
return $query->row;
}
public function getZonesByCountryId($country_id) {
$zone_data = $this->cache->get('zone.' . (int)$country_id);
if (!$zone_data) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone WHERE country_id = '" . (int)$country_id . "' AND status = '1' ORDER BY name");
$zone_data = $query->rows;
$this->cache->set('zone.' . (int)$country_id, $zone_data);
}
return $zone_data;
}
}