SHARE
TWEET

Untitled

a guest Jul 13th, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. if (!function_exists('str_ireplace')) {
  15.     function str_ireplace($search, $replace, $subject)
  16.     {
  17.         $token = chr(1);
  18.         $haystack = strtolower($subject);
  19.         $needle = strtolower($search);
  20.  
  21.         while (($pos = strpos($haystack, $needle)) !== false) {
  22.             $subject = substr_replace($subject, $token, $pos, strlen($search));
  23.             $haystack = substr_replace($haystack, $token, $pos, strlen($search));
  24.         }
  25.         $subject = str_replace($token, $replace, $subject);
  26.  
  27.         return $subject;
  28.     }
  29. }
  30.  
  31. function get_afterbuy($send_data)
  32. {
  33.     $serv = 'ssl://api.afterbuy.de';
  34.     $getreq = '/afterbuy/ABInterface.aspx';
  35.     $port = 443;
  36.     $result = '';
  37.  
  38.     if (AFTERBUY_USECURL == 'true') {
  39.         $afterbuy_URL = 'https://api.afterbuy.de' . $getreq;
  40.         $ch = curl_init();
  41.         curl_setopt($ch, CURLOPT_URL, '' . $afterbuy_URL);
  42.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  43.         curl_setopt($ch, CURLOPT_HEADER, 1);
  44.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  45.         $out = '' . 'POST ' . $getreq . " HTTP/1.0\r\n";
  46.         $out .= "Host: api.afterbuy.de\r\n";
  47.         $out .= 'Content-length: ' . strlen($send_data) . "\r\n";
  48.         $out .= "Content-type: application/x-www-form-urlencoded\r\n";
  49.         $out .= "Connection: Close\r\n\r\n";
  50.         $out .= $send_data;
  51.         curl_setopt($ch, CURLOPT_TIMEOUT, 600);
  52.         curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $out);
  53.         $result = curl_exec($ch);
  54.  
  55.         if (curl_errno($ch)) {
  56.             curl_error($ch);
  57.             print curl_error($ch);
  58.         } else {
  59.             curl_close($ch);
  60.         }
  61.  
  62.         $result = explode("\r\n\r\n", $result);
  63.         unset($result[0]);
  64.         $result = implode('', $result);
  65.     } else {
  66.         $fp = fsockopen($serv, 443, $errno, $errstr, 30);
  67.         stream_set_timeout($fp, 600);
  68.  
  69.         if (!$fp) {
  70.             print_r('' . $errstr . ' (' . $errno . ")<br />\n");
  71.         } else {
  72.             $out = '' . 'POST ' . $getreq . " HTTP/1.0\r\n";
  73.             $out .= "Host: api.afterbuy.de\r\n";
  74.             $out .= 'Content-length: ' . strlen($send_data) . "\r\n";
  75.             $out .= "Content-type: application/x-www-form-urlencoded\r\n";
  76.             $out .= "Connection: Close\r\n\r\n";
  77.             $out .= $send_data;
  78.             fwrite($fp, $out);
  79.  
  80.             while (!feof($fp)) {
  81.                 $result .= @fgets($fp, 128);
  82.             }
  83.             fclose($fp);
  84.             $result = explode("\r\n\r\n", $result);
  85.             unset($result[0]);
  86.             $result = implode('', $result);
  87.         }
  88.     }
  89.  
  90.     return $result;
  91. }
  92.  
  93. function ab_preis_to_xtc_preis($wert)
  94. {
  95.     $wert = preg_replace('/,/', '.', $wert);
  96.  
  97.     return (double) $wert;
  98. }
  99.  
  100. function xtc_preis_to_ab_preis($wert)
  101. {
  102.     $wert2 = str_replace('.', ',', $wert);
  103.  
  104.     return $wert2;
  105. }
  106.  
  107. function divide_mwst($wert)
  108. {
  109. }
  110.  
  111. function save_log($filename, $content, $flag = 0, $schalter = '')
  112. {
  113.     $error_log = '';
  114.     $today = date('F j, Y, g:i a');
  115.  
  116.     if ($schalter == '') {
  117.         $schalter = 'w';
  118.     }
  119.  
  120.     if (is_writable($filename)) {
  121.         if (!($handle = fopen($filename, $schalter))) {
  122.             $error_log .= 'Kann die Log-Datei ' . $filename . ' nicht √∂ffnen';
  123.  
  124.             exit();
  125.         }
  126.  
  127.         if ($flag == 0) {
  128.             $content = '<HTML><HEAD><meta http-equiv="cache-control" content="no-cache"></HEAD><BODY><p>Log-Datei ' . $filename . ' erstellt: ' . $today . '</p>' . $content . '</BODY></HTML>';
  129.  
  130.             if (@fwrite($handle, $content) === false) {
  131.                 $error_log .= 'Kann in die Log-Datei ' . $filename . ' nicht schreiben';
  132.             }
  133.         } else {
  134.             if (@fwrite($handle, $content) === false) {
  135.                 $error_log .= 'Kann in die Log-Datei ' . $filename . ' nicht schreiben';
  136.             }
  137.         }
  138.  
  139.         fclose($handle);
  140.     } else {
  141.         $error_log .= 'Die Datei ' . $filename . ' ist nicht beschreibbar';
  142.     }
  143.  
  144.     return $error_log;
  145. }
  146.  
  147. function getabxmlhead($schalter, $level = 0)
  148. {
  149.     $PartnerID = AFTERBUY_PARTNERID;
  150.     $PartnerPass = AFTERBUY_PARTNERPASS;
  151.     $UserID = AFTERBUY_USERID;
  152.     $Userpass = AFTERBUY_USERPW;
  153.  
  154.     switch ($schalter) {
  155.         case 'stockinfo':
  156.             $temp = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n    <DATA>\r\n\t  <AFTERBUY>\r\n\t\t<ACTION>GetStockInfo</ACTION>\r\n\t\t<PARTNERID>" . $PartnerID . "</PARTNERID>\r\n\t\t<PARTNERPASS>" . $PartnerPass . "</PARTNERPASS>\r\n\t\t<USERID>" . $UserID . "</USERID>\r\n\t\t<USERPASS>" . $Userpass . "</USERPASS>\r\n\t  </AFTERBUY>\r\n\t  <PRODUCTS>";
  157.  
  158.             break;
  159.  
  160.         case 'stockimport':
  161.             $temp = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n  <Request>  \r\n  <AfterbuyGlobal>\r\n    <PartnerID>" . $PartnerID . "</PartnerID>\r\n    <PartnerPassword>" . $PartnerPass . "</PartnerPassword>\r\n    <UserID>" . $UserID . "</UserID>\r\n    <UserPassword>" . $Userpass . "</UserPassword>\r\n    <CallName>GetStockInfo</CallName>\r\n    <DetailLevel>0</DetailLevel>\r\n    <ErrorLanguage>DE</ErrorLanguage>\r\n  </AfterbuyGlobal>";
  162.  
  163.             break;
  164.  
  165.         case 'catalogexport':
  166.             $temp = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n  <Request>  \r\n  <AfterbuyGlobal>\r\n    <PartnerID>" . $PartnerID . "</PartnerID>\r\n    <PartnerPassword>" . $PartnerPass . "</PartnerPassword>\r\n    <UserID>" . $UserID . "</UserID>\r\n    <UserPassword>" . $Userpass . "</UserPassword>\r\n    <CallName>UpdateCatalogs</CallName>\r\n    <DetailLevel>0</DetailLevel>\r\n    <ErrorLanguage>DE</ErrorLanguage>\r\n  </AfterbuyGlobal>";
  167.  
  168.             break;
  169.  
  170.         case 'stockimport2':
  171.             $temp = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n  <Request>  \r\n  <AfterbuyGlobal>\r\n    <PartnerID>" . $PartnerID . "</PartnerID>\r\n    <PartnerPassword>" . $PartnerPass . "</PartnerPassword>\r\n    <UserID>" . $UserID . "</UserID>\r\n    <UserPassword>" . $Userpass . "</UserPassword>\r\n    <CallName>GetStockInfo</CallName>\r\n    <DetailLevel>2</DetailLevel>\r\n    <ErrorLanguage>DE</ErrorLanguage>\r\n  </AfterbuyGlobal>";
  172.  
  173.             break;
  174.  
  175.         case 'stockimport3':
  176.             $temp = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n  <Request>  \r\n  <AfterbuyGlobal>\r\n    <PartnerID>" . $PartnerID . "</PartnerID>\r\n    <PartnerPassword>" . $PartnerPass . "</PartnerPassword>\r\n    <UserID>" . $UserID . "</UserID>\r\n    <UserPassword>" . $Userpass . "</UserPassword>\r\n    <CallName>GetStockInfo</CallName>\r\n    <DetailLevel>4</DetailLevel>\r\n    <ErrorLanguage>DE</ErrorLanguage>\r\n  </AfterbuyGlobal>";
  177.  
  178.             break;
  179.  
  180.         case 'stockimport4':
  181.             $temp = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n  <Request>  \r\n  <AfterbuyGlobal>\r\n    <PartnerID>" . $PartnerID . "</PartnerID>\r\n    <PartnerPassword>" . $PartnerPass . "</PartnerPassword>\r\n    <UserID>" . $UserID . "</UserID>\r\n    <UserPassword>" . $Userpass . "</UserPassword>\r\n    <CallName>GetStockInfo</CallName>\r\n    <DetailLevel>8</DetailLevel>\r\n    <ErrorLanguage>DE</ErrorLanguage>\r\n  </AfterbuyGlobal>";
  182.  
  183.             break;
  184.  
  185.         case 'getdocuments':
  186.             $temp = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n  <Request>  \r\n  <AfterbuyGlobal>\r\n    <PartnerID>" . $PartnerID . "</PartnerID>\r\n    <PartnerPassword><![CDATA[" . $PartnerPass . "]]></PartnerPassword>\r\n    <UserID><![CDATA[" . $UserID . "]]></UserID>\r\n    <UserPassword><![CDATA[" . $Userpass . "]]></UserPassword>\r\n    <CallName>GetSoldItems</CallName>\r\n    <DetailLevel>28</DetailLevel>\r\n    <ErrorLanguage>DE</ErrorLanguage>\r\n  </AfterbuyGlobal>";
  187.  
  188.             break;
  189.  
  190.         case 'getshopitems':
  191.             $temp = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n    <DATA>\r\n\t  <AFTERBUY>\r\n\t\t<ACTION>GetShopItems</ACTION>\r\n\t\t<PARTNERID>" . $PartnerID . "</PARTNERID>\r\n\t\t<PARTNERPASS>" . $PartnerPass . "</PARTNERPASS>\r\n\t\t<USERID>" . $UserID . "</USERID>\r\n\t\t<USERPASS>" . $Userpass . "</USERPASS>\r\n\t  </AFTERBUY>";
  192.  
  193.             break;
  194.  
  195.         case 'getshopproducts':
  196.             $temp = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n  <Request>  \r\n  <AfterbuyGlobal>\r\n    <PartnerID>" . $PartnerID . "</PartnerID>\r\n    <PartnerPassword><![CDATA[" . $PartnerPass . "]]></PartnerPassword>\r\n    <UserID><![CDATA[" . $UserID . "]]></UserID>\r\n    <UserPassword><![CDATA[" . $Userpass . "]]></UserPassword>\r\n    <CallName>GetShopProducts</CallName>\r\n    <DetailLevel>0</DetailLevel>\r\n    <ErrorLanguage>DE</ErrorLanguage>\r\n  </AfterbuyGlobal>";
  197.  
  198.             break;
  199.  
  200.         case 'senditems':
  201.             $temp = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n\t<Request>\r\n  \t<AfterbuyGlobal>\r\n    <PartnerID>" . $PartnerID . "</PartnerID>\r\n    <PartnerPassword>" . $PartnerPass . "</PartnerPassword>\r\n    <UserID>" . $UserID . "</UserID>\r\n    <UserPassword>" . $Userpass . "</UserPassword>\r\n    <CallName>UpdateShopProducts</CallName>\r\n    <DetailLevel>0</DetailLevel>\r\n    <ErrorLanguage>DE</ErrorLanguage>\r\n  \t</AfterbuyGlobal>";
  202.  
  203.             break;
  204. .....................................................................
  205. ....................................
  206. .............
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top