Advertisement
Guest User

Untitled

a guest
Aug 13th, 2022
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.67 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 ModelExtensionDreamFilter extends Model
  15. {
  16. protected $imagetypes = ['image', 'multiimage'];
  17. protected $getImages = true;
  18. protected $multitypes = ['type_single', 'radio', 'checkbox', 'image', 'multiimage'];
  19. protected $code = 'rdrf';
  20. private $_errors = [];
  21. private $_weights = [];
  22. private $_lengths = [];
  23. public $cacheDuration;
  24. public $view;
  25. public $settings;
  26. public $notavailable;
  27. public $module_id = '';
  28. public $cachePath;
  29. public $cacheFileSuffix = '.bin';
  30. public $sortTypes = ['p.date_added', 'p.date_available', 'p.date_modified', 'p.height', 'p.image', 'p.length', 'p.location', 'p.manufacturer_id', 'p.minimum', 'p.sku', 'p.upc', 'p.ean', 'p.jan', 'p.isbn', 'p.mpn', 'p.model', 'p.points', 'p.price', 'p.product_id', 'p.quantity', 'p.shipping', 'p.sort_order', 'p.stock_status_id', 'p.subtract', 'p.status', 'p.tax_class_id', 'p.viewed', 'p.weight', 'p.width', 'pd.description', 'pd.name', 'pd.tag', 'discount', 'rating', 'special'];
  31. private $types = [
  32. 'name' => ['name' => 'name', 'code' => 'name', 'key' => 'filter_name'],
  33. 'price' => [
  34. 'name' => 'price',
  35. 'code' => 'price',
  36. 'key' => 'filter_price',
  37. 'keys' => ['filter_price_min', 'filter_price_max']
  38. ],
  39. 'stock' => ['name' => 'stock', 'code' => 'stock', 'key' => 'filter_stock'],
  40. 'novelty' => ['name' => 'novelty', 'code' => 'new', 'key' => 'filter_new'],
  41. 'special' => ['name' => 'special', 'code' => 'spc', 'key' => 'filter_special'],
  42. 'length' => ['name' => 'length', 'code' => 'lgth', 'key' => 'filter_length'],
  43. 'width' => ['name' => 'width', 'code' => 'wdth', 'key' => 'filter_width', 'md5' => true],
  44. 'height' => ['name' => 'height', 'code' => 'hght', 'key' => 'filter_height'],
  45. 'weight' => ['name' => 'weight', 'code' => 'wght', 'key' => 'filter_weight'],
  46. 'rating' => ['name' => 'rating', 'code' => 'rtng', 'key' => 'filter_rating'],
  47. 'tags' => ['name' => 'tags', 'code' => 'tag', 'key' => 'filter_tag', 'md5' => true],
  48. 'model' => ['name' => 'model', 'code' => 'model', 'key' => 'filter_model', 'md5' => true],
  49. 'sku' => ['name' => 'sku', 'code' => 'sku', 'key' => 'filter_sku', 'md5' => true],
  50. 'upc' => ['name' => 'upc', 'code' => 'upc', 'key' => 'filter_upc', 'md5' => true],
  51. 'ean' => ['name' => 'ean', 'code' => 'ean', 'key' => 'filter_ean', 'md5' => true],
  52. 'jan' => ['name' => 'jan', 'code' => 'jan', 'key' => 'filter_jan', 'md5' => true],
  53. 'isbn' => ['name' => 'isbn', 'code' => 'isbn', 'key' => 'filter_isbn', 'md5' => true],
  54. 'mpn' => ['name' => 'mpn', 'code' => 'mpn', 'key' => 'filter_mpn', 'md5' => true],
  55. 'manufacturers' => [
  56. 'name' => 'manufacturers',
  57. 'code' => 'man',
  58. 'key' => 'filter_manufacturer_id',
  59. 'sort_keys' => ['count', 'name', 'sort']
  60. ],
  61. 'categories' => ['name' => 'categories', 'code' => 'ctg', 'key' => 'filter_category', 'sorted' => true],
  62. 'attributes' => ['name' => 'attributes', 'code' => 'attr', 'key' => 'filter_attributes', 'sorted' => true, 'md5' => true],
  63. 'options' => ['name' => 'options', 'code' => 'opt', 'key' => 'filter_options', 'sorted' => true],
  64. 'filters' => ['name' => 'filters', 'code' => 'fil', 'key' => 'filter_filter', 'sorted' => true]
  65. ];
  66. private $multiparams = ['attr', 'opt', 'fil'];
  67.  
  68. public function __construct($registry)
  69. {
  70. parent::__construct($registry);
  71.  
  72. if (version_compare(phpversion(), '5.6', '<')) {
  73. $this->_errors[] = $this->language->get('error_php');
  74. }
  75.  
  76. $this->cachePath = DIR_CACHE . '../rdr-cache';
  77. $this->notavailable = $this->config->get('rdrf_notavailable');
  78. $cache_time = $this->config->get('rdrf_cachetime');
  79. if ($this->config->get('rdrf_cachestatus') && $cache_time) {
  80. $this->cacheDuration = $cache_time * 3600;
  81. }
  82.  
  83. if ($this->cacheDuration) {
  84. if (!is_dir($this->cachePath)) {
  85. mkdir($this->cachePath, 509, true);
  86. }
  87.  
  88. $this->cleanCache(false);
  89. }
  90. else if (is_dir($this->cachePath)) {
  91. $this->cleanCache();
  92. rmdir($this->cachePath);
  93. }
  94. }
  95.  
  96. public function __debugInfo()
  97. {
  98. return [];
  99. }
  100.  
  101. public function __call($name, $arguments)
  102. {
  103. return $name;
  104. }
  105.  
  106. static public function __callStatic($name, $arguments)
  107. {
  108. return $name;
  109. }
  110.  
  111. private function parseRequest($data = [])
  112. {
  113. $parsed = [];
  114. $default = ['filter_category_id', 'filter_sub_category', 'filter_manufacturer_id', 'filter_name', 'filter_tag', 'filter_description', 'filter_stock', 'special', 'sort', 'order', 'start', 'limit'];
  115.  
  116. foreach ($default as $p) {
  117. if (isset($data[$p]) && ($data[$p] !== '')) {
  118. $parsed[$p] = $data[$p];
  119. }
  120. }
  121. if (isset($data['filter_filter']) && version_compare(VERSION, '1.5.5', '>=')) {
  122. if (strpos($data['filter_filter'], ',') !== false) {
  123. $parsed['filter_filter'] = explode(',', $data['filter_filter']);
  124. }
  125. else if ($data['filter_filter'] !== '') {
  126. $parsed['filter_filter'] = $this->obf_5qwIjmoq1qIOeiZuks6qjwLuws7E($data['filter_filter']);
  127. }
  128. }
  129.  
  130. if (!empty($data[$this->code])) {
  131. if (is_string($data[$this->code])) {
  132. $data[$this->code] = $this->obf_5CUiaSiuISlq7yxspqIh6uubyvvqE($data[$this->code]);
  133. }
  134.  
  135. $filters = $data[$this->code];
  136. if (!empty($filters['name']) && empty($parsed['filter_name']) && empty($parsed['filter_tag'])) {
  137. $parsed['filter_name'] = $this->obf_5qwIjmoq1qIOeiZuks6qjwLuws7E($filters['name']);
  138. }
  139. if (($this->customer->isLogged() || !$this->config->get('config_customer_price')) && !empty($filters['price']) && (stripos($filters['price'], ';') !== false)) {
  140. $parsed['filter_price_min'] = explode(';', $this->obf_5qwIjmoq1qIOeiZuks6qjwLuws7E($filters['price']))[0];
  141. $parsed['filter_price_max'] = explode(';', $this->obf_5qwIjmoq1qIOeiZuks6qjwLuws7E($filters['price']))[1];
  142. }
  143. if (isset($filters['new']) && is_array($filters['new'])) {
  144. foreach ($filters['new'] as $days => $new) {
  145. $parsed['filter_new'][$days] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($new);
  146. }
  147. }
  148.  
  149. if (isset($filters['stock'])) {
  150. $parsed['filter_stock'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['stock']);
  151. }
  152.  
  153. if (isset($filters['spc'])) {
  154. if ($filters['spc'] === 'true') {
  155. $parsed['filter_special'] = true;
  156. }
  157. else if ($filters['spc'] === 'false') {
  158. $parsed['filter_special'] = false;
  159. }
  160. else {
  161. $parsed['filter_special'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['spc']);
  162. }
  163. }
  164.  
  165. if (isset($filters['rtng'])) {
  166. $parsed['filter_rating'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['rtng']);
  167. }
  168. if (!empty($filters['tag']) && empty($parsed['filter_name']) && empty($parsed['filter_tag'])) {
  169. $parsed['filter_tag'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['tag']);
  170. }
  171.  
  172. if (isset($filters['model'])) {
  173. if (is_array($filters['model'])) {
  174. $parsed['filter_model'] = $this->obf_7qqiZipoawo5KNoqWSi4qoayrrE($filters['model']);
  175. }
  176. else {
  177. $parsed['filter_model'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['model']);
  178. }
  179. }
  180.  
  181. if (!empty($filters['sku'])) {
  182. $parsed['filter_sku'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['sku']);
  183. }
  184.  
  185. if (!empty($filters['upc'])) {
  186. $parsed['filter_upc'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['upc']);
  187. }
  188.  
  189. if (!empty($filters['ean'])) {
  190. $parsed['filter_ean'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['ean']);
  191. }
  192.  
  193. if (!empty($filters['jan'])) {
  194. $parsed['filter_jan'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['jan']);
  195. }
  196.  
  197. if (!empty($filters['isbn'])) {
  198. $parsed['filter_isbn'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['isbn']);
  199. }
  200.  
  201. if (!empty($filters['mpn'])) {
  202. $parsed['filter_mpn'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['mpn']);
  203. }
  204. if (!empty($filters['man']) && empty($parsed['filter_manufacturer_id'])) {
  205. $parsed['filter_manufacturer_id'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['man']);
  206. }
  207.  
  208. if (!empty($filters['ctg'])) {
  209. $parsed['filter_category'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['ctg']);
  210. }
  211. if (!empty($filters['fil']) && empty($parsed['filter_filter']) && version_compare(VERSION, '1.5.5', '>=')) {
  212. $parsed['filter_filter'] = $this->obf_7qqiZipoawo5KNoqWSi4qoayrrE($filters['fil']);
  213. }
  214.  
  215. if (!empty($filters['attr'])) {
  216. $parsed['filter_attributes'] = $this->obf_7qqiZipoawo5KNoqWSi4qoayrrE($filters['attr']);
  217. }
  218.  
  219. if (!empty($filters['opt'])) {
  220. $parsed['filter_options'] = $this->obf_7qqiZipoawo5KNoqWSi4qoayrrE($filters['opt']);
  221. }
  222.  
  223. if (isset($filters['lgth'])) {
  224. $parsed['filter_length'] = $this->obf_6qnk4KujIeosZaVwJ2XpJGNjLOznLE($filters['lgth'])[0];
  225. $parsed['length_decimals'] = $this->obf_6qnk4KujIeosZaVwJ2XpJGNjLOznLE($filters['lgth'])[1];
  226. }
  227.  
  228. if (isset($filters['wdth'])) {
  229. $parsed['filter_width'] = $this->obf_6qnk4KujIeosZaVwJ2XpJGNjLOznLE($filters['wdth'])[0];
  230. $parsed['width_decimals'] = $this->obf_6qnk4KujIeosZaVwJ2XpJGNjLOznLE($filters['wdth'])[1];
  231. }
  232.  
  233. if (isset($filters['hght'])) {
  234. $parsed['filter_height'] = $this->obf_6qnk4KujIeosZaVwJ2XpJGNjLOznLE($filters['hght'])[0];
  235. $parsed['height_decimals'] = $this->obf_6qnk4KujIeosZaVwJ2XpJGNjLOznLE($filters['hght'])[1];
  236. .................................................................
  237. .....................................
  238. ...............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement