johnburn

Decoded for: andr0id@waraxe.us

Sep 5th, 2011
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 66.70 KB | None | 0 0
  1. <?php
  2. require ('includes/application_top.php');
  3. $inpost_data_dir = DIR_FS_ADMIN . 'ext/inpost/data';
  4. $inpost_api_url = MODULE_SHIPPING_PACZKOMATY_API_URL;
  5. require_once ('ext/inpost/inpost.php');
  6. $pass_phrase = "awsxdrfvgyhnjikmloqw";
  7. $pass_phrase_hash = md5($pass_phrase);
  8. require (DIR_WS_CLASSES . 'currencies.php');
  9. $currencies = new currencies();
  10. $orders_statuses = array();
  11. $orders_status_array = array();
  12. $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
  13. while ($orders_status = tep_db_fetch_array($orders_status_query)) {
  14.     $orders_statuses[] = array('id' => $orders_status['orders_status_id'], 'text' => $orders_status['orders_status_name']);
  15.     $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
  16. }
  17. $enabled_shipping = array();
  18. $enabled_shipping[] = array('id' => '0', 'text' => 'Dowolna wysyłka');
  19. $module_directory = DIR_FS_CATALOG_MODULES . 'shipping/';
  20. $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
  21. if ($dir = @dir($module_directory)) {
  22.     while ($file = $dir->read()) {
  23.         if (!is_dir($module_directory . $file)) {
  24.             if (substr($file, strrpos($file, '.')) == $file_extension) {
  25.                 $directory_array[] = $file;
  26.             }
  27.         }
  28.     }
  29.     sort($directory_array);
  30.     $dir->close();
  31. }
  32. for ($i = 0, $n = sizeof($directory_array);$i < $n;$i++) {
  33.     $file = $directory_array[$i];
  34.     include (DIR_FS_CATALOG_LANGUAGES . $language . '/modules/shipping/' . $file);
  35.     include ($module_directory . $file);
  36.     $class = substr($file, 0, strrpos($file, '.'));
  37.     if (tep_class_exists($class)) {
  38.         $module = new $class;
  39.         if ($module->check() > 0) {
  40.             $enabled_shipping[] = array('id' => $class . '_' . $class, 'text' => $module->title);
  41.         }
  42.     }
  43. }
  44. $enabled_payment = array();
  45. $enabled_payment[] = array('id' => '0', 'text' => 'Dowolna płatność');
  46. $module_payment_directory = DIR_FS_CATALOG_MODULES . 'payment/';
  47. $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
  48. if ($dir_payment = @dir($module_payment_directory)) {
  49.     while ($file_payment = $dir_payment->read()) {
  50.         if (!is_dir($module_payment_directory . $file_payment)) {
  51.             if (substr($file_payment, strrpos($file_payment, '.')) == $file_extension) {
  52.                 $directory_payment_array[] = $file_payment;
  53.             }
  54.         }
  55.     }
  56.     sort($directory_payment_array);
  57.     $dir_payment->close();
  58. }
  59. for ($i = 0, $n = sizeof($directory_payment_array);$i < $n;$i++) {
  60.     $file_payment = $directory_payment_array[$i];
  61.     include (DIR_FS_CATALOG_LANGUAGES . $language . '/modules/payment/' . $file_payment);
  62.     include ($module_payment_directory . $file_payment);
  63.     $class_payment = substr($file_payment, 0, strrpos($file_payment, '.'));
  64.     if (tep_class_exists($class_payment)) {
  65.         $module_payment = new $class_payment;
  66.         if ($module_payment->check() > 0) {
  67.             $enabled_payment[] = array('id' => $module_payment->title, 'text' => $module_payment->title);
  68.         }
  69.     }
  70. }
  71. $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
  72. if (tep_not_null($action)) {
  73.     switch ($action) {
  74.         case 'update_order':
  75.             $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
  76.             $status = tep_db_prepare_input($HTTP_POST_VARS['status']);
  77.             $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
  78.             if ($czy_jest_sms) {
  79.                 $numer_sms = tep_db_prepare_input($HTTP_POST_VARS['numer_sms']);
  80.             }
  81.             $order_updated = false;
  82.             $check_status_query = tep_db_query("select customers_id, customers_name, customers_email_address, orders_status, date_purchased, customers_dummy_account from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
  83.             $check_status = tep_db_fetch_array($check_status_query);
  84.             if (($check_status['orders_status'] != $status) || $comments != '' || ($status == DOWNLOADS_ORDERS_STATUS_UPDATED_VALUE)) {
  85.                 tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
  86.                 $check_status_query2 = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
  87.                 $check_status2 = tep_db_fetch_array($check_status_query2);
  88.                 if ($check_status2['orders_status'] == DOWNLOADS_ORDERS_STATUS_UPDATED_VALUE) {
  89.                     tep_db_query("update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_maxdays = '" . tep_get_configuration_key_value('DOWNLOAD_MAX_DAYS') . "', download_count = '" . tep_get_configuration_key_value('DOWNLOAD_MAX_COUNT') . "' where orders_id = '" . (int)$oID . "'");
  90.                 }
  91.                 if (USE_POINTS_SYSTEM == 'true') {
  92.                     if ((isset($_POST['confirm_points']) && ($_POST['confirm_points'] == 'on')) || (isset($_POST['delete_points']) && ($_POST['delete_points'] == 'on'))) {
  93.                         $customer_query = tep_db_query("select customer_id, points_pending from " . TABLE_CUSTOMERS_POINTS_PENDING . " where points_status = 1 and points_type = 'SP' and orders_id = '" . (int)$oID . "' limit 1");
  94.                         $customer_points = tep_db_fetch_array($customer_query);
  95.                         if (tep_db_num_rows($customer_query)) {
  96.                             if (isset($_POST['delete_points']) && ($_POST['delete_points'] == 'on')) {
  97.                                 tep_db_query("delete from " . TABLE_CUSTOMERS_POINTS_PENDING . " where orders_id = '" . (int)$oID . "' and points_type = 'SP' limit 1");
  98.                                 $sql = "optimize table " . TABLE_CUSTOMERS_POINTS_PENDING . "";
  99.                             }
  100.                             if (isset($_POST['confirm_points']) && ($_POST['confirm_points'] == 'on')) {
  101.                                 tep_db_query("update " . TABLE_CUSTOMERS_POINTS_PENDING . " set points_status = 2 where orders_id = '" . (int)$oID . "' and points_type = 'SP' limit 1");
  102.                                 $sql = "optimize table " . TABLE_CUSTOMERS_POINTS_PENDING . "";
  103.                                 if (tep_not_null(POINTS_AUTO_EXPIRES)) {
  104.                                     $expire = date('Y-m-d', strtotime('+ ' . POINTS_AUTO_EXPIRES . ' month'));
  105.                                     tep_db_query("update " . TABLE_CUSTOMERS . " set customers_shopping_points = customers_shopping_points + '" . $customer_points['points_pending'] . "', customers_points_expires = '" . $expire . "' where customers_id = '" . (int)$customer_points['customer_id'] . "'");
  106.                                 } else {
  107.                                     tep_db_query("update " . TABLE_CUSTOMERS . " set customers_shopping_points = customers_shopping_points + '" . $customer_points['points_pending'] . "' where customers_id = '" . (int)$customer_points['customer_id'] . "'");
  108.                                 }
  109.                             }
  110.                         }
  111.                     }
  112.                 }
  113.                 $jezyk_tablica = explode('-', $_POST['jezyk']);
  114.                 $jezyk = $jezyk_tablica[0];
  115.                 $jezyk_id = $jezyk_tablica[1];
  116.                 $customer_notified = '0';
  117.                 if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {
  118.                     $notify_comments = '';
  119.                     if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {
  120.                         if ($comments != '') {
  121.                             eval('$ac = ' . strtoupper($jezyk) . '_EMAIL_TEXT_COMMENTS_UPDATE;');
  122.                             $notify_comments = sprintf($ac, $comments);
  123.                         }
  124.                     }
  125.                     $custom_name = $check_status['customers_name'];
  126.                     $custom_email = $check_status['customers_email_address'];
  127.                     $date_1 = tep_date_long($check_status['date_purchased']);
  128.                     $guest = $check_status['customers_dummy_account'];
  129.                     $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$jezyk_id . "' AND orders_status_id = '" . (int)$HTTP_POST_VARS['status'] . "'");
  130.                     $orders_status = tep_db_fetch_array($orders_status_query);
  131.                     $stats = $orders_status['orders_status_name'];
  132.                     mail_orders($custom_name, $custom_email, $oID, $date_1, $stats, $notify_comments, $jezyk, $guest);
  133.                     $customer_notified = '1';
  134.                 }
  135.                 if ($czy_jest_sms) {
  136.                     $customer_notified_sms = '0';
  137.                     if (isset($HTTP_POST_VARS['notify_sms']) && ($HTTP_POST_VARS['notify_sms'] == 'on')) {
  138.                         $orders_query_sms_raw = "select text from " . TABLE_ORDERS_TOTAL . " where class = 'ot_total' and orders_id = '" . (int)$oID . "'";
  139.                         $orders_query_sms = tep_db_query($orders_query_sms_raw);
  140.                         while ($totals = tep_db_fetch_array($orders_query_sms)) {
  141.                             $orders_id = $totals['text'];
  142.                         }
  143.                         $message_sms = SMS_MESSAGE;
  144.                         $message_sms = str_replace('[nazwa_sklepu]', STORE_NAME, $message_sms);
  145.                         $message_sms = str_replace('[order_id]', 'Nr zamowienia: ' . $oID, $message_sms);
  146.                         $message_sms = str_replace('[order_total]', $orders_id, $message_sms);
  147.                         $message_sms = str_replace('[orders_status]', $orders_status_array[$status], $message_sms);
  148.                         $message_sms = strip_tags($message_sms);
  149.                         $trans = array("Ä„" => "A", "Ć" => "C", "Ę" => "E", "Ł" => "L", "Ń" => "N", "Ó" => "O", "Åš" => "S", "Å»" => "Z", "Ź" => "Z", "Ä…" => "a", "ć" => "c", "Ä™" => "e", "Å‚" => "l", "Å„" => "n", "ó" => "o", "Å›" => "s", "ż" => "z", "ź" => "z");
  150.                         $message_sms = strtr($message_sms, $trans);
  151.                         $customer_notified_sms = '1';
  152.                         $username = SMS_USERNAME;
  153.                         $password = md5(SMS_PASSWORD);
  154.                         $to = $numer_sms;
  155.                         $message = urlencode($message_sms);
  156.                         $from = urlencode(SMS_FROM);
  157.                         if ($username && $password && $to && $message) {
  158.                             send_sms($username, $password, $from, $to, $message);
  159.                         }
  160.                     }
  161.                     tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, customer_notified_sms, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($customer_notified_sms) . "', '" . tep_db_input($comments) . "')");
  162.                 } else {
  163.                     tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')");
  164.                 }
  165.                 if (PROMO_POLECONY_STATUS == 'true') {
  166.                     if (tep_db_input($status) == PROMO_POLECONY_ORDER_STATUS_ID) {
  167.                         $check_polecony_query = tep_db_query("select customers_id, customers_polecony, customers_polecajacy_id from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$check_status['customers_id'] . "' and customers_polecony='1'");
  168.                         $check_polecony = tep_db_fetch_array($check_polecony_query);
  169.                         if ($check_polecony > 0) {
  170.                             require (DIR_WS_FUNCTIONS . 'coupons.php');
  171.                             $select_polecajacy_query = tep_db_query("select customers_id, customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$check_polecony['customers_polecajacy_id'] . "'");
  172.                             $select_polecajacy = tep_db_fetch_array($select_polecajacy_query);
  173.                             $default_tax_class_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_PRODUCT_TAX_CLASS'");
  174.                             $default_tax_class = tep_db_fetch_array($default_tax_class_query);
  175.                             $default_tax_rates_query = tep_db_query("select tax_rate from " . TABLE_TAX_RATES . " where tax_class_id = '" . $default_tax_class['configuration_value'] . "'");
  176.                             $default_tax_rates = tep_db_fetch_array($default_tax_rates_query);
  177.                             $coupons_id = kgt_create_random_coupon();
  178.                             $coupons_desc = 'Kupon promocji Polecony-Nagrodzony, osoba polecajÄ…ca : ' . $select_polecajacy['customers_firstname'] . ' ' . $select_polecajacy['customers_lastname'];
  179.                             $coupon_amount = PROMO_POLECONY_RABAT;
  180.                             $coupons_type = 'fixed';
  181.                             $coupons_max_use = '1';
  182.                             $coupons_min_order = PROMO_POLECONY_MIN_ORDER;
  183.                             $coupons_number_available = '1';
  184.                             $coupons_min_order_type = 'price';
  185.                             $coupons_date_start = kgt_parse_date(date("Y-m-d"), DATE_FORMAT_SHORT);
  186.                             $coupons_date_end = kgt_parse_date(date("Y-m-d", (strtotime(date("Y-m-d")) + (60 * 60 * 24 * PROMO_POLECONY_OKRES))), DATE_FORMAT_SHORT);
  187.                             tep_db_query($sql = "insert into " . TABLE_DISCOUNT_COUPONS . " values (
  188.         '" . $coupons_id . "',
  189.         '" . $coupons_desc . "',
  190.         '" . $coupon_amount . "',
  191.         '" . $coupons_type . "',
  192.         '" . $coupons_date_start . "',
  193.         '" . $coupons_date_end . "',
  194.          " . $coupons_max_use . ",
  195.          " . $coupons_min_order . ",
  196.          '" . $coupons_min_order_type . "',
  197.          " . $coupons_number_available . ") ");
  198.                             $polecajacy_name = MakeUTF($select_polecajacy['customers_firstname'] . ' ' . $select_polecajacy['customers_lastname']);
  199.                             $polecajacy_mail = $select_polecajacy['customers_email_address'];
  200.                             mail_orders_polecony($polecajacy_name, $polecajacy_mail, $coupons_id, $coupons_date_start, $coupons_date_end, $jezyk);
  201.                             tep_db_query("update " . TABLE_CUSTOMERS . " set customers_polecony = '2' where customers_id = '" . (int)$check_status['customers_id'] . "' and customers_polecony='1'");
  202.                         }
  203.                     }
  204.                 }
  205.                 $order_updated = true;
  206.             }
  207.             if ($order_updated == true) {
  208.                 $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
  209.             } else {
  210.                 $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
  211.             }
  212.             tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit'));
  213.         break;
  214.         case 'deleteconfirm':
  215.             $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
  216.             tep_remove_order($oID, $HTTP_POST_VARS['restock']);
  217.             tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action'))));
  218.         break;
  219.         case 'status_change':
  220.             if (isset($_POST['new_status_order_id'])) {
  221.                 $notify_comments = '';
  222.                 $customer_notified = '0';
  223.                 $oID = tep_db_prepare_input($_POST['new_status_order_id']);
  224.                 $status = tep_db_prepare_input($_POST['new_status']);
  225.                 $check_status_query = tep_db_query("select customers_id, customers_name, customers_email_address, orders_status, customers_telephone, date_purchased, customers_dummy_account from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
  226.                 $check_status = tep_db_fetch_array($check_status_query);
  227.                 tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
  228.                 if (isset($_POST['powiadom_email']) && ($_POST['powiadom_email'] == 'on')) {
  229.                     $customer_notified = '1';
  230.                     $custom_name = $_POST['customers_name'];
  231.                     $custom_email = $_POST['customers_email'];
  232.                     $date_1 = tep_date_long($_POST['date_purchased']);
  233.                     $guest = $check_status['customers_dummy_account'];
  234.                     $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '1' AND orders_status_id = '" . (int)$status . "'");
  235.                     $orders_status = tep_db_fetch_array($orders_status_query);
  236.                     $stats = $orders_status['orders_status_name'];
  237.                     $jezyk = 'POLISH';
  238.                     mail_orders($custom_name, $custom_email, $oID, $date_1, $stats, $notify_comments, $jezyk, $guest);
  239.                     $messageStack->add_session('Satus zamówienia zostaÅ‚ zmieniony', 'success');
  240.                 }
  241.                 tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '')");
  242.             }
  243.             tep_redirect(tep_href_link(FILENAME_DEFAULT));
  244.         break;
  245.     }
  246. }
  247. if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {
  248.     $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
  249.     $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
  250.     $order_exists = true;
  251.     if (!tep_db_num_rows($orders_query)) {
  252.         $order_exists = false;
  253.         $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
  254.     }
  255. }
  256. include (DIR_WS_CLASSES . 'order.php');
  257. print (agF1gTdKEBPd6CaJ($brapuc663));
  258. require (DIR_WS_INCLUDES . 'header.php');
  259. print (agF1gTdKEBPd6CaJ($apllkj664));
  260. include ('help/oscgold_klienci.php');
  261. $teksc = P_ZAMOW_START;
  262. $teksc = preg_replace("/\r\n|\n\r|\r|\n/", " ", $teksc);
  263. echo '
  264. <script type=\'text/javascript\' language=\'javascript\'>
  265. function close_div() {
  266.  document.getElementById(\'pop_window\').innerHTML = \'\';
  267.  document.getElementById(\'pop_overlay\').style.display = \'none\';
  268.  document.getElementById(\'blad\').style.display = \'none\';
  269.  document.getElementById(\'ekran\').style.display = \'none\';
  270. }
  271. function views_div(tekst) {
  272.  document.getElementById(\'blad\').style.display=\'block\';
  273.  document.getElementById(\'pop_overlay\').style.display = \'block\';
  274.  document.getElementById(\'ekran\').style.display = \'block\';
  275.  document.getElementById(\'ekran\').innerHTML = unescape("<div id=\'pop_window\' style=\'display:block;position:absolute; top:5%; left:5%; z-index:9999;\'>"+
  276.     "<table style=\'background-color:#ffffff;border:1px solid #000000;\' width=\'90%\' cellpadding=\'5\' cellspacing=\'0\'><tr><td style=\'background-color: #333344;border-bottom: 2px solid #000000;border-top: 1px solid #78A3F2;border-left: 1px solid #78A3F2;border-right: 1px solid #204095;\' align=\'center\'>"+
  277.     "<table width=\'98%\' border=\'0\' cellpadding=\'0\' cellspacing=\'0\'><tr><td width=\'50%\' align=\'left\' style=\'font: bold 13px tahoma,arial, sans-serif; color:#ffffff\'>Pomoc<%2Ftd><td width=\'50%\' align=\'right\'>"+
  278.     "<img src=\'popupbox/close.gif\' border=\'0\' style=\'cursor:pointer\' alt=\'Zamknij\' onclick=\'javascript:close_div();\'><%2Ftd><%2Ftr><%2Ftable><%2Ftd><%2Ftr><tr><td>"+
  279.     "<table width=\'98%\' border=\'0\' cellpadding=\'0\' cellspacing=\'10\'><tr><td>"+
  280.     "<p style=\'font: normal 13px tahoma,arial, sans-serif; color:#616161\'>"+tekst+
  281.     "<br><br><small>System pomocy stworzony i przeznaczony do sklepu internetowego <a href=\'http://www.oscgold.com\'>oscGold<%2Fa>. Autor J.Krysiak firma Kamelia-Net. Kopiowanie bez zgody autora zabronione.<%2Fsmall> "+
  282.     "<%2Fp><%2Ftd><%2Ftr><%2Ftable>"+
  283.     "<input type=\'button\' value=\'Zamknij\' onclick=\'javascript:close_div();\'>"+
  284.     "<%2Ftd><%2Ftr><%2Ftable><%2Fdiv>");
  285. }
  286. </script>';
  287. print (agF1gTdKEBPd6CaJ($ejahgl665));
  288. if (($action == 'edit') && ($order_exists == true)) {
  289.     $order = new order($oID);
  290.     print (agF1gTdKEBPd6CaJ($jprhqq666));
  291.     echo HEADING_TITLE;
  292.     print (agF1gTdKEBPd6CaJ($nabkah667));
  293.     echo tep_draw_separator('pixel_trans.gif', '80', '80');
  294.     print (agF1gTdKEBPd6CaJ($vsnesu668));
  295.     echo '<a href="' . tep_href_link(FILENAME_ORDERS_EDIT, 'oID=' . $HTTP_GET_VARS['oID']) . '">' . tep_image_button('button_edit.gif', 'Edytuj') . '</a> <a href="' . tep_href_link('../pdfinvoice.php', 'order_id=' . $HTTP_GET_VARS['oID'] . '&amp;passthruID=' . $pass_phrase_hash, 'SSL') . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a><br>';
  296.     if ($order->info['currency'] == 'PLN') {
  297.         echo '<a href="' . tep_href_link('invoice_edit.php', 'type=1&amp;oID=' . $HTTP_GET_VARS['oID'] . '&amp;passthruID=' . $pass_phrase_hash, 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'icons/faktura_o_pdf.gif', ICON_PDF_ORIGINAL_INVOICE) . '</a>&nbsp;<a href="' . tep_href_link('invoice_edit.php', 'type=2&amp;oID=' . $HTTP_GET_VARS['oID'] . '&amp;passthruID=' . $pass_phrase_hash, 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'icons/faktura_k_pdf.gif', ICON_PDF_COPY_INVOICE) . '</a>&nbsp;<a href="' . tep_href_link('invoice_edit.php', 'type=4&amp;oID=' . $HTTP_GET_VARS['oID'] . '&amp;passthruID=' . $pass_phrase_hash, 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'icons/faktura_d_pdf.gif', ICON_PDF_DUPLIKAT_INVOICE) . '</a>&nbsp;<a href="' . tep_href_link('invoice_edit.php', 'type=3&amp;oID=' . $HTTP_GET_VARS['oID'] . '&amp;passthruID=' . $pass_phrase_hash, 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'icons/faktura_f_pdf.gif', ICON_PDF_PROFORMA_INVOICE) . '</a>';
  298.     } else {
  299.         echo '';
  300.     };
  301.     print (agF1gTdKEBPd6CaJ($fnruui669));
  302.     echo $HTTP_GET_VARS['oID'] . ' (' . tep_datetime_short($order->info['date_purchased']) . ')' . (($order->customer['is_dummy_account']) ? ' <b>BEZ REJESTRACJI !!!</b>' : '') . '';
  303.     print (agF1gTdKEBPd6CaJ($pvipho670));
  304.     echo tep_draw_separator('pixel_trans.gif', '100%', '1');
  305.     print (agF1gTdKEBPd6CaJ($oirede671));
  306.     echo ENTRY_CUSTOMER;
  307.     print (agF1gTdKEBPd6CaJ($naculb672));
  308.     echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>');
  309.     print (agF1gTdKEBPd6CaJ($snnheb673));
  310.     echo ENTRY_SHIPPING_ADDRESS;
  311.     print (agF1gTdKEBPd6CaJ($rleoqg674));
  312.     echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>');
  313.     print (agF1gTdKEBPd6CaJ($rxwfmh675));
  314.     echo ENTRY_BILLING_ADDRESS;
  315.     print (agF1gTdKEBPd6CaJ($iomkvp676));
  316.     echo tep_address_format($order->billing['format_id'], $order->billing, 1, '', '<br>');
  317.     print (agF1gTdKEBPd6CaJ($fpvpwr677));
  318.     echo ENTRY_TELEPHONE_NUMBER;
  319.     print (agF1gTdKEBPd6CaJ($otjupa678));
  320.     echo $order->customer['telephone'];
  321.     print (agF1gTdKEBPd6CaJ($ggcvil679));
  322.     echo ENTRY_EMAIL_ADDRESS;
  323.     print (agF1gTdKEBPd6CaJ($rpuaex680));
  324.     echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>';
  325.     print (agF1gTdKEBPd6CaJ($tenvrw681));
  326.     echo ENTRY_PAYMENT_METHOD;
  327.     print (agF1gTdKEBPd6CaJ($wjcviw682));
  328.     echo $order->info['payment_method'];
  329.     print (agF1gTdKEBPd6CaJ($jwyyuu683));
  330.     if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) {;
  331.         print (agF1gTdKEBPd6CaJ($ljmpdk684));
  332.         echo tep_draw_separator('pixel_trans.gif', '1', '10');
  333.         print (agF1gTdKEBPd6CaJ($qyritt685));
  334.         echo ENTRY_CREDIT_CARD_TYPE;
  335.         print (agF1gTdKEBPd6CaJ($geihjg686));
  336.         echo $order->info['cc_type'];
  337.         print (agF1gTdKEBPd6CaJ($yabyhy687));
  338.         echo ENTRY_CREDIT_CARD_OWNER;
  339.         print (agF1gTdKEBPd6CaJ($jdvugo688));
  340.         echo $order->info['cc_owner'];
  341.         print (agF1gTdKEBPd6CaJ($ysnhse689));
  342.         echo ENTRY_CREDIT_CARD_NUMBER;
  343.         print (agF1gTdKEBPd6CaJ($fwrfqs690));
  344.         echo $order->info['cc_number'];
  345.         print (agF1gTdKEBPd6CaJ($iwelfi691));
  346.         echo ENTRY_CREDIT_CARD_EXPIRES;
  347.         print (agF1gTdKEBPd6CaJ($efceen692));
  348.         echo $order->info['cc_expires'];
  349.         print (agF1gTdKEBPd6CaJ($uewbbp693));
  350.     };
  351.     print (agF1gTdKEBPd6CaJ($lgfako694));
  352.     echo tep_draw_separator('pixel_trans.gif', '1', '10');
  353.     print (agF1gTdKEBPd6CaJ($nhpngw695));
  354.     echo TABLE_HEADING_PRODUCTS;
  355.     print (agF1gTdKEBPd6CaJ($rsuglt696));
  356.     echo TABLE_HEADING_PRODUCTS_MODEL;
  357.     print (agF1gTdKEBPd6CaJ($gpiwnc697));
  358.     echo TABLE_HEADING_TAX;
  359.     print (agF1gTdKEBPd6CaJ($cdvxwu698));
  360.     echo TABLE_HEADING_PRICE_EXCLUDING_TAX;
  361.     print (agF1gTdKEBPd6CaJ($gwltct699));
  362.     echo TABLE_HEADING_PRICE_INCLUDING_TAX;
  363.     print (agF1gTdKEBPd6CaJ($iwpkox700));
  364.     echo TABLE_HEADING_TOTAL_EXCLUDING_TAX;
  365.     print (agF1gTdKEBPd6CaJ($mdsffq701));
  366.     echo TABLE_HEADING_TOTAL_INCLUDING_TAX;
  367.     print (agF1gTdKEBPd6CaJ($imgsbr702));
  368.     for ($i = 0, $n = sizeof($order->products);$i < $n;$i++) {
  369.         $lp = $i + 1;
  370.         echo '<tr class="dataTableRow">' . "\n";
  371.         echo '<td class="dataTableContent" align="right">' . $lp . '</td>' . "\n";
  372.         if ($order->products[$i]['id'] > 0) {
  373.             echo '<td class="dataTableContent" valign="top"><a href="' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'product_info.php?products_id=' . $order->products[$i]['id'] . '" target="_blank">' . $order->products[$i]['name'] . '</a>';
  374.         } else {
  375.             echo '<td class="dataTableContent" valign="top">' . $order->products[$i]['name'];
  376.         }
  377.         if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
  378.             for ($j = 0, $k = sizeof($order->products[$i]['attributes']);$j < $k;$j++) {
  379.                 echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
  380.                 if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format(tep_add_tax($order->products[$i]['attributes'][$j]['price'], $order->products[$i]['tax'], true) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
  381.                 echo '</i></small></nobr>';
  382.             }
  383.         }
  384.         $attr_q = tep_db_query("select ota.*, pta.products_text_attributes_name from orders_text_attributes as ota, products_text_attributes as pta where ota.orders_id = " . $HTTP_GET_VARS['oID'] . " and ota.products_id = " . $order->products[$i]['orders_products_id'] . " and pta.products_text_attributes_id = ota.products_text_attributes_id");
  385.         while ($attr = tep_db_fetch_array($attr_q)) {
  386.             echo '<br><nobr><small>&nbsp;<i> - ' . $attr['products_text_attributes_name'] . ': ' . stripslashes($attr['products_text_attributes_text']);
  387.             echo '</i></small></nobr>';
  388.         }
  389.         echo '            </td>' . "\n";
  390.         if (PRZELICZ_ZAMOWIENIE_BRUTTO == 'true') {
  391.             $wartosc_brutto = $currencies->calculate_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty'], $order->info['currency'], $order->info['currency_value']);
  392.             $wartosc_vat = ($wartosc_brutto * $order->products[$i]['tax']) / (100 + $order->products[$i]['tax']);
  393.             $wartosc_netto = $wartosc_brutto - $wartosc_vat;
  394.         } else {
  395.             $wartosc_netto = $currencies->calculate_price($order->products[$i]['final_price'], '', $order->products[$i]['qty'], $order->info['currency'], $order->info['currency_value']);
  396.             $wartosc_vat = $wartosc_netto * ($order->products[$i]['tax'] / 100);
  397.             $wartosc_brutto = $wartosc_netto + $wartosc_vat;
  398.         }
  399.         if ($order->products[$i]['id'] > 0) {
  400.             echo '<td class="dataTableContent" valign="top"><a href="' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'product_info.php?products_id=' . $order->products[$i]['id'] . '" target="_blank">' . $order->products[$i]['model'] . '</a></td>' . "\n";
  401.         } else {
  402.             echo '<td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n";
  403.         }
  404.         echo '<td class="dataTableContent" align="right" valign="top">' . $order->products[$i]['qty'] . '</td>' . "\n";
  405.         echo '<td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" . '<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" . '<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true), true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" . '<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($wartosc_netto, true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" . '<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($wartosc_vat, true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" . '<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($wartosc_brutto, true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";
  406.         echo ' </tr>' . "\n";
  407.     };
  408.     print (agF1gTdKEBPd6CaJ($bgcjxu703));
  409.     for ($i = 0, $n = sizeof($order->totals);$i < $n;$i++) {
  410.         echo '<tr>' . "\n" . ' <td align="right" class="smallText" style="font-size:12px">' . $order->totals[$i]['title'] . '</td>' . "\n" . ' <td align="right" class="smallText" style="color:#ff0000;font-size:12px">' . $order->totals[$i]['text'] . '</td>' . "\n" . '</tr>' . "\n";
  411.     };
  412.     print (agF1gTdKEBPd6CaJ($maalau704));
  413.     echo tep_draw_separator('pixel_trans.gif', '1', '5');
  414.     print (agF1gTdKEBPd6CaJ($nubixr705));
  415.     echo tep_draw_separator('pixel_trans.gif', '100%', '1');
  416.     print (agF1gTdKEBPd6CaJ($xjumms706));
  417.     echo tep_draw_separator('pixel_trans.gif', '1', '5');
  418.     print (agF1gTdKEBPd6CaJ($ijvqwh707));
  419.     echo TABLE_HEADING_DATE_ADDED;
  420.     print (agF1gTdKEBPd6CaJ($qinpbq708));
  421.     echo TABLE_HEADING_CUSTOMER_NOTIFIED;
  422.     print (agF1gTdKEBPd6CaJ($xoifwv709));
  423.     if ($czy_jest_sms) {
  424.         echo '<td class="smallText" style="border:1px #b7b7b7 solid; border-right:0px" align="center"><b>' . TABLE_HEADING_CUSTOMER_NOTIFIED_SMS . '</b></td>';
  425.     };
  426.     print (agF1gTdKEBPd6CaJ($tarmuf710));
  427.     echo TABLE_HEADING_STATUS;
  428.     print (agF1gTdKEBPd6CaJ($rkoxfx711));
  429.     echo TABLE_HEADING_COMMENTS;
  430.     print (agF1gTdKEBPd6CaJ($clgkwu712));
  431.     if ($czy_jest_sms) {
  432.         $orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, customer_notified_sms, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
  433.     } else {
  434.         $orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
  435.     }
  436.     if (tep_db_num_rows($orders_history_query)) {
  437.         while ($orders_history = tep_db_fetch_array($orders_history_query)) {
  438.             echo '          <tr>' . "\n" . '            <td class="smallText" align="center" style="border:1px #b7b7b7 solid; border-right:0px; border-top:0px">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" . '            <td class="smallText" align="center" style="border:1px #b7b7b7 solid; border-right:0px; border-top:0px">';
  439.             if ($orders_history['customer_notified'] == '1') {
  440.                 echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
  441.             } else {
  442.                 echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
  443.             }
  444.             if ($czy_jest_sms) {
  445.                 echo '            <td class="smallText" align="center" style="border:1px #b7b7b7 solid; border-right:0px; border-top:0px">';
  446.                 if ($orders_history['customer_notified_sms'] == '1') {
  447.                     echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
  448.                 } else {
  449.                     echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
  450.                 }
  451.             }
  452.             echo '            <td class="smallText" style="border:1px #b7b7b7 solid; border-right:0px; border-top:0px">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" . '            <td class="smallText" style="border:1px #b7b7b7 solid; border-top:0px">' . nl2br(tep_db_output($orders_history['comments'])) . '&nbsp;</td>' . "\n" . '          </tr>' . "\n";
  453.         }
  454.     } else {
  455.         echo '          <tr>' . "\n" . '            <td class="smallText" colspan="5" style="border:1px #b7b7b7 solid; border-top:0px">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" . '          </tr>' . "\n";
  456.     };
  457.     print (agF1gTdKEBPd6CaJ($eknkki713));
  458.     echo tep_draw_separator('pixel_trans.gif', '1', '5');
  459.     print (agF1gTdKEBPd6CaJ($lvxkcv714));
  460.     echo tep_draw_separator('pixel_trans.gif', '100%', '1');
  461.     print (agF1gTdKEBPd6CaJ($khlntl715));
  462.     echo tep_draw_separator('pixel_trans.gif', '1', '5');
  463.     print (agF1gTdKEBPd6CaJ($rpdxvl716));
  464.     echo tep_draw_form('status', FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=update_order');
  465.     print (agF1gTdKEBPd6CaJ($lbwvcu717));
  466.     echo TABLE_HEADING_COMMENTS;
  467.     print (agF1gTdKEBPd6CaJ($coowhu718));
  468.     echo tep_draw_textarea_field('comments', 'soft', '100', '5', '', ' style="background:#ececec; border:1px solid #b7b7b7"');
  469.     print (agF1gTdKEBPd6CaJ($uejfxq719));
  470.     echo ENTRY_STATUS;
  471.     print (agF1gTdKEBPd6CaJ($kkqria720));
  472.     echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status'], 'style="width: 250px; padding: 2px;"');
  473.     print (agF1gTdKEBPd6CaJ($lyapbg721));
  474.     require (DIR_WS_MODULES . 'standard_order_comments.php');
  475.     print (agF1gTdKEBPd6CaJ($wdlrpr722));
  476.     echo ENTRY_NOTIFY_CUSTOMER;
  477.     print (agF1gTdKEBPd6CaJ($uqglmx723));
  478.     echo tep_draw_checkbox_field('notify', '', true);
  479.     print (agF1gTdKEBPd6CaJ($bokpip724));
  480.     if ($czy_jest_sms) {
  481.         $telephone = preg_replace('/\W/', '', $order->customer['telephone']);
  482.         if (!is_numeric($telephone)) {
  483.         }
  484.         $telefony = '';
  485.         $table_telefony = preg_split("/[,]/", TELEFONY_KOMORKOWE);
  486.         $size = sizeof($table_telefony);
  487.         for ($i = 0, $n = $size;$i < $n;$i++) {
  488.             $telefony.= $table_telefony[$i] . '[0-9]';
  489.             if ($i < $n - 1) {
  490.                 $telefony.= '|';
  491.             }
  492.         }
  493.         if (preg_match("/^0?(48)?.?(" . $telefony . ")[0-9]{6}$/i", $telephone)) {;
  494.             print (agF1gTdKEBPd6CaJ($koemcn725));
  495.             echo ENTRY_NOTIFY_CUSTOMER_SMS;
  496.             print (agF1gTdKEBPd6CaJ($gafyee726));
  497.             echo tep_draw_checkbox_field('notify_sms', '', false);
  498.             echo tep_draw_hidden_field('numer_sms', $telephone);
  499.             print (agF1gTdKEBPd6CaJ($nnrvuq727));
  500.         } else {
  501.         }
  502.     };
  503.     print (agF1gTdKEBPd6CaJ($toipmx728));
  504.     echo ENTRY_NOTIFY_COMMENTS;
  505.     print (agF1gTdKEBPd6CaJ($guwdii729));
  506.     echo tep_draw_checkbox_field('notify_comments', '', true);
  507.     print (agF1gTdKEBPd6CaJ($peqonv730));
  508.     if ((USE_POINTS_SYSTEM == 'true')) {
  509.         $p_status_query = tep_db_query("select points_status from " . TABLE_CUSTOMERS_POINTS_PENDING . " where points_status = 1 and points_type = 'SP' and orders_id = '" . (int)$oID . "' limit 1");
  510.         if (tep_db_num_rows($p_status_query)) {;
  511.             print (agF1gTdKEBPd6CaJ($qjgwoq731));
  512.             echo ENTRY_CONFIRMED_POINTS;
  513.             print (agF1gTdKEBPd6CaJ($nusyfa732));
  514.             echo ENTRY_DELETED_POINTS;
  515.             print (agF1gTdKEBPd6CaJ($tldgcn733));
  516.             echo '<strong>' . ENTRY_NOTIFY_POINTS . '</strong>&nbsp;' . ENTRY_QUE_POINTS . '<input type="checkbox" name="confirm_points" onClick="akcept()">' . '&nbsp;' . ENTRY_QUE_DEL_POINTS . '<input type="checkbox" name="delete_points" onClick="delet()">&nbsp;&nbsp;</td></tr>';
  517.         }
  518.     };
  519.     print (agF1gTdKEBPd6CaJ($xvcxlx734));
  520.     if (!isset($lng) || (isset($lng) && !is_object($lng))) {
  521.         include (DIR_WS_CLASSES . 'language.php');
  522.         $lng = new language;
  523.     }
  524.     reset($lng->catalog_languages);
  525.     while (list($key, $value) = each($lng->catalog_languages)) {
  526.         if ($value['directory'] == 'polish') {
  527.             $chec = 'checked="checked"';
  528.         } else {
  529.             $chec = '';
  530.         }
  531.         echo '<td class="main"><input type="radio" name="jezyk" value="' . $value['directory'] . '-' . $value['id'] . '" ' . $chec . '> ' . $value['name'] . '</td>';
  532.     };
  533.     print (agF1gTdKEBPd6CaJ($jcmrnd735));
  534.     echo tep_image_submit('button_update.gif', IMAGE_UPDATE);
  535.     print (agF1gTdKEBPd6CaJ($buungu736));
  536.     echo tep_hide_session_id();
  537.     print (agF1gTdKEBPd6CaJ($jfvixc737));
  538.     if (defined('MODULE_SHIPPING_PACZKOMATY_STATUS') && MODULE_SHIPPING_PACZKOMATY_STATUS == 'True') {
  539.         if (strstr($order->info['shipping_module'], 'paczkomaty')) {
  540.             $pobranie = '0';
  541.             if (strstr($order->info['payment_method'], 'Pobranie')) {
  542.                 $dane_query = tep_db_query("
  543.                SELECT ot.orders_id, ot.value
  544.                  FROM  " . TABLE_ORDERS_TOTAL . " ot
  545.                  WHERE ot.orders_id = '" . (int)$oID . "' AND ot.class = 'ot_total'");
  546.                 $dane = tep_db_fetch_array($dane_query);
  547.                 $pobranie = $dane['value'];
  548.                 $pobranie = strval(round($pobranie, 2));
  549.             };
  550.             print (agF1gTdKEBPd6CaJ($etbskp738));
  551.             echo tep_draw_separator('pixel_trans.gif', '100%', '10');
  552.             print (agF1gTdKEBPd6CaJ($vthvmy739));
  553.             if ($order->info['inpost_paczka_numer'] != '') {
  554.                 echo $order->info['inpost_paczka_numer'];
  555.             } else {;
  556.                 print (agF1gTdKEBPd6CaJ($tvpcrd740));
  557.                 echo tep_draw_form('inpost', 'inpost_paczka.php', 'order_id=' . tep_db_input($oID), 'post');
  558.                 print (agF1gTdKEBPd6CaJ($hpjhlj741));
  559.                 $gabaryty = array();
  560.                 $gabaryty = inpost_get_pricelist();
  561.                 $gabaryty_array[] = array('id' => 'A', 'text' => 'Typ A - koszt : ' . $gabaryty['A']);
  562.                 $gabaryty_array[] = array('id' => 'B', 'text' => 'Typ B - koszt : ' . $gabaryty['B']);
  563.                 $gabaryty_array[] = array('id' => 'C', 'text' => 'Typ C - koszt : ' . $gabaryty['C']);
  564.                 echo tep_draw_pull_down_menu('gabaryt', $gabaryty_array, '', 'style="width: 150px; padding: 2px;"');
  565.                 print (agF1gTdKEBPd6CaJ($pltjnk742));
  566.                 $pobranie24 = false;
  567.                 for ($i = 0, $n = sizeof($order->totals);$i < $n;$i++) {
  568.                     if (strstr($order->totals[$i]['title'], 'Paczkomaty') !== False) {
  569.                         $paczkomat = $order->totals[$i]['title'];
  570.                     }
  571.                 }
  572.                 if ($machines = inpost_get_machine_list('', 't')) {
  573.                     if (count($machines)) {
  574.                         foreach($machines as $machine) {
  575.                             $towns[] = $machine['name'];
  576.                             if (strstr($paczkomat, $machine['name']) !== False) {
  577.                                 $pobranie24 = true;
  578.                             }
  579.                         }
  580.                     }
  581.                 };
  582.                 print (agF1gTdKEBPd6CaJ($dbstgg743));
  583.                 if ($pobranie24) {
  584.                     echo tep_draw_input_field('pobranie', $pobranie, ' size="12" maxlength="32"');
  585.                 } else {
  586.                     echo '<i>wybrany paczkomat nie obsÅ‚uguje pobrania</i>';
  587.                 };
  588.                 print (agF1gTdKEBPd6CaJ($dyusyq744));
  589.                 $nadanie = array();
  590.                 $nadanie_array[] = array('id' => '0', 'text' => 'W oddziale');
  591.                 $nadanie_array[] = array('id' => '1', 'text' => 'W paczkomacie');
  592.                 echo tep_draw_pull_down_menu('nadanie', $nadanie_array, MODULE_SHIPPING_PACZKOMATY_NADANIE, 'style="width: 150px; padding: 2px;"');
  593.                 print (agF1gTdKEBPd6CaJ($ylkwvh745));
  594.             };
  595.             print (agF1gTdKEBPd6CaJ($uyniiu746));
  596.             if ($order->info['inpost_paczka_numer'] != '') {
  597.                 echo inpost_status_paczki($order->info['inpost_paczka_numer']);
  598.                 if (inpost_status_paczki($order->info['inpost_paczka_numer']) == 'Created') {
  599.                     echo '<br>';
  600.                     echo '<a href="' . tep_href_link('inpost_anuluj.php', 'order_id=' . tep_db_input($oID)) . '&numer_paczki=' . $order->info['inpost_paczka_numer'] . '">UsuÅ„ paczkÄ™</a>';
  601.                 }
  602.             } else {
  603.                 echo '---';
  604.             };
  605.             print (agF1gTdKEBPd6CaJ($wigdha747));
  606.             if ($order->info['inpost_paczka_numer'] != '') {
  607.                 $file = "ext/inpost/data/etykieta_" . $oID . "_" . $order->info['inpost_paczka_numer'] . ".pdf";
  608.                 if (is_file(DIR_FS_ADMIN . $file)) {
  609.                     echo '<a href="' . $file . '" target="_blank">' . tep_image(DIR_WS_ICONS . '1288643265_pdf.png', 'Pobierz plik') . '</a><br><br>';
  610.                     echo '<a href="' . tep_href_link('inpost_etykieta.php', 'order_id=' . tep_db_input($oID)) . '&numer_paczki=' . $order->info['inpost_paczka_numer'] . '">Wygeneruj ponownie</a>';
  611.                 } else {
  612.                     echo '<a href="' . tep_href_link('inpost_etykieta.php', 'order_id=' . tep_db_input($oID)) . '&numer_paczki=' . $order->info['inpost_paczka_numer'] . '">Wygeneruj</a>';
  613.                 }
  614.             } else {
  615.                 echo '---';
  616.             };
  617.             print (agF1gTdKEBPd6CaJ($pfifci748));
  618.             if ($order->info['inpost_paczka_numer'] != '' && inpost_status_paczki($order->info['inpost_paczka_numer']) != 'Created') {
  619.                 $file = "ext/inpost/data/potwierdzenie_" . $oID . "_" . $order->info['inpost_paczka_numer'] . ".pdf";
  620.                 if (is_file(DIR_FS_ADMIN . $file)) {
  621.                     echo '<a href="' . $file . '" target="_blank">' . tep_image(DIR_WS_ICONS . '1288643265_pdf.png', 'Pobierz plik') . '</a><br><br>';
  622.                 } else {
  623.                     echo '<a href="' . tep_href_link('inpost_potwierdzenie.php', 'order_id=' . tep_db_input($oID)) . '&numer_paczki=' . $order->info['inpost_paczka_numer'] . '">Wygeneruj</a>';
  624.                 }
  625.             } else {
  626.                 echo '---';
  627.             };
  628.             print (agF1gTdKEBPd6CaJ($shludg749));
  629.         }
  630.     };
  631.     print (agF1gTdKEBPd6CaJ($nhrhru750));
  632. } else {;
  633.     print (agF1gTdKEBPd6CaJ($iymtio751));
  634.     echo HEADING_TITLE;
  635.     print (agF1gTdKEBPd6CaJ($oovpaf752));
  636.     echo tep_draw_separator('pixel_trans.gif', 1, '80');
  637.     print (agF1gTdKEBPd6CaJ($nrrgtf753));
  638.     echo tep_draw_form('orders', FILENAME_ORDERS, '', 'get');
  639.     print (agF1gTdKEBPd6CaJ($sdxueq754));
  640.     echo HEADING_TITLE_SEARCH . '</td><td class="smallText" align="left">' . tep_draw_input_field('oID', '', 'size="12" style="width:250px;"') . tep_draw_hidden_field('action', 'edit');
  641.     print (agF1gTdKEBPd6CaJ($qmibaj755));
  642.     echo tep_hide_session_id();
  643.     print (agF1gTdKEBPd6CaJ($sukogw756));
  644.     echo tep_draw_form('customer_search', FILENAME_ORDERS, '', 'get');
  645.     print (agF1gTdKEBPd6CaJ($gjkbid757));
  646.     echo HEADING_TITLE_SEARCH_CUST . ':</td><td class="smallText" align="left">' . tep_draw_input_field('custName', '', 'size="12" style="width:250px;"') . tep_draw_hidden_field('action', 'cust_search');
  647.     print (agF1gTdKEBPd6CaJ($toybtp758));
  648.     echo tep_hide_session_id();
  649.     print (agF1gTdKEBPd6CaJ($owtbct759));
  650.     echo tep_draw_form('status', FILENAME_ORDERS, '', 'get');
  651.     print (agF1gTdKEBPd6CaJ($xojcml760));
  652.     echo HEADING_TITLE_STATUS . '</td><td class="smallText" align="left">' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();" style="width: 250px;"');
  653.     print (agF1gTdKEBPd6CaJ($qctxyo761));
  654.     echo tep_hide_session_id();
  655.     print (agF1gTdKEBPd6CaJ($ptltdb762));
  656.     echo tep_draw_form('wysylka', FILENAME_ORDERS, '', 'get');
  657.     print (agF1gTdKEBPd6CaJ($icvmpn763));
  658.     echo 'Rodzaj wysyÅ‚ki:</td><td class="smallText" align="left">' . tep_draw_pull_down_menu('wysylka', $enabled_shipping, '', 'onChange="this.form.submit();" style="width: 250px;"');
  659.     print (agF1gTdKEBPd6CaJ($qnhyip764));
  660.     echo tep_hide_session_id();
  661.     print (agF1gTdKEBPd6CaJ($ggmqye765));
  662.     echo tep_draw_form('platnosc', FILENAME_ORDERS, '', 'get');
  663.     print (agF1gTdKEBPd6CaJ($rjwyvb766));
  664.     echo 'Rodzaj pÅ‚atnoÅ›ci:</td><td class="smallText" align="left">' . tep_draw_pull_down_menu('platnosc', $enabled_payment, '', 'onChange="this.form.submit();" style="width: 250px;"');
  665.     print (agF1gTdKEBPd6CaJ($hcaqpc767));
  666.     echo tep_hide_session_id();
  667.     print (agF1gTdKEBPd6CaJ($jfrtes768));
  668.     echo $teksc;
  669.     print (agF1gTdKEBPd6CaJ($yywvin769));
  670.     $HEADING_FIRMA = '<a href="' . $_SERVER['PHP_SELF'] . '?sort=firma&amp;order=ascending">';
  671.     $HEADING_FIRMA.= '&nbsp;' . tep_image_button('ic_up.gif', ' Sortowanie : osobowosc prawna rosnaco') . '</a>';
  672.     $HEADING_FIRMA.= '&nbsp;Osobowość prawna';
  673.     $HEADING_FIRMA.= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=firma&amp;order=decending">';
  674.     $HEADING_FIRMA.= '&nbsp;' . tep_image_button('ic_down.gif', ' Sortowanie : osobowosc prawna malejaco') . '</a>';
  675.     $HEADING_ORDERS_ID = '<a href="' . $_SERVER['PHP_SELF'] . '?sort=id&amp;order=ascending">';
  676.     $HEADING_ORDERS_ID.= '&nbsp;' . tep_image_button('ic_up.gif', ' Sortowanie : ' . HEADING_TITLE_SEARCH . ' rosnaco') . '</a>';
  677.     $HEADING_ORDERS_ID.= '&nbsp;Nr';
  678.     $HEADING_ORDERS_ID.= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=id&amp;order=decending">';
  679.     $HEADING_ORDERS_ID.= '&nbsp;' . tep_image_button('ic_down.gif', ' Sortowanie : ' . HEADING_TITLE_SEARCH . ' malejaco') . '</a>';
  680.     $HEADING_CUSTOMERS = '<a href="' . $_SERVER['PHP_SELF'] . '?sort=customer&amp;order=ascending">';
  681.     $HEADING_CUSTOMERS.= '&nbsp;' . tep_image_button('ic_up.gif', ' Sortowanie : ' . TABLE_HEADING_CUSTOMERS . ' rosnaco') . '</a>';
  682.     $HEADING_CUSTOMERS.= '&nbsp;' . TABLE_HEADING_CUSTOMERS;
  683.     $HEADING_CUSTOMERS.= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=customer&amp;order=decending">';
  684.     $HEADING_CUSTOMERS.= '&nbsp;' . tep_image_button('ic_down.gif', ' Sortowanie : ' . TABLE_HEADING_CUSTOMERS . ' malejaco') . '</a>';
  685.     $HEADING_DATE_PURCHASED = '<a href="' . $_SERVER['PHP_SELF'] . '?sort=date&amp;order=ascending">';
  686.     $HEADING_DATE_PURCHASED.= '&nbsp;' . tep_image_button('ic_up.gif', ' Sortowanie : ' . TABLE_HEADING_DATE_PURCHASED . ' rosnaco') . '</a>';
  687.     $HEADING_DATE_PURCHASED.= '&nbsp;' . TABLE_HEADING_DATE_PURCHASED;
  688.     $HEADING_DATE_PURCHASED.= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=date&amp;order=decending">';
  689.     $HEADING_DATE_PURCHASED.= '&nbsp;' . tep_image_button('ic_down.gif', ' Sortowanie : ' . TABLE_HEADING_DATE_PURCHASED . ' malejaco') . '</a>';
  690.     $HEADING_STATUS = '<a href="' . $_SERVER['PHP_SELF'] . '?sort=status&amp;order=ascending">';
  691.     $HEADING_STATUS.= '&nbsp;' . tep_image_button('ic_up.gif', ' Sortowanie : ' . TABLE_HEADING_STATUS . ' rosnaco') . '</a>';
  692.     $HEADING_STATUS.= '&nbsp;' . TABLE_HEADING_STATUS;
  693.     $HEADING_STATUS.= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=status&amp;order=decending">';
  694.     $HEADING_STATUS.= '&nbsp;' . tep_image_button('ic_down.gif', ' Sortowanie : ' . TABLE_HEADING_STATUS . ' malejaco') . '</a>';
  695.     print (agF1gTdKEBPd6CaJ($rsxkay770));
  696.     echo $HEADING_FIRMA;
  697.     print (agF1gTdKEBPd6CaJ($kbwiub771));
  698.     echo $HEADING_CUSTOMERS;
  699.     print (agF1gTdKEBPd6CaJ($uqnewc772));
  700.     echo TABLE_HEADING_ORDER_TOTAL;
  701.     print (agF1gTdKEBPd6CaJ($siewbm773));
  702.     echo $HEADING_DATE_PURCHASED;
  703.     print (agF1gTdKEBPd6CaJ($qdpmod774));
  704.     echo $HEADING_ORDERS_ID;
  705.     print (agF1gTdKEBPd6CaJ($eywcct775));
  706.     echo $HEADING_STATUS;
  707.     print (agF1gTdKEBPd6CaJ($eejnyb776));
  708.     echo TABLE_HEADING_SHIPPING;
  709.     print (agF1gTdKEBPd6CaJ($njwxdd777));
  710.     echo TABLE_HEADING_PAYMENT;
  711.     print (agF1gTdKEBPd6CaJ($hsimue778));
  712.     echo TABLE_HEADING_ACTION;
  713.     print (agF1gTdKEBPd6CaJ($ltjlhb779));
  714.     $sortorder = ' order by ';
  715.     if ($_GET["sort"] == 'customer') {
  716.         if ($_GET["order"] == 'ascending') {
  717.             $sortorder.= 'o.customers_name  asc, ';
  718.         } else {
  719.             $sortorder.= 'o.customers_name desc, ';
  720.         }
  721.     } elseif ($_GET["sort"] == 'date') {
  722.         if ($_GET["order"] == 'ascending') {
  723.             $sortorder.= 'o.date_purchased  asc, ';
  724.         } else {
  725.             $sortorder.= 'o.date_purchased desc, ';
  726.         }
  727.     } elseif ($_GET["sort"] == 'status') {
  728.         if ($_GET["order"] == 'ascending') {
  729.             $sortorder.= 's.orders_status_name  asc, ';
  730.         } else {
  731.             $sortorder.= 's.orders_status_name desc, ';
  732.         }
  733.     } elseif ($_GET["sort"] == 'id') {
  734.         if ($_GET["order"] == 'ascending') {
  735.             $sortorder.= 'o.orders_id  asc, ';
  736.         } else {
  737.             $sortorder.= 'o.orders_id desc, ';
  738.         }
  739.     } elseif ($_GET["sort"] == 'firma') {
  740.         if ($_GET["order"] == 'ascending') {
  741.             $sortorder.= 'o.customers_company  asc, ';
  742.         } else {
  743.             $sortorder.= 'o.customers_company desc, ';
  744.         }
  745.     }
  746.     $sortorder.= 'o.orders_id DESC';
  747.     if (defined('MODULE_SHIPPING_PACZKOMATY_STATUS') && MODULE_SHIPPING_PACZKOMATY_STATUS == 'True') {
  748.         $inpost = ' o.inpost_paczka_numer,';
  749.     } else {
  750.         $inpost = '';
  751.     }
  752.     if (isset($HTTP_GET_VARS['custName'])) {
  753.         $custName = $HTTP_GET_VARS['custName'];
  754.         $orders_query_raw = "select o.orders_id, o.invoice_nr, o.invoice_proforma_nr, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.customers_company, " . $inpost . " s.orders_status_name,s.orders_status_id,  ot.text as order_total, o.customers_dummy_account from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where ( o.customers_name like '%" . $custName . "%' or  o.customers_company like '%" . $custName . "%' ) and ot.orders_id = o.orders_id and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total'" . $sortorder;
  755.     } else {
  756.         if (isset($HTTP_GET_VARS['cID'])) {
  757.             $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  758.             $orders_query_raw = "select o.orders_id, o.invoice_nr, o.invoice_proforma_nr, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.customers_company, " . $inpost . " s.orders_status_name,s.orders_status_id, ot.text as order_total, o.customers_dummy_account from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total'" . $sortorder;
  759.         } elseif (isset($HTTP_GET_VARS['status']) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0)) {
  760.             $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
  761.             $orders_query_raw = "select o.orders_id, o.invoice_nr, o.invoice_proforma_nr, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.customers_company, " . $inpost . " s.orders_status_name,s.orders_status_id,  ot.text as order_total, o.customers_dummy_account from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total'" . $sortorder;
  762.         } elseif (isset($HTTP_GET_VARS['wysylka']) && ($HTTP_GET_VARS['wysylka'] != '0')) {
  763.             $wysylka = tep_db_prepare_input($HTTP_GET_VARS['wysylka']);
  764.             $orders_query_raw = "select o.orders_id, o.invoice_nr, o.invoice_proforma_nr, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.customers_company, " . $inpost . " s.orders_status_name,s.orders_status_id,  ot.text as order_total, o.customers_dummy_account from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and o.shipping_module = '" . $wysylka . "' and ot.class = 'ot_total'" . $sortorder;
  765.         } elseif (isset($HTTP_GET_VARS['platnosc']) && ($HTTP_GET_VARS['platnosc'] != '0')) {
  766.             $platnosc = tep_db_prepare_input($HTTP_GET_VARS['platnosc']);
  767.             $orders_query_raw = "select o.orders_id, o.invoice_nr, o.invoice_proforma_nr, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.customers_company, " . $inpost . " s.orders_status_name,s.orders_status_id,  ot.text as order_total, o.customers_dummy_account from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and o.payment_method = '" . $platnosc . "' and ot.class = 'ot_total'" . $sortorder;
  768.         } else {
  769.             $orders_query_raw = "select o.orders_id, o.invoice_nr, o.invoice_proforma_nr, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.customers_company, " . $inpost . " s.orders_status_name,s.orders_status_id,  ot.text as order_total, o.customers_dummy_account from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total'" . $sortorder;
  770.         }
  771.     }
  772.     $orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS_ADMIN, $orders_query_raw, $orders_query_numrows);
  773.     $orders_query = tep_db_query($orders_query_raw);
  774.     while ($orders = tep_db_fetch_array($orders_query)) {
  775.         $shipping_query_raw = "select orders_id, title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$orders['orders_id'] . "' and class = 'ot_shipping'";
  776.         $shipping_query = tep_db_query($shipping_query_raw);
  777.         $shipping = tep_db_fetch_array($shipping_query);
  778.         $wysylka = $shipping['title'];
  779.         $nawias = strpos($wysylka, "(");
  780.         if ($nawias > 0) {
  781.             $wysylka = substr($wysylka, 0, $nawias);
  782.         }
  783.         $dwukropek = strpos($wysylka, ":");
  784.         if ($dwukropek > 0) {
  785.             $wysylka = substr($wysylka, 0, $dwukropek);
  786.         }
  787.         if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) {
  788.             $oInfo = new objectInfo($orders);
  789.         }
  790.         if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
  791.             echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this);tooltip.show(\'' . $orders['orders_id'] . '\');" onmouseout="rowOutEffect(this);tooltip.hide();" >' . "\n";
  792.             $link = 'onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&amp;action=edit') . '\'"';
  793.         } else {
  794.             echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this);tooltip.show(\'' . $orders['orders_id'] . '\');" onmouseout="rowOutEffect(this);tooltip.hide();">' . "\n";
  795.             $link = 'onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'"';
  796.         };
  797.         print (agF1gTdKEBPd6CaJ($wurwdv780));
  798.         echo $link;
  799.         print (agF1gTdKEBPd6CaJ($lkkeqh781));
  800.         echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;';
  801.         echo ($orders['customers_company'] != '' ? '<b>' . osc_trunc_string($orders['customers_company'], '40', '1') . '</b>' : 'osoba fizyczna');
  802.         print (agF1gTdKEBPd6CaJ($giyuvy782));
  803.         echo $link;
  804.         print (agF1gTdKEBPd6CaJ($ubgiuy783));
  805.         echo $orders['customers_name'];
  806.         if ($orders['customers_dummy_account']) echo '<font color="red"><b> !!</b></font>';
  807.         print (agF1gTdKEBPd6CaJ($qnnoec784));
  808.         echo $link;
  809.         print (agF1gTdKEBPd6CaJ($drexca785));
  810.         echo strip_tags($orders['order_total']);
  811.         print (agF1gTdKEBPd6CaJ($lryykp786));
  812.         echo $link;
  813.         print (agF1gTdKEBPd6CaJ($vdfeqj787));
  814.         echo tep_datetime_short($orders['date_purchased']);
  815.         print (agF1gTdKEBPd6CaJ($gecirh788));
  816.         echo $link;
  817.         print (agF1gTdKEBPd6CaJ($mylwfp789));
  818.         echo $orders['orders_id'];
  819.         print (agF1gTdKEBPd6CaJ($tjdodf790));
  820.         $ta = '<span>';
  821.         if ($orders['orders_status_id'] == '1') {
  822.             $ta = '<span style="color:#ff0000">';
  823.         }
  824.         if ($orders['orders_status_id'] == '2') {
  825.             $ta = '<span style="color:#14a101">';
  826.         }
  827.         if ($orders['orders_status_id'] == '3') {
  828.             $ta = '<span style="color:#0613b6">';
  829.         }
  830.         if ($orders['orders_status_id'] == '4') {
  831.             $ta = '<span style="color:#584016">';
  832.         };
  833.         print (agF1gTdKEBPd6CaJ($vdpgxt791));
  834.         echo $link;
  835.         print (agF1gTdKEBPd6CaJ($uakxqf792));
  836.         echo $ta . $orders['orders_status_name'] . '</span><br>nr faktury: ' . $orders['invoice_nr'] . ':' . (($orders['invoice_proforma_nr'] > 0) && ($orders['invoice_nr'] == 0) ? '<font color="red">' . $orders['invoice_proforma_nr'] . '</font>' : $orders['invoice_proforma_nr']);
  837.         print (agF1gTdKEBPd6CaJ($pobwes793));
  838.         echo $link;
  839.         print (agF1gTdKEBPd6CaJ($hflifm794));
  840.         echo $wysylka;
  841.         print (agF1gTdKEBPd6CaJ($hnposy795));
  842.         echo $link;
  843.         print (agF1gTdKEBPd6CaJ($hivndn796));
  844.         echo $orders['payment_method'];
  845.         print (agF1gTdKEBPd6CaJ($ujttmt797));
  846.         if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
  847.             echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', '');
  848.         } else {
  849.             echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>';
  850.         };
  851.         print (agF1gTdKEBPd6CaJ($ysrisl798));
  852.         $batch_order_numbers[] = $orders['orders_id'];
  853.     };
  854.     print (agF1gTdKEBPd6CaJ($dplbde799));
  855.     echo $orders_split->display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_ADMIN, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS);
  856.     print (agF1gTdKEBPd6CaJ($asxwvq800));
  857.     echo $orders_split->display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_ADMIN, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'oID', 'action')));
  858.     print (agF1gTdKEBPd6CaJ($fpcarx801));
  859.     $heading = array();
  860.     $contents = array();
  861.     switch ($action) {
  862.         case 'delete':
  863.             $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ORDER . '</b>');
  864.             $contents = array('form' => tep_draw_form('orders', FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&amp;action=deleteconfirm'));
  865.             $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br><br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
  866.             $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('restock') . ' ' . TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);
  867.             $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  868.         break;
  869.         default:
  870.             if (isset($oInfo) && is_object($oInfo)) {
  871.                 $heading[] = array('text' => '<b>[' . $oInfo->orders_id . ']&nbsp;&nbsp;' . tep_datetime_short($oInfo->date_purchased) . '</b>');
  872.                 if ($oInfo->currency == 'PLN') {
  873.                     $ikonki = '<a href="' . tep_href_link('invoice_edit.php', 'type=1&amp;oID=' . $oInfo->orders_id . '&amp;passthruID=' . $pass_phrase_hash, 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'icons/faktura_o_pdf.gif', ICON_PDF_ORIGINAL_INVOICE) . '</a>&nbsp;<a href="' . tep_href_link('invoice_edit.php', 'type=2&amp;oID=' . $oInfo->orders_id . '&amp;passthruID=' . $pass_phrase_hash, 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'icons/faktura_k_pdf.gif', ICON_PDF_COPY_INVOICE) . '</a>&nbsp;<a href="' . tep_href_link('invoice_edit.php', 'type=4&amp;oID=' . $oInfo->orders_id . '&amp;passthruID=' . $pass_phrase_hash, 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'icons/faktura_d_pdf.gif', ICON_PDF_DUPLIKAT_INVOICE) . '</a>&nbsp;<a href="' . tep_href_link('invoice_edit.php', 'type=3&amp;oID=' . $oInfo->orders_id . '&amp;passthruID=' . $pass_phrase_hash, 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'icons/faktura_f_pdf.gif', ICON_PDF_PROFORMA_INVOICE) . '</a>';
  874.                 } else {
  875.                     $ikonki = '';
  876.                 }
  877.                 if (PHP_VERSION > '5.2') {
  878.                     $ikonki.= '<a href="' . tep_href_link('xlsinvoice.php', 'order_id=' . $oInfo->orders_id . '&amp;passthruID=' . $pass_phrase_hash, 'SSL') . '" TARGET="_blank">' . tep_image(DIR_WS_IMAGES . 'icons/excel.gif', 'Zamówienie Excel') . '</a>';
  879.                 }
  880.                 $contents[] = array('align' => 'center', 'text' => $ikonki);
  881.                 $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '">' . tep_image_button('button_details.gif', IMAGE_DETAILS) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
  882.                 $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link('../pdfinvoice.php', 'order_id=' . $oInfo->orders_id . '&amp;passthruID=' . $pass_phrase_hash, 'SSL') . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a>&nbsp;<a href="' . tep_href_link(FILENAME_ORDERS_EDIT, 'oID=' . $oInfo->orders_id) . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
  883.                 $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CREATE_ORDER) . '">' . tep_image_button('button_create_order.gif', 'Nowe zamówienie') . '</a>');
  884.                 $contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));
  885.                 if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));
  886.                 $contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' ' . $oInfo->payment_method);
  887.             }
  888.             break;
  889.         }
  890.         if ((tep_not_null($heading)) && (tep_not_null($contents))) {
  891.             echo '            <td width="25%" valign="top">' . "\n";
  892.             $box = new box;
  893.             echo $box->infoBox($heading, $contents);
  894.             echo '            </td>' . "\n";
  895.         };
  896.         print (agF1gTdKEBPd6CaJ($lsweyd802));
  897. };
  898. print (agF1gTdKEBPd6CaJ($kiarmj803));
  899. echo base64_decode(COOKIE_TMP);
  900. print (agF1gTdKEBPd6CaJ($ctmulk804));
  901. echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5');
  902. print (agF1gTdKEBPd6CaJ($ploaku805));
  903. echo tep_draw_separator('pixel_trans.gif', '1', '1');
  904. print (agF1gTdKEBPd6CaJ($remrpr806));
  905. $teks_name = strpos(base64_decode(COOKIE_TMP), 'Krysiak');
  906. $teks_firma = strpos(base64_decode(COOKIE_TMP), 'oscGold');
  907. if ($teks_name === False || $teks_firma === False) {
  908.     tep_session_unregister('login_id');
  909. }
  910. echo '<script type="text/javascript" language="javascript"> function num_to_str(formi) { var str_out = ""; var num_out = formi;  for(i = 0; i < num_out.length; i += 2) { num_in = parseInt(num_out.substr(i,[2])) + 23; num_in = unescape(\'%\' + num_in.toString(16)); str_out += num_in; } return unescape(str_out); }; ';
  911. echo 'if (document.getElementById(\'bottom\')) { var ciag = document.getElementById(\'bottom\').innerHTML; if (ciag.indexOf(num_to_str("52919892827484")) == -1) { location.href=\'logoff.php\' } } else if (!document.getElementById(\'cook\') || !document.getElementById(\'bots\')) { location.href=\'logoff.php\' } else { location.href=\'logoff.php\'  }</script><div id="seso"></div>';
  912. require (DIR_WS_INCLUDES . 'application_bottom.php');
  913. print (agF1gTdKEBPd6CaJ($nxpemn807));
  914. function inpost_status_paczki($packcode) {
  915.     $status = inpost_get_pack_status($packcode);
  916.     if (is_array($status)) {
  917.         return $status['error']['message'];
  918.     }
  919.     return $status;
  920. }
  921. function invoiceNumberFormatAdmin($amount, $dig = 2, $dec = '.', $sep = '') {
  922.     $value = number_format((double)$amount, $dig, $dec, $sep);
  923.     if ($value == '0.00') {
  924.         return '';
  925.     } else {
  926.         return $value;
  927.     }
  928. };
  929. ?>
Add Comment
Please, Sign In to add comment