Advertisement
Guest User

Untitled

a guest
Jan 14th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.87 KB | None | 0 0
  1. <?php
  2. /*
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.5.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 22.06.2018
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. define('TEXTFIELDS', 'TEXTFELD,TEXTAREA,DATEPICKER');
  15. define('TEXTFIELDS_CALCULATE', 'TEXTFELD,TEXTAREA');
  16. define('RPA_MULTISELECT_CHECKBOXES', false);
  17. define('DIR_RPA_COM', DIR_FS_CATALOG . 'includes/rpa-com/');
  18. require_once DIR_RPA_COM . 'rpa_module.php';
  19. require_once DIR_FS_INC . 'xtc_oe_get_options_values_name.inc.php';
  20. require_once DIR_FS_INC . 'xtc_oe_get_options_name.inc.php';
  21.  
  22. class rpa_CustomInputs
  23. {
  24. public static $textfeld = '';
  25. public static $fileupload = '';
  26. public static $price_per_sign = false;
  27. public static $price_free_signs = 0;
  28. public static $price_per_word = false;
  29. public static $price_free_words = 0;
  30.  
  31. public function __construct()
  32. {
  33. }
  34.  
  35. public static function checkout_process_attributes_v106($sql_data_array, $i, $j)
  36. {
  37. global $order;
  38.  
  39. if (!rpa_Module::module_check('textfeld')) {
  40. return $sql_data_array;
  41. }
  42.  
  43. $value = $order->products[$i]['attributes'][$j]['value_id'];
  44. $options_values_name = xtc_oe_get_options_values_name($value, '');
  45.  
  46. if (self::is_textfield($options_values_name, 'strpos') || $options_values_name == 'FILEUPLOAD') {
  47. $value = $order->products[$i]['attributes'][$j]['value_id'];
  48. $sql_data_array['products_options_values'] = trim(nl2br($_SESSION['cart_textfeld'][$order->products[$i]['id']][$value]));
  49. $fileupload = $_SESSION['cart_fileupload'][$order->products[$i]['id']][$value];
  50.  
  51. if ($fileupload != '' && is_file($fileupload)) {
  52. $tmp1 = $fileupload;
  53. $fileupload = str_replace('upload_tmp_', 'upload_', $fileupload);
  54. copy($tmp1, $fileupload);
  55. unlink($tmp1);
  56. $sql_data_array['products_options_fileupload'] = $fileupload;
  57. }
  58.  
  59. if (isset($_SESSION['cart_textfeld'][$order->products[$i]['id']][$value])) {
  60. unset($_SESSION['cart_textfeld'][$order->products[$i]['id']][$value]);
  61. }
  62.  
  63. if (isset($_SESSION['cart_fileupload'][$order->products[$i]['id']][$value])) {
  64. unset($_SESSION['cart_fileupload'][$order->products[$i]['id']][$value]);
  65. }
  66. }
  67.  
  68. return $sql_data_array;
  69. }
  70.  
  71. public static function checkout_process_attributes($sql_data_array, $i, $j)
  72. {
  73. global $order;
  74.  
  75. if (!rpa_Module::module_check('textfeld')) {
  76. return $sql_data_array;
  77. }
  78.  
  79. $value = $order->products[$i]['attributes'][$j]['value_id'];
  80. $options_values_name = xtc_oe_get_options_values_name($value, '');
  81.  
  82. if (self::is_textfield($options_values_name, 'strpos') || $options_values_name == 'FILEUPLOAD') {
  83. $sql_data_array['products_options_values'] = trim(nl2br($_SESSION['cart_textfeld'][$order->products[$i]['id']][$value]));
  84. $fileupload = $_SESSION['cart_fileupload'][$order->products[$i]['id']][$value];
  85.  
  86. if ($fileupload != '' && is_file($fileupload) && strpos($fileupload, 'upload_tmp_') !== false) {
  87. $tmp1 = $fileupload;
  88. $fileupload = str_replace('upload_tmp_', 'upload_', $fileupload);
  89. copy($tmp1, $fileupload);
  90. unlink($tmp1);
  91. }
  92.  
  93. if ($fileupload != '' && is_file($fileupload)) {
  94. $sql_data_array['products_options_fileupload'] = $fileupload;
  95. }
  96.  
  97. if (isset($_SESSION['cart_textfeld'][$order->products[$i]['id']][$value])) {
  98. unset($_SESSION['cart_textfeld'][$order->products[$i]['id']][$value]);
  99. }
  100.  
  101. if (isset($_SESSION['cart_fileupload'][$order->products[$i]['id']][$value])) {
  102. unset($_SESSION['cart_fileupload'][$order->products[$i]['id']][$value]);
  103. }
  104. }
  105.  
  106. return $sql_data_array;
  107. }
  108.  
  109. public static function check_required_textfields()
  110. {
  111. $params = $_POST['id'];
  112. $error_msg = '';
  113. $fileupload_ok = '';
  114.  
  115. if (is_array($params) && 0 < sizeof($params)) {
  116. reset($params);
  117.  
  118. while (list($option, $value) = each($params)) {
  119. $text = '';
  120. $value_name = xtc_oe_get_options_values_name($value, '');
  121.  
  122. if (self::is_textfield($value_name, 'strpos')) {
  123. $text = trim($_POST['txt_' . $value]);
  124.  
  125. if (isset($_POST['req_' . $value]) && $text == '') {
  126. $error_msg .= xtc_oe_get_options_name($option, '') . TEXT_ERROR_MSG_FIELD;
  127. }
  128.  
  129. $maxlength = self::get_input_maxlength($value_name);
  130. $text = preg_replace("'[\r\n]+'", ' ', $text);
  131. $textlength = self::string_length($text);
  132.  
  133. if (0 < $maxlength && $maxlength < $textlength) {
  134. $error_msg .= xtc_oe_get_options_name($option, '') . sprintf(TEXT_ERROR_MAX_LENGTH, $maxlength, $textlength);
  135. }
  136.  
  137. if (!isset($_POST['req_' . $value]) && $text == '') {
  138. unset($_POST['id'][$option]);
  139. }
  140. }
  141.  
  142. if ($value_name == 'FILEUPLOAD') {
  143. include DIR_RPA_COM . 'rpa_upload.php';
  144. ...............................................................................
  145. ..................................................
  146. ..........................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement