Advertisement
Guest User

Untitled

a guest
Jan 24th, 2021
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.63 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class ModelExtensionAdminProductFilter extends Model
  15. {
  16. private $host;
  17.  
  18. public function getProductImage($product_id, $license_key)
  19. {
  20. if ($this->checkLicense($license_key)) {
  21. $query = $this->db->query('SELECT image FROM ' . DB_PREFIX . 'product WHERE product_id = \'' . (int) $product_id . '\'');
  22. return $query->row['image'];
  23. }
  24. else {
  25. return false;
  26. }
  27. }
  28.  
  29. public function editProductImage($product_id, $product_image, $license_key)
  30. {
  31. if ($this->checkLicense($license_key)) {
  32. $this->db->query('UPDATE ' . DB_PREFIX . 'product SET image = \'' . $this->db->escape($product_image) . '\' WHERE product_id = \'' . (int) $product_id . '\'');
  33. }
  34. }
  35.  
  36. public function editProductImages($product_id, $product_images, $license_key)
  37. {
  38. if ($this->checkLicense($license_key)) {
  39. $this->db->query('DELETE FROM ' . DB_PREFIX . 'product_image WHERE product_id = \'' . (int) $product_id . '\'');
  40.  
  41. if (isset($product_images)) {
  42. foreach ($product_images as $product_image) {
  43. $this->db->query('INSERT INTO ' . DB_PREFIX . 'product_image SET product_id = \'' . (int) $product_id . '\', image = \'' . $this->db->escape($product_image['image']) . '\', sort_order = \'' . (int) $product_image['sort_order'] . '\'');
  44. }
  45. }
  46. }
  47. }
  48.  
  49. public function getProductNames($product_id, $license_key)
  50. {
  51. if ($this->checkLicense($license_key)) {
  52. $query = $this->db->query('SELECT language_id, `name` FROM ' . DB_PREFIX . 'product_description WHERE product_id = \'' . (int) $product_id . '\'');
  53. return $query->rows;
  54. }
  55. else {
  56. return [];
  57. }
  58. }
  59.  
  60. public function editProductNames($product_id, $language_id, $name, $license_key)
  61. {
  62. if ($this->checkLicense($license_key)) {
  63. $this->db->query('UPDATE ' . DB_PREFIX . 'product_description SET name = \'' . $this->db->escape($name) . '\' WHERE language_id = \'' . (int) $language_id . '\' AND product_id = \'' . (int) $product_id . '\'');
  64. }
  65. }
  66.  
  67. public function getProductModel($product_id)
  68. {
  69. $query = $this->db->query('SELECT model FROM ' . DB_PREFIX . 'product WHERE product_id = \'' . (int) $product_id . '\'');
  70. return $query->row['model'];
  71. }
  72.  
  73. public function editProductModel($product_id, $model)
  74. {
  75. $this->db->query('UPDATE ' . DB_PREFIX . 'product SET model = \'' . $this->db->escape($model) . '\' WHERE product_id = \'' . (int) $product_id . '\'');
  76. }
  77.  
  78. public function getProductSku($product_id)
  79. {
  80. $query = $this->db->query('SELECT sku FROM ' . DB_PREFIX . 'product WHERE product_id = \'' . (int) $product_id . '\'');
  81. return $query->row['sku'];
  82. }
  83.  
  84. public function editProductSku($product_id, $sku)
  85. {
  86. $this->db->query('UPDATE ' . DB_PREFIX . 'product SET sku = \'' . $this->db->escape($sku) . '\' WHERE product_id = \'' . (int) $product_id . '\'');
  87. }
  88.  
  89. public function getProductManufacturerID($product_id, $license_key)
  90. {
  91. if ($this->checkLicense($license_key)) {
  92. $query = $this->db->query('SELECT manufacturer_id FROM ' . DB_PREFIX . 'product WHERE product_id = \'' . (int) $product_id . '\'');
  93. return $query->row['manufacturer_id'];
  94. }
  95. else {
  96. return false;
  97. }
  98. }
  99.  
  100. public function editProductManufacturerID($product_id, $manufacturer_id, $license_key)
  101. {
  102. if ($this->checkLicense($license_key)) {
  103. ....................................................................................
  104. ...................................................
  105. ........................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement