Advertisement
Guest User

Untitled

a guest
Dec 4th, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.14 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 ControllerModuleEditproductEditimage extends Controller
  15. {
  16. private $error = [];
  17. public $aleksey_20 = false;
  18. public $aleksey_40 = false;
  19. public $aleksey_34 = '';
  20. public $activation_key_expires;
  21. public $secret_key = '0ppTa6EIjJhe75KL51KL4ZnD';
  22. public $secret_key_dec = 'b0mstBmTJtF9sffJLxkdkVNM';
  23. public $aleksey_6 = 'http://validator.waterfilter.in.ua/api.php';
  24. public $remote_port = 80;
  25. public $remote_timeout = 20;
  26. public $local_ua = 'PHP code protect';
  27. public $aleksey_18 = false;
  28. public $use_expires = false;
  29. public $local_key_storage = 'filesystem';
  30. public $aleksey_5 = './';
  31. public $aleksey_24 = 'cyberstore.php';
  32. public $local_key_transport_order = 'scf';
  33. public $local_key_delay_period = 1;
  34. public $local_key_last;
  35. public $release_date = '2019-12-26';
  36. public $user_name = '';
  37. public $status_messages = ['status_1' => '<span style="color:green;">Лицензия Активна. Спасибо! / License activity. Thank you!</span>', 'status_2' => 'Срок закончился. / The term ended.', 'status_3' => 'Ожидает повторной активации. / Pending re-activation.', 'status_4' => 'License suspended.', 'localhost' => 'Активна на компе / Is active on a computer', 'pending' => 'Ожидает активации. / Awaiting activation', 'download_access_expired' => 'Неверный ключ / Invalid key', 'missing_activation_key' => 'Укажите ключ. / Enter key.', 'could_not_obtain_local_key' => 'Невозможно получить ключ. / Unable to get the key.', 'maximum_delay_period_expired' => 'Ключ истек. / The key has expired.', 'local_key_tampering' => 'Ключ не действителен. / The key is not valid.', 'local_key_invalid_for_location' => 'Неверный ключ / Invalid key', 'missing_license_file' => 'Создайте файл и папки / Create files and folders:<br />', 'license_file_not_writable' => 'Сделайте права для записи 777 / Make the right to record 777<br />', 'invalid_local_key_storage' => 'не могу удалить я ключ, попросите автора модуля(шаблона) / I can not remove the key, ask the author of the module (template)', 'could_not_save_local_key' => 'ключ на могу записать, проверьте права на файл', 'activation_key_string_mismatch' => 'Неверный ключ / Invalid key'];
  38. private $trigger_delay_period;
  39.  
  40. public function index()
  41. {
  42. if (isset($this->request->server['HTTP_X_REQUESTED_WITH']) && !empty($this->request->server['HTTP_X_REQUESTED_WITH']) && (strtolower($this->request->server['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')) {
  43. $this->licenseValidation();
  44. $this->load->language('product/product');
  45. $this->load->language('product/product_quick');
  46. $this->load->model('catalog/product');
  47. $this->load->model('catalog/product_quick');
  48. $data['ch_user'] = $this->language->get('ch_user');
  49. $data['ch_image_general'] = $this->language->get('ch_image_general');
  50. $data['ch_image_additional'] = $this->language->get('ch_image_additional');
  51. $data['ch_date'] = $this->language->get('ch_date');
  52. $data['button_last_change'] = $this->language->get('button_last_change');
  53. $data['button_save'] = $this->language->get('button_save');
  54. $data['button_cancel'] = $this->language->get('button_cancel');
  55. $data['text_images_product'] = $this->language->get('text_images_product');
  56. $data['column_image'] = $this->language->get('column_image');
  57. $data['entry_sort_order'] = $this->language->get('entry_sort_order');
  58. $data['text_image_manager'] = $this->language->get('text_image_manager');
  59. $data['entry_image'] = $this->language->get('entry_image');
  60. $data['entry_sort_order'] = $this->language->get('entry_sort_order');
  61. $data['text_browse'] = $this->language->get('text_browse');
  62. $data['text_clear'] = $this->language->get('text_clear');
  63. $data['button_add_image'] = $this->language->get('button_add_image');
  64. $data['button_remove'] = $this->language->get('button_remove');
  65. $data['text_card_is_closed'] = $this->language->get('text_card_is_closed');
  66. $data['token'] = $this->session->data['user_token'];
  67. $data['product_name'] = $this->model_catalog_product_quick->getProductName($this->request->get['product_id']);
  68. $this->load->model('tool/image');
  69. $data['product_image'] = $this->model_tool_image->resize($this->model_catalog_product_quick->getProductIMG($this->request->get['product_id']), 100, 100);
  70. $data['product_no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
  71. $product_id = $this->request->get['product_id'];
  72. $data['product_id'] = $this->request->get['product_id'];
  73. $this->registry->set('user', new Cart\User($this->registry));
  74. $data['user_editprod_change'] = $this->user->getUserName();
  75. $data['user_change'] = $this->user->getUserName();
  76. $data['change_edit_image'] = $this->model_catalog_product_quick->ChangeImage($product_id);
  77.  
  78. if (isset($this->request->post['product_image'])) {
  79. $product_images = $this->request->post['product_image'];
  80. }
  81. else if (isset($this->request->get['product_id'])) {
  82. $product_images = $this->model_catalog_product_quick->getProductImages($this->request->get['product_id']);
  83. }
  84. else {
  85. $product_images = [];
  86. }
  87.  
  88. $data['product_images'] = [];
  89.  
  90. if (!empty($product_images)) {
  91. foreach ($product_images as $key => $value) {
  92. $obf_DSYsHywdJTsCIgQNGxcbLxgtXCkHFRE[$key] = $value['sort_order'];
  93. }
  94.  
  95. array_multisort($obf_DSYsHywdJTsCIgQNGxcbLxgtXCkHFRE, SORT_ASC, $product_images);
  96. }
  97.  
  98. foreach ($product_images as $product_image) {
  99. if ($product_image['image'] && file_exists(DIR_IMAGE . $product_image['image'])) {
  100. $image = $product_image['image'];
  101. }
  102. else {
  103. $image = 'no_image.jpg';
  104. }
  105.  
  106. $data['product_images'][] = ['image' => $image, 'thumb' => $this->model_tool_image->resize($image, 100, 100), 'sort_order' => $product_image['sort_order']];
  107. }
  108.  
  109. $product_info = $this->model_catalog_product_quick->getProduct($this->request->get['product_id']);
  110. $data['placeholder'] = $this->model_tool_image->resize('no_image.png', 100, 100);
  111.  
  112. if (isset($this->request->post['config_general_image'])) {
  113. $data['config_general_image'] = $this->request->post['config_general_image'];
  114. }
  115. else {
  116. $data['config_general_image'] = $product_info['image'];
  117. }
  118. if (isset($this->request->post['config_general_image']) && is_file(DIR_IMAGE . $this->request->post['config_general_image'])) {
  119. $data['general_image'] = $this->model_tool_image->resize($this->request->post['config_general_image'], 100, 100);
  120. }
  121. else if ($product_info['image'] && is_file(DIR_IMAGE . $product_info['image'])) {
  122. $data['general_image'] = $this->model_tool_image->resize($product_info['image'], 100, 100);
  123. }
  124. else {
  125. $data['general_image'] = $this->model_tool_image->resize('no_image.png', 100, 100);
  126. }
  127.  
  128. $this->response->setOutput($this->load->view('module/editproduct/editimage', $data));
  129. }
  130. else {
  131. $this->response->redirect($this->url->link('error/not_found', '', true));
  132. }
  133. }
  134.  
  135. public function saveImage()
  136. {
  137. if (isset($this->request->server['HTTP_X_REQUESTED_WITH']) && !empty($this->request->server['HTTP_X_REQUESTED_WITH']) && (strtolower($this->request->server['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')) {
  138. $this->load->language('product/product_quick');
  139. $this->load->model('catalog/product_quick');
  140. $json = [];
  141.  
  142. if ($this->request->server['REQUEST_METHOD'] == 'POST') {
  143. $product_id = $this->request->get['product_id'];
  144. $product_info = $this->model_catalog_product_quick->getProduct($this->request->get['product_id']);
  145. $addtional_image_select = $this->model_catalog_product_quick->getProductImages($this->request->get['product_id']);
  146.  
  147. if (!empty($addtional_image_select)) {
  148. foreach ($addtional_image_select as $ad_images) {
  149. $ad_image[] = $ad_images['image'];
  150. }
  151. }
  152. else {
  153. $ad_image[] = '';
  154. }
  155.  
  156. if (isset($this->request->post['product_image'])) {
  157. foreach ($this->request->post['product_image'] as $post_add_image) {
  158. $obf_DRgcKDIPBDA1FCoLMykUIgYLPSEDAzI[] = $post_add_image['image'];
  159. }
  160.  
  161. if ($obf_DRgcKDIPBDA1FCoLMykUIgYLPSEDAzI != $ad_image) {
  162. $additional_image = 'AI';
  163. }
  164. else {
  165. $additional_image = '';
  166. }
  167. }
  168. else {
  169. $additional_image = '';
  170. }
  171.  
  172. $addtional_image_select = $this->model_catalog_product_quick->getProductImages($this->request->get['product_id']);
  173.  
  174. if (!empty($addtional_image_select)) {
  175. foreach ($addtional_image_select as $sort_order_array_data) {
  176. $sort_order_data[] = $sort_order_array_data['sort_order'];
  177. }
  178.  
  179. sort($sort_order_data);
  180. .............................................................................
  181. ..........................................
  182. ................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement