$smarty->assign('address_label_shipping', xtc_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br />'));
$smarty->assign('address_label_payment', xtc_address_format($order->billing['format_id'], $order->billing, 1, '', '<br />'));
$smarty->assign('csID', $order->customer['csID']);
// get products data
include_once DIR_FS_CATALOG . DIR_WS_CLASSES . 'xtcPrice.php';
$xtPrice = new xtcPrice($order->info['currency'], $order->info['status']);
$order_total = $order->getTotalData($order->info['order_id']);
$order_data = $order->getOrderData($order->info['order_id']);
$smarty->assign('order_data', $order_data);
$smarty->assign('order_total', $order_total['data']);
// assign language to template for caching
$languages_query = xtc_db_query("select code, language_charset from " . TABLE_LANGUAGES . " WHERE directory ='" . $order->info['language'] . "'");
$langcode = xtc_db_fetch_array($languages_query);
$smarty->assign('langcode', $langcode['code']);
$smarty->assign('charset', $langcode['language_charset']);
$smarty->assign('language', $order->info['language']);
$smarty->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/');
$smarty->assign('oID', $order->info['order_id']);
if ($order->info['payment_method'] != '' && $order->info['payment_method'] != 'no_payment') {
    include DIR_FS_CATALOG . 'lang/' . $_SESSION['language'] . '/modules/payment/' . $order->info['payment_method'] . '.php';
    $payment_method = constant(strtoupper('MODULE_PAYMENT_' . $order->info['payment_method'] . '_TEXT_TITLE'));
    $smarty->assign('PAYMENT_METHOD', $payment_method);
}
$smarty->assign('COMMENTS', $order->info['comments']);
$smarty->assign('DATE', xtc_date_long($order->info['date_purchased']));
// dont allow cache
$smarty->caching = false;
$smarty->template_dir = DIR_FS_CATALOG . 'templates';
$smarty->compile_dir = DIR_FS_CATALOG . 'templates_c';
$smarty->config_dir = DIR_FS_CATALOG . 'lang';
$smarty->display(CURRENT_TEMPLATE . '/admin/print_packingslip.html');
$module_content = array();
if (($orders_total = xtc_count_customer_orders()) > 0) {
    $history_query_raw = "select o.orders_id, \n                                 o.date_purchased,\n                                 o.delivery_name,\n                                 o.billing_name,\n                                 ot.text as order_total,\n                                 s.orders_status_name\n                        from " . TABLE_ORDERS . " o,\n                             " . TABLE_ORDERS_TOTAL . " ot,\n                             " . TABLE_ORDERS_STATUS . " s \n                        where o.customers_id = " . (int) $_SESSION['customer_id'] . "\n                        and o.orders_id = ot.orders_id\n                        and ot.class = 'ot_total'\n                        and o.orders_status = s.orders_status_id\n                        and s.language_id = " . (int) $_SESSION['languages_id'] . "\n                        order by orders_id DESC";
    $history_split = new splitPageResults($history_query_raw, isset($_GET['page']) ? $_GET['page'] : 0, MAX_DISPLAY_ORDER_HISTORY);
    $history_query = xtc_db_query($history_split->sql_query);
    while ($history = xtc_db_fetch_array($history_query)) {
        $products_query = xtc_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . $history['orders_id'] . "'");
        $products = xtc_db_fetch_array($products_query);
        if (xtc_not_null($history['delivery_name'])) {
            $order_type = TEXT_ORDER_SHIPPED_TO;
            $order_name = $history['delivery_name'];
        } else {
            $order_type = TEXT_ORDER_BILLED_TO;
            $order_name = $history['billing_name'];
        }
        $module_content[] = array('ORDER_ID' => $history['orders_id'], 'ORDER_STATUS' => $history['orders_status_name'], 'ORDER_DATE' => xtc_date_long($history['date_purchased']), 'ORDER_PRODUCTS' => $products['count'], 'ORDER_TOTAL' => strip_tags($history['order_total']), 'ORDER_BUTTON' => '<a href="' . xtc_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'page=' . (empty($_GET['page']) ? "1" : (int) $_GET['page']) . '&order_id=' . $history['orders_id'], 'SSL') . '">' . xtc_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>');
        require_once DIR_FS_INC . 'xtc_get_tracking_link.php';
        $module_content[count($module_content) - 1]['TRACKING_LINKS'] = xtc_get_tracking_link($history['orders_id']);
    }
}
if ($orders_total > 0) {
    $smarty->assign('SPLIT_BAR', '
	          <div class="smallText" style="clear:both;"><div style="float:left;">' . $history_split->display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS) . '</div>
              <div align="right">' . TEXT_RESULT_PAGE . ' ' . $history_split->display_links(MAX_DISPLAY_PAGE_LINKS, xtc_get_all_get_params(array('page', 'info', 'x', 'y'))) . '</div>
              </div>');
}
$smarty->assign('order_content', $module_content);
$smarty->assign('language', $_SESSION['language']);
$smarty->assign('BUTTON_BACK', '<a href="' . xtc_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . xtc_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>');
$smarty->caching = 0;
$main_content = $smarty->fetch(CURRENT_TEMPLATE . '/module/account_history.html');
     }
     $messageStack->add_session(SUCCESS_BILLING, 'success');
     xtc_redirect(xtc_href_link(FILENAME_AFFILIATE_PAYMENT, xtc_get_all_get_params(array('action')) . 'action=edit'));
     break;
 case 'update_payment':
     $pID = xtc_db_prepare_input($_GET['pID']);
     $status = xtc_db_prepare_input($_POST['status']);
     $payment_updated = false;
     $check_status_query = xtc_db_query("select af.affiliate_email_address, ap.affiliate_lastname, ap.affiliate_firstname, ap.affiliate_payment_status, ap.affiliate_payment_date, ap.affiliate_payment_date from " . TABLE_AFFILIATE_PAYMENT . " ap, " . TABLE_AFFILIATE . " af where affiliate_payment_id = '" . xtc_db_input($pID) . "' and af.affiliate_id = ap.affiliate_id ");
     $check_status = xtc_db_fetch_array($check_status_query);
     if ($check_status['affiliate_payment_status'] != $status) {
         xtc_db_query("update " . TABLE_AFFILIATE_PAYMENT . " set affiliate_payment_status = '" . xtc_db_input($status) . "', affiliate_last_modified = now() where affiliate_payment_id = '" . xtc_db_input($pID) . "'");
         $affiliate_notified = '0';
         // Notify Affiliate
         if ($_POST['notify'] == 'on') {
             $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_AFFILIATE_PAYMENT_NUMBER . ' ' . $pID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . xtc_catalog_href_link(FILENAME_CATALOG_AFFILIATE_PAYMENT_INFO, 'payment_id=' . $pID, 'SSL') . "\n" . EMAIL_TEXT_PAYMENT_BILLED . ' ' . xtc_date_long($check_status['affiliate_payment_date']) . "\n\n" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $payments_status_array[$status]);
             xtc_php_mail(AFFILIATE_EMAIL_ADDRESS, EMAIL_SUPPORT_NAME, $check_status['affiliate_email_address'], $check_status['affiliate_firstname'] . ' ' . $check_status['affiliate_lastname'], '', EMAIL_SUPPORT_REPLY_ADDRESS, EMAIL_SUPPORT_REPLY_ADDRESS_NAME, '', '', EMAIL_TEXT_SUBJECT, nl2br($email), $email);
             $affiliate_notified = '1';
         }
         xtc_db_query("insert into " . TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY . " (affiliate_payment_id, affiliate_new_value, affiliate_old_value, affiliate_date_added, affiliate_notified) values ('" . xtc_db_input($pID) . "', '" . xtc_db_input($status) . "', '" . $check_status['affiliate_payment_status'] . "', now(), '" . $affiliate_notified . "')");
         $order_updated = true;
     }
     if ($order_updated) {
         $messageStack->add_session(SUCCESS_PAYMENT_UPDATED, 'success');
     }
     xtc_redirect(xtc_href_link(FILENAME_AFFILIATE_PAYMENT, xtc_get_all_get_params(array('action')) . 'action=edit'));
     break;
 case 'deleteconfirm':
     $pID = xtc_db_prepare_input($_GET['pID']);
     xtc_db_query("delete from " . TABLE_AFFILIATE_PAYMENT . " where affiliate_payment_id = '" . xtc_db_input($pID) . "'");
     xtc_db_query("delete from " . TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY . " where affiliate_payment_id = '" . xtc_db_input($pID) . "'");
Example #4
0
         } else {
             $notify_comments = '';
         }
         // assign language to template for caching
         $smarty->assign('language', $_SESSION['language']);
         $smarty->caching = false;
         // set dirs manual
         $smarty->template_dir = DIR_FS_CATALOG . 'templates';
         $smarty->compile_dir = DIR_FS_CATALOG . 'templates_c';
         $smarty->config_dir = DIR_FS_CATALOG . 'lang';
         $smarty->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/');
         $smarty->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/');
         $smarty->assign('NAME', $check_status['customers_name']);
         $smarty->assign('ORDER_NR', $oID);
         $smarty->assign('ORDER_LINK', xtc_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL'));
         $smarty->assign('ORDER_DATE', xtc_date_long($check_status['date_purchased']));
         $smarty->assign('NOTIFY_COMMENTS', nl2br($notify_comments));
         // Tomcraft - 2009-10-10 - Fixed wordwrap in notify_comments
         $smarty->assign('ORDER_STATUS', $orders_status_array[$status]);
         $html_mail = $smarty->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $order->info['language'] . '/change_order_mail.html');
         $txt_mail = $smarty->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $order->info['language'] . '/change_order_mail.txt');
         xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $check_status['customers_email_address'], $check_status['customers_name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', EMAIL_BILLING_SUBJECT, $html_mail, $txt_mail);
         $customer_notified = '1';
     }
     xtc_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . xtc_db_input($oID) . "', '" . xtc_db_input($status) . "', now(), '" . $customer_notified . "', '" . xtc_db_input($comments) . "')");
     $order_updated = true;
 }
 if ($order_updated) {
     $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
 } else {
     $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
        ?>
                                <tr class="dataTableRow"onMouseOver="this.className='dataTableRowOver';this.style.cursor='pointer'" onMouseOut="this.className='dataTableRow'">
                                  <?php 
        switch ($srView) {
            case '3':
                ?>
                                      <td class="dataTableContent" align="right"><?php 
                echo xtc_date_long(date("Y-m-d\\ H:i:s", $sr->showDate)) . " - " . xtc_date_short(date("Y-m-d\\ H:i:s", $sr->showDateEnd));
                ?>
</td>
                                      <?php 
                break;
            case '4':
                ?>
                                      <td class="dataTableContent" align="right"><?php 
                echo xtc_date_long(date("Y-m-d\\ H:i:s", $sr->showDate));
                ?>
</td>
                                      <?php 
                break;
            default:
                ?>
                                      <td class="dataTableContent" align="right"><?php 
                echo xtc_date_short(date("Y-m-d\\ H:i:s", $sr->showDate)) . " - " . xtc_date_short(date("Y-m-d\\ H:i:s", $sr->showDateEnd));
                ?>
</td>
                                      <?php 
        }
        ?>
                                  <td class="dataTableContent" align="right"><?php 
        echo isset($info[0]['order']) ? $info[0]['order'] : '&nbsp;';
        if ($discount != '0.00') {
            $info_smarty->assign('PRODUCTS_DISCOUNT', $discount . '%');
        }
    }
    //canonical_link -> set canonical tag in /template/.../module/print_product_info.html
    $canonical_link = xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product->data['products_id'], $request_type, false);
    $info_smarty->assign('CanonicalLink', $canonical_link);
    //include modules
    if ($_SESSION['customers_status']['customers_status_graduated_prices'] == 1) {
        include DIR_WS_MODULES . FILENAME_GRADUATED_PRICE;
    }
    include DIR_WS_MODULES . FILENAME_PRODUCTS_MEDIA;
    // date available/added
    if ($product->data['products_date_available'] > date('Y-m-d H:i:s')) {
        $info_smarty->assign('PRODUCTS_DATE_AVIABLE', sprintf(TEXT_DATE_AVAILABLE, xtc_date_long($product->data['products_date_available'])));
        $info_smarty->assign('PRODUCTS_DATE_AVAILABLE', sprintf(TEXT_DATE_AVAILABLE, xtc_date_long($product->data['products_date_available'])));
    } elseif ($product->data['products_date_added'] != '0000-00-00 00:00:00') {
        $info_smarty->assign('PRODUCTS_ADDED', sprintf(TEXT_DATE_ADDED, xtc_date_long($product->data['products_date_added'])));
    }
    $info_smarty->assign('language', $_SESSION['language']);
    // set cache ID
    if (!CacheCheck()) {
        $info_smarty->caching = 0;
    } else {
        $info_smarty->caching = 1;
        $info_smarty->cache_lifetime = CACHE_LIFETIME;
        $info_smarty->cache_modified_check = CACHE_CHECK;
    }
    $cache_id = $_SESSION['language'] . '_' . $product->data['products_id'];
    $info_smarty->display(CURRENT_TEMPLATE . '/module/print_product_info.html', $cache_id);
}
function shopDateLong($raw_date)
{
    return xtc_date_long($raw_date);
}
 $smarty->assign('REVOCATION_TXT', $revocation);
 //replace br, strip_tags, html_entity_decode are allready execute in xtc_php_mail  function
 // EOF - Tomcraft - 2011-06-17 - Added revocation to email
 ## PayOne
 if (strpos($order->info['payment_method'], 'payone') !== false) {
     require_once DIR_FS_EXTERNAL . 'payone/modules/send_order.php';
 }
 ## PayPal
 require_once DIR_FS_EXTERNAL . 'paypal/modules/send_order.php';
 $html_mail = $smarty->fetch('db:order_mail.html');
 $txt_mail = $smarty->fetch('db:order_mail.txt');
 //email attachments
 $email_attachments = defined('EMAIL_BILLING_ATTACHMENTS') ? EMAIL_BILLING_ATTACHMENTS : '';
 // create subject
 $order_subject = str_replace('{$nr}', $insert_id, EMAIL_BILLING_SUBJECT_ORDER);
 $order_subject = str_replace('{$date}', xtc_date_long($order->info['date_purchased']), $order_subject);
 // Tomcraft - 2011-12-28 - Use date_puchased instead of current date in E-Mail subject
 $order_subject = str_replace('{$lastname}', $order->customer['lastname'], $order_subject);
 $order_subject = str_replace('{$firstname}', $order->customer['firstname'], $order_subject);
 // send mail to admin
 xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, EMAIL_BILLING_ADDRESS, STORE_NAME, EMAIL_BILLING_FORWARDING_STRING, $order->customer['email_address'], $order->customer['firstname'] . ' ' . $order->customer['lastname'], $email_attachments, '', $order_subject, $html_mail, $txt_mail);
 // send mail to customer
 if (SEND_EMAILS == 'true' || $send_by_admin) {
     xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $order->customer['email_address'], $order->customer['firstname'] . ' ' . $order->customer['lastname'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, $email_attachments, '', $order_subject, $html_mail, $txt_mail);
     if (isset($sepa_html_mail)) {
         xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $banktransfer_owner_email, '', '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', EMAIL_BILLING_SUBJECT, $sepa_html_mail, $sepa_txt_mail);
     }
 }
 if (AFTERBUY_ACTIVATED == 'true') {
     require_once DIR_WS_CLASSES . 'afterbuy.php';
     $aBUY = new xtc_afterbuy_functions($insert_id);
function OrderUpdate()
{
    global $_POST, $LangID;
    $schema = '<?xml version="1.0" encoding="' . CHARSET . '"?>' . "\n" . "\n";
    if (isset($_POST['order_id']) && isset($_POST['status'])) {
        // Per Post übergebene Variablen
        $oID = $_POST['order_id'];
        $status = $_POST['status'];
        $comments = xtc_db_prepare_input($_POST['comments']);
        //Status überprüfen
        $check_status_query = xtc_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . xtc_db_input($oID) . "'");
        if ($check_status = xtc_db_fetch_array($check_status_query)) {
            if ($check_status['orders_status'] != $status || $comments != '') {
                xtc_db_query("update " . TABLE_ORDERS . " set orders_status = '" . xtc_db_input($status) . "', last_modified = now() where orders_id = '" . xtc_db_input($oID) . "'");
                $customer_notified = '0';
                if ($_POST['notify'] == 'on') {
                    // Falls eine Sprach ID zur Order existiert die Emailbestätigung in dieser Sprache ausführen
                    if (isset($check_status['orders_language_id']) && $check_status['orders_language_id'] > 0) {
                        $orders_status_query = xtc_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . $check_status['orders_language_id'] . "'");
                        if (xtc_db_num_rows($orders_status_query) == 0) {
                            $orders_status_query = xtc_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . $languages_id . "'");
                        }
                    } else {
                        $orders_status_query = xtc_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . $languages_id . "'");
                    }
                    $orders_statuses = array();
                    $orders_status_array = array();
                    while ($orders_status = xtc_db_fetch_array($orders_status_query)) {
                        $orders_statuses[] = array('id' => $orders_status['orders_status_id'], 'text' => $orders_status['orders_status_name']);
                        $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
                    }
                    // status query
                    $orders_status_query = xtc_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . $LangID . "' and orders_status_id='" . $status . "'");
                    $o_status = xtc_db_fetch_array($orders_status_query);
                    $o_status = $o_status['orders_status_name'];
                    //ok lets generate the html/txt mail from Template
                    if ($_POST['notify_comments'] == 'on') {
                        $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
                    } else {
                        $comments = '';
                    }
                    // require functionblock for mails
                    require_once DIR_WS_CLASSES . 'class.phpmailer.php';
                    require_once DIR_FS_INC . 'xtc_php_mail.inc.php';
                    require_once DIR_FS_INC . 'xtc_add_tax.inc.php';
                    require_once DIR_FS_INC . 'xtc_not_null.inc.php';
                    require_once DIR_FS_INC . 'xtc_href_link.inc.php';
                    require_once DIR_FS_INC . 'xtc_date_long.inc.php';
                    require_once DIR_FS_INC . 'xtc_check_agent.inc.php';
                    $smarty = new Smarty();
                    $smarty->assign('language', $check_status['language']);
                    $smarty->caching = false;
                    $smarty->template_dir = DIR_FS_CATALOG . 'templates';
                    $smarty->compile_dir = DIR_FS_CATALOG . 'templates_c';
                    $smarty->config_dir = DIR_FS_CATALOG . 'lang';
                    //BOF - GTB - 2010-08-03 - Security Fix - Base
                    $smarty->assign('tpl_path', DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/');
                    //$smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/');
                    //EOF - GTB - 2010-08-03 - Security Fix - Base
                    $smarty->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/');
                    $smarty->assign('NAME', $check_status['customers_name']);
                    $smarty->assign('ORDER_NR', $oID);
                    $smarty->assign('ORDER_LINK', xtc_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL'));
                    $smarty->assign('ORDER_DATE', xtc_date_long($check_status['date_purchased']));
                    $smarty->assign('NOTIFY_COMMENTS', $comments);
                    $smarty->assign('ORDER_STATUS', $o_status);
                    $html_mail = $smarty->fetch('db:change_order_mail.html');
                    $txt_mail = $smarty->fetch('db:change_order_mail.txt');
                    // send mail with html/txt template
                    xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $check_status['customers_email_address'], $check_status['customers_name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', EMAIL_BILLING_SUBJECT, $html_mail, $txt_mail);
                    $customer_notified = '1';
                }
                xtc_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . xtc_db_input($oID) . "', '" . xtc_db_input($status) . "', now(), '" . $customer_notified . "', '" . xtc_db_input($comments) . "')");
                $schema .= '<STATUS>' . "\n" . '<STATUS_DATA>' . "\n" . '<ORDER_ID>' . $oID . '</ORDER_ID>' . "\n" . '<ORDER_STATUS>' . $status . '</ORDER_STATUS>' . "\n" . '<ACTION>' . $_POST['action'] . '</ACTION>' . "\n" . '<CODE>' . '0' . '</CODE>' . "\n" . '<MESSAGE>' . 'OK' . '</MESSAGE>' . "\n" . '</STATUS_DATA>' . "\n" . '</STATUS>' . "\n";
            } else {
                if ($check_status['orders_status'] == $status) {
                    // Status ist bereits gesetzt
                    $schema .= '<STATUS>' . "\n" . '<STATUS_DATA>' . "\n" . '<ORDER_ID>' . $oID . '</ORDER_ID>' . "\n" . '<ORDER_STATUS>' . $status . '</ORDER_STATUS>' . "\n" . '<ACTION>' . $_POST['action'] . '</ACTION>' . "\n" . '<CODE>' . '1' . '</CODE>' . "\n" . '<MESSAGE>' . 'NO STATUS CHANGE' . '</MESSAGE>' . "\n" . '</STATUS_DATA>' . "\n" . '</STATUS>' . "\n";
                }
            }
        } else {
            // Fehler Order existiert nicht
            $schema .= '<STATUS>' . "\n" . '<STATUS_DATA>' . "\n" . '<ORDER_ID>' . $oID . '</ORDER_ID>' . "\n" . '<ACTION>' . $_POST['action'] . '</ACTION>' . "\n" . '<CODE>' . '2' . '</CODE>' . "\n" . '<MESSAGE>' . 'ORDER_ID NOT FOUND OR SET' . '</MESSAGE>' . "\n" . '</STATUS_DATA>' . "\n" . '</STATUS>' . "\n";
        }
    } else {
        $schema = '<?xml version="1.0" encoding="' . CHARSET . '"?>' . "\n" . '<STATUS>' . "\n" . '<STATUS_DATA>' . "\n" . '<ACTION>' . $_POST['action'] . '</ACTION>' . "\n" . '<CODE>' . '99' . '</CODE>' . "\n" . '<MESSAGE>' . 'PARAMETER ERROR' . '</MESSAGE>' . "\n" . '</STATUS_DATA>' . "\n" . '</STATUS>' . "\n\n";
    }
    echo $schema;
}
        		$download_expiry = date('Y-m-d H:i:s', $download_timestamp);*/
        // EOF - vr - 2010-03-19 simplify download expiry calculation
        //<!-- left box -->
        // The link will appear only if:
        // - Download remaining count is > 0, AND
        // - The file is present in the DOWNLOAD directory, AND EITHER
        // - No expiry date is enforced (maxdays == 0), OR
        // - The expiry date is not reached
        // BOF - vr - 2010-03-19 simplify download expiry calculation
        /* if (($downloads['download_count'] > 0) && (file_exists(DIR_FS_DOWNLOAD.$downloads['orders_products_filename'])) && (($downloads['download_maxdays'] == 0) || ($download_timestamp > time())) && ($order_status >= DOWNLOAD_MIN_ORDERS_STATUS)) */
        if ($downloads['download_count'] > 0 && strtotime($downloads['download_expiry']) > time() && file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']) && $order_status >= DOWNLOAD_MIN_ORDERS_STATUS) {
            $dl[$jj]['download_link'] = '<a href="' . xtc_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $downloads['products_name'] . '</a>';
            $dl[$jj]['pic_link'] = xtc_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']);
        } else {
            $dl[$jj]['download_link'] = $downloads['products_name'];
        }
        //<!-- right box -->
        // BOF - vr - 2010-03-19 simplify download expiry calculation
        // $dl[$jj]['date'] = xtc_date_long($download_expiry);
        $dl[$jj]['date'] = xtc_date_long($downloads['download_expiry']);
        // EOF - vr - 2010-03-19 simplify download expiry calculation
        $dl[$jj]['count'] = $downloads['download_count'];
        $jj++;
    }
}
$module_smarty->assign('dl', isset($dl) ? $dl : '');
$module_smarty->assign('language', $_SESSION['language']);
$module_smarty->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/');
$module_smarty->caching = 0;
$module = $module_smarty->fetch(CURRENT_TEMPLATE . '/module/downloads.html');
$smarty->assign('downloads_content', $module);
$get_params = xtc_get_all_get_params(array('reviews_id'));
$get_params = substr($get_params, 0, -1);
//remove trailing &
$reviews_query = "select rd.reviews_text,\n                         r.reviews_rating,\n                         r.reviews_id,\n                         r.products_id,\n                         r.customers_name,\n                         r.date_added,\n                         r.last_modified,\n                         r.reviews_read,\n                         p.products_id,\n                         pd.products_name,\n                         p.products_image\n                  from " . TABLE_REVIEWS . " r\n                  left join " . TABLE_PRODUCTS . " p on (r.products_id = p.products_id)\n                  left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on (p.products_id = pd.products_id \n                  and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'), " . TABLE_REVIEWS_DESCRIPTION . " rd \n                  where r.reviews_id = '" . (int) $_GET['reviews_id'] . "'\n                  and r.reviews_id = rd.reviews_id\n                  and p.products_status = '1'";
$reviews_query = xtc_db_query($reviews_query);
if (!xtc_db_num_rows($reviews_query)) {
    xtc_redirect(xtc_href_link(FILENAME_REVIEWS));
}
$reviews = xtc_db_fetch_array($reviews_query);
$breadcrumb->add(NAVBAR_TITLE_PRODUCT_REVIEWS, xtc_href_link(FILENAME_PRODUCT_REVIEWS, $get_params));
xtc_db_query("update " . TABLE_REVIEWS . " set reviews_read = reviews_read+1 where reviews_id = '" . $reviews['reviews_id'] . "'");
$reviews_text = xtc_break_string(encode_htmlspecialchars($reviews['reviews_text']), 60, '-<br />');
require DIR_WS_INCLUDES . 'header.php';
$smarty->assign('PRODUCTS_NAME', $reviews['products_name']);
$smarty->assign('AUTHOR', $reviews['customers_name']);
$smarty->assign('DATE', xtc_date_long($reviews['date_added']));
$smarty->assign('REVIEWS_TEXT', nl2br($reviews_text));
$smarty->assign('RATING', xtc_image('templates/' . CURRENT_TEMPLATE . '/img/stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])));
$smarty->assign('PRODUCTS_LINK', xtc_href_link(FILENAME_PRODUCT_INFO, xtc_product_link($reviews['products_id'], $reviews['products_name'])));
$smarty->assign('BUTTON_BACK', '<a href="' . xtc_href_link(FILENAME_PRODUCT_REVIEWS, $get_params) . '">' . xtc_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>');
$smarty->assign('BUTTON_BUY_NOW', '<a href="' . xtc_href_link(FILENAME_DEFAULT, 'action=buy_now&BUYproducts_id=' . $reviews['products_id']) . '">' . xtc_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>');
$smarty->assign('IMAGE', '<a href="javascript:popupImageWindow(\'' . xtc_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $reviews['products_id']) . '\')">' . xtc_image(DIR_WS_THUMBNAIL_IMAGES . $reviews['products_image'], $reviews['products_name'], '', '', 'align="center" hspace="5" vspace="5"') . '<br /></a>');
$smarty->assign('language', $_SESSION['language']);
// set cache ID
if (!CacheCheck()) {
    $smarty->caching = 0;
    $main_content = $smarty->fetch(CURRENT_TEMPLATE . '/module/product_reviews_info.html');
} else {
    $smarty->caching = 1;
    $smarty->cache_lifetime = CACHE_LIFETIME;
    $smarty->cache_modified_check = CACHE_CHECK;
 function get_html($p_coo_product, $p_current_category_id = 0)
 {
     $t_html_output = '';
     $xtPrice = new xtcPrice($_SESSION['currency'], $_SESSION['customers_status']['customers_status_id']);
     $main = new main();
     $group_check = '';
     // xs:booster start (v1.041)
     $xsb_tx = array();
     if (@is_array($_SESSION['xtb0']['tx'])) {
         foreach ($_SESSION['xtb0']['tx'] as $tx) {
             if ($tx['products_id'] == $p_coo_product->data['products_id']) {
                 $xsb_tx = $tx;
                 break;
             }
         }
     }
     // xs:booster end
     if (!is_object($p_coo_product) || !$p_coo_product->isProduct()) {
         // product not found in database
         $error = TEXT_PRODUCT_NOT_FOUND;
         include DIR_WS_MODULES . FILENAME_ERROR_HANDLER;
         $t_html_output = $main_content;
     } else {
         if (ACTIVATE_NAVIGATOR == 'true') {
             $coo_product_navigator = MainFactory::create_object('ProductNavigatorContentView');
             $t_view_html = $coo_product_navigator->get_html($p_coo_product, $p_current_category_id);
             $this->set_content_data('PRODUCT_NAVIGATOR', $t_view_html);
         }
         xtc_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . $p_coo_product->data['products_id'] . "' and language_id = '" . $_SESSION['languages_id'] . "'");
         $products_price = $xtPrice->xtcGetPrice($p_coo_product->data['products_id'], $format = true, 1, $p_coo_product->data['products_tax_class_id'], $p_coo_product->data['products_price'], 1);
         // check if customer is allowed to add to cart
         // BOF GM_MOD:
         if ($_SESSION['customers_status']['customers_status_show_price'] != '0' && $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0) {
             // fsk18
             if ($_SESSION['customers_status']['customers_fsk18'] == '1') {
                 if ($p_coo_product->data['products_fsk18'] == '0') {
                     // BOF GM_MOD:
                     $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', gm_convert_qty($p_coo_product->data['gm_min_order'], false), 'id="gm_attr_calc_qty"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                     $t_quantity = gm_convert_qty($p_coo_product->data['gm_min_order'], false);
                     $t_disabled_quantity = 0;
                     if (@$xsb_tx['XTB_ALLOW_USER_CHQTY'] == 'true' || $xsb_tx['products_id'] != $p_coo_product->data['products_id']) {
                         $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', str_replace('.', ',', (double) $p_coo_product->data['gm_min_order']), 'id="gm_attr_calc_qty"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                     } else {
                         $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', '1', 'disabled="disabled" style="background-color:gray;"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_attr_calc_qty"'));
                         $t_quantity = 1;
                         $t_disabled_quantity = 1;
                     }
                     $this->set_content_data('QUANTITY', $t_quantity);
                     $this->set_content_data('DISABLED_QUANTITY', $t_disabled_quantity);
                     $this->set_content_data('ADD_CART_BUTTON', xtc_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'id="cart_button"'));
                     if (gm_get_conf('GM_SHOW_WISHLIST') == 'true') {
                         $this->set_content_data('ADD_WISHLIST_BUTTON', '<a href="javascript:submit_to_wishlist()" id="gm_wishlist_link">' . xtc_image_button('button_in_wishlist.gif', NC_WISHLIST) . '</a>');
                     }
                 } else {
                     $this->set_content_data('GM_PID', xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                 }
             } else {
                 // BOF GM_MOD:
                 $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', gm_convert_qty($p_coo_product->data['gm_min_order'], false), 'id="gm_attr_calc_qty"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                 $t_quantity = gm_convert_qty($p_coo_product->data['gm_min_order'], false);
                 $t_disabled_quantity = 0;
                 if (@$xsb_tx['XTB_ALLOW_USER_CHQTY'] == 'true' || $xsb_tx['products_id'] != $p_coo_product->data['products_id']) {
                     $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', str_replace('.', ',', (double) $p_coo_product->data['gm_min_order']), 'id="gm_attr_calc_qty"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                 } else {
                     $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', '1', 'disabled="disabled" style="background-color:gray;"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_attr_calc_qty"'));
                     $t_quantity = 1;
                     $t_disabled_quantity = 1;
                 }
                 $this->set_content_data('QUANTITY', $t_quantity);
                 $this->set_content_data('DISABLED_QUANTITY', $t_disabled_quantity);
                 $this->set_content_data('ADD_CART_BUTTON', xtc_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'id="cart_button"'));
                 if (gm_get_conf('GM_SHOW_WISH_LIST') == 'true') {
                     $this->set_content_data('ADD_WISHLIST_BUTTON', '<a href="javascript:submit_to_wishlist()">' . xtc_image_button('button_in_wishlist.gif', NC_WISHLIST) . '</a>');
                 }
             }
         } elseif ($xtPrice->gm_check_price_status($p_coo_product->data['products_id']) > 0 || $_SESSION['customers_status']['customers_status_show_price'] == '0') {
             $this->set_content_data('GM_PID', xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
         }
         if ($p_coo_product->data['products_fsk18'] == '1') {
             $this->set_content_data('PRODUCTS_FSK18', 'true');
         }
         // BOF GM_MOD:
         if (ACTIVATE_SHIPPING_STATUS == 'true' && $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0) {
             $this->set_content_data('SHIPPING_NAME', $main->getShippingStatusName($p_coo_product->data['products_shippingtime']));
             $this->set_content_data('SHIPPING_IMAGE', $main->getShippingStatusImage($p_coo_product->data['products_shippingtime']));
         }
         // BOF_GM_MOD:
         $this->set_content_data('FORM_ACTION', xtc_draw_form('cart_quantity', xtc_href_link(FILENAME_PRODUCT_INFO, xtc_get_all_get_params(array('action')) . 'action=add_product'), 'post', 'name="cart_quantity" onsubmit="gm_qty_check = new GMOrderQuantityChecker(); return gm_qty_check.check();"'));
         $this->set_content_data('FORM_ACTION_URL', xtc_href_link(FILENAME_PRODUCT_INFO, xtc_get_all_get_params(array('action')) . 'action=add_product'));
         $this->set_content_data('FORM_ID', 'cart_quantity');
         $this->set_content_data('FORM_NAME', 'cart_quantity');
         $this->set_content_data('FORM_METHOD', 'post');
         // BOF GM_MOD GX-Customizer
         $coo_gm_gprint_product_manager = new GMGPrintProductManager();
         if ($coo_gm_gprint_product_manager->get_surfaces_groups_id($p_coo_product->data['products_id']) !== false) {
             $coo_gm_gprint_configuration = new GMGPrintConfiguration($_SESSION['languages_id']);
             $this->set_content_data('GM_GPRINT_SHOW_PRODUCTS_DESCRIPTION', $coo_gm_gprint_configuration->get_configuration('SHOW_PRODUCTS_DESCRIPTION'));
             $this->set_content_data('GM_GPRINT', 1);
         }
         // EOF GM_MOD GX-Customizer
         $this->set_content_data('FORM_END', '</form>');
         $this->set_content_data('PRODUCTS_PRICE', $products_price['formated']);
         if ($p_coo_product->data['products_vpe_status'] == 1 && $p_coo_product->data['products_vpe_value'] != 0.0 && $products_price['plain'] > 0) {
             $this->set_content_data('PRODUCTS_VPE', $xtPrice->xtcFormat($products_price['plain'] * (1 / $p_coo_product->data['products_vpe_value']), true) . TXT_PER . xtc_get_vpe_name($p_coo_product->data['products_vpe']));
         }
         $this->set_content_data('PRODUCTS_ID', $p_coo_product->data['products_id']);
         $this->set_content_data('PRODUCTS_NAME', $p_coo_product->data['products_name']);
         // BOF GM_MOD:
         if ($_SESSION['customers_status']['customers_status_show_price'] != 0 && ($xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0 || $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 2 && $p_coo_product->data['products_price'] > 0)) {
             // price incl tax
             $tax_rate = $xtPrice->TAX[$p_coo_product->data['products_tax_class_id']];
             $tax_info = $main->getTaxInfo($tax_rate);
             $this->set_content_data('PRODUCTS_TAX_INFO', $tax_info);
             // BOF GM_MOD:
             if ($xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0) {
                 $this->set_content_data('PRODUCTS_SHIPPING_LINK', $main->getShippingLink(true));
             }
         }
         // BOF GM_MOD
         if (gm_get_conf('GM_TELL_A_FRIEND') == 'true') {
             $this->set_content_data('GM_TELL_A_FRIEND', 1);
         }
         if ($p_coo_product->data['gm_show_price_offer'] == 1 && $_SESSION['customers_status']['customers_status_show_price'] != '0' && $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0) {
             $this->set_content_data('GM_PRICE_OFFER', 1);
         }
         if ((double) $p_coo_product->data['gm_min_order'] != 1) {
             $this->set_content_data('GM_MIN_ORDER', gm_convert_qty($p_coo_product->data['gm_min_order'], false));
         }
         if ((double) $p_coo_product->data['gm_graduated_qty'] != 1) {
             $this->set_content_data('GM_GRADUATED_QTY', gm_convert_qty($p_coo_product->data['gm_graduated_qty'], false));
         }
         // EOF GM_MOD
         $this->set_content_data('PRODUCTS_MODEL', $p_coo_product->data['products_model']);
         $this->set_content_data('PRODUCTS_EAN', $p_coo_product->data['products_ean']);
         if ($p_coo_product->data['gm_show_qty_info'] == 1) {
             $this->set_content_data('PRODUCTS_QUANTITY', gm_convert_qty(xtc_get_products_stock($p_coo_product->data['products_id']), false));
             if ($p_coo_product->data['quantity_unit_id'] > 0) {
                 $this->set_content_data('PRODUCTS_QUANTITY_UNIT', $p_coo_product->data['unit_name']);
             }
         }
         // BOF GM_MOD
         if ($p_coo_product->data['gm_show_weight'] == '1') {
             $this->set_content_data('SHOW_PRODUCTS_WEIGHT', 1);
             $this->set_content_data('PRODUCTS_WEIGHT', gm_prepare_number($p_coo_product->data['products_weight'], $xtPrice->currencies[$xtPrice->actualCurr]['decimal_point']));
         }
         // EOF GM_MOD
         $this->set_content_data('PRODUCTS_STATUS', $p_coo_product->data['products_status']);
         $this->set_content_data('PRODUCTS_ORDERED', $p_coo_product->data['products_ordered']);
         $this->set_content_data('PRODUCTS_PRINT', '<img src="templates/' . CURRENT_TEMPLATE . '/buttons/' . $_SESSION['language'] . '/print.gif"  style="cursor:hand;" onclick="javascript:window.open(\'' . xtc_href_link(FILENAME_PRINT_PRODUCT_INFO, 'products_id=' . $p_coo_product->data['products_id']) . '\', \'popup\', \'toolbar=0, width=640, height=600\')" alt="" />');
         //GM_MOD:
         $gmTabTokenizer = MainFactory::create_object('GMTabTokenizer', array(stripslashes($p_coo_product->data['products_description'])));
         $gm_products_descrition = $gmTabTokenizer->get_prepared_output();
         $this->set_content_data('PRODUCTS_DESCRIPTION', $gm_products_descrition);
         $t_gm_images_data = array();
         $t_thumbnails_array = array();
         $t_main_max_width = 369;
         $t_main_max_height = 279;
         $t_thumbnail_max_width = 86;
         $t_thumbnail_max_height = 86;
         // BOF GM_MOD
         require_once DIR_FS_CATALOG . 'gm/classes/GMGMotion.php';
         $coo_gm_gmotion = new GMGMotion();
         $this->set_content_data('GMOTION', $coo_gm_gmotion->check_status($p_coo_product->data['products_id']));
         // EOF GM_MOD
         if (isset($xsb_tx['XTB_REDIRECT_USER_TO']) && $xsb_tx['products_id'] == $p_coo_product->data['products_id']) {
             $this->set_content_data('XTB_REDIRECT_USER_TO', $xsb_tx['XTB_REDIRECT_USER_TO']);
         }
         // BOF GM_MOD
         if ($p_coo_product->data['products_image'] != '' && $p_coo_product->data['gm_show_image'] == '1') {
             $t_info_image_size_array = @getimagesize(DIR_WS_INFO_IMAGES . $p_coo_product->data['products_image']);
             $t_thumbnail_image_size_array = @getimagesize(DIR_WS_IMAGES . 'product_images/gallery_images/' . $p_coo_product->data['products_image']);
             $t_main_padding_left = 0;
             $t_main_padding_top = 0;
             if (isset($t_info_image_size_array[0]) && $t_info_image_size_array[0] < $t_main_max_width) {
                 $t_main_padding_left = round(($t_main_max_width - $t_info_image_size_array[0]) / 2);
             }
             if (isset($t_info_image_size_array[1]) && $t_info_image_size_array[1] < $t_main_max_height) {
                 $t_main_padding_top = round(($t_main_max_height - $t_info_image_size_array[1]) / 2);
             }
             $t_zoom_image = DIR_WS_POPUP_IMAGES . $p_coo_product->data['products_image'];
             if (file_exists(DIR_WS_ORIGINAL_IMAGES . $p_coo_product->data['products_image'])) {
                 $t_zoom_image = DIR_WS_ORIGINAL_IMAGES . $p_coo_product->data['products_image'];
             }
             $t_gm_images_data[] = array('IMAGE' => DIR_WS_INFO_IMAGES . $p_coo_product->data['products_image'], 'IMAGE_ALT' => $p_coo_product->data['gm_alt_text'], 'IMAGE_NR' => 0, 'ZOOM_IMAGE' => $t_zoom_image, 'PRODUCTS_NAME' => $p_coo_product->data['products_name'], 'PADDING_LEFT' => $t_main_padding_left, 'PADDING_TOP' => $t_main_padding_top, 'WIDTH' => $t_info_image_size_array[0], 'HEIGHT' => $t_info_image_size_array[1]);
             $t_thumbnail_padding_left = 0;
             $t_thumbnail_padding_top = 0;
             if (isset($t_thumbnail_image_size_array[0]) && $t_thumbnail_image_size_array[0] < $t_thumbnail_max_width) {
                 $t_thumbnail_padding_left = round(($t_thumbnail_max_width - $t_thumbnail_image_size_array[0]) / 2);
             }
             if (isset($t_thumbnail_image_size_array[1]) && $t_thumbnail_image_size_array[1] < $t_thumbnail_max_height) {
                 $t_thumbnail_padding_top = round(($t_thumbnail_max_height - $t_thumbnail_image_size_array[1]) / 2);
             }
             $t_thumbnails_array[] = array('IMAGE' => DIR_WS_IMAGES . 'product_images/gallery_images/' . $p_coo_product->data['products_image'], 'IMAGE_ALT' => $p_coo_product->data['gm_alt_text'], 'IMAGE_NR' => 0, 'ZOOM_IMAGE' => $t_zoom_image, 'INFO_IMAGE' => DIR_WS_INFO_IMAGES . $p_coo_product->data['products_image'], 'PRODUCTS_NAME' => $p_coo_product->data['products_name'], 'PADDING_LEFT' => $t_thumbnail_padding_left, 'PADDING_TOP' => $t_thumbnail_padding_top);
         }
         $t_gm_images = xtc_get_products_mo_images($p_coo_product->data['products_id']);
         if ($t_gm_images != false) {
             $coo_gm_alt_form = MainFactory::create_object('GMAltText');
             foreach ($t_gm_images as $t_gm_image) {
                 $t_info_image_size_array = @getimagesize(DIR_WS_INFO_IMAGES . $t_gm_image['image_name']);
                 $t_thumbnail_image_size_array = @getimagesize(DIR_WS_IMAGES . 'product_images/gallery_images/' . $t_gm_image['image_name']);
                 $t_main_padding_left = 0;
                 $t_main_padding_top = 0;
                 if (isset($t_info_image_size_array[0]) && $t_info_image_size_array[0] < $t_main_max_width) {
                     $t_main_padding_left = round(($t_main_max_width - $t_info_image_size_array[0]) / 2);
                 }
                 if (isset($t_info_image_size_array[1]) && $t_info_image_size_array[1] < $t_main_max_height) {
                     $t_main_padding_top = round(($t_main_max_height - $t_info_image_size_array[1]) / 2);
                 }
                 $t_zoom_image = DIR_WS_POPUP_IMAGES . $t_gm_image['image_name'];
                 if (file_exists(DIR_WS_ORIGINAL_IMAGES . $t_gm_image['image_name'])) {
                     $t_zoom_image = DIR_WS_ORIGINAL_IMAGES . $t_gm_image['image_name'];
                 }
                 $t_gm_images_data[] = array('IMAGE' => DIR_WS_INFO_IMAGES . $t_gm_image['image_name'], 'IMAGE_ALT' => $coo_gm_alt_form->get_alt($t_gm_image["image_id"], $t_gm_image['image_nr'], $p_coo_product->data['products_id']), 'IMAGE_NR' => $t_gm_image['image_nr'], 'ZOOM_IMAGE' => $t_zoom_image, 'PRODUCTS_NAME' => $p_coo_product->data['products_name'], 'PADDING_LEFT' => $t_main_padding_left, 'PADDING_TOP' => $t_main_padding_top, 'IMAGE_POPUP_URL' => DIR_WS_POPUP_IMAGES . $t_gm_image['image_name']);
                 $t_thumbnail_padding_left = 0;
                 $t_thumbnail_padding_top = 0;
                 if (isset($t_thumbnail_image_size_array[0]) && $t_thumbnail_image_size_array[0] < $t_thumbnail_max_width) {
                     $t_thumbnail_padding_left = round(($t_thumbnail_max_width - $t_thumbnail_image_size_array[0]) / 2);
                 }
                 if (isset($t_thumbnail_image_size_array[1]) && $t_thumbnail_image_size_array[1] < $t_thumbnail_max_height) {
                     $t_thumbnail_padding_top = round(($t_thumbnail_max_height - $t_thumbnail_image_size_array[1]) / 2);
                 }
                 $t_thumbnails_array[] = array('IMAGE' => DIR_WS_IMAGES . 'product_images/gallery_images/' . $t_gm_image['image_name'], 'IMAGE_ALT' => $coo_gm_alt_form->get_alt($t_gm_image["image_id"], $t_gm_image['image_nr'], $p_coo_product->data['products_id']), 'IMAGE_NR' => $t_gm_image['image_nr'], 'ZOOM_IMAGE' => $t_zoom_image, 'INFO_IMAGE' => DIR_WS_INFO_IMAGES . $t_gm_image['image_name'], 'PRODUCTS_NAME' => $p_coo_product->data['products_name'], 'PADDING_LEFT' => $t_thumbnail_padding_left, 'PADDING_TOP' => $t_thumbnail_padding_top);
             }
         }
         $this->set_content_data('images', $t_gm_images_data);
         $this->set_content_data('thumbnails', $t_thumbnails_array);
         // EOF GM_MOD
         $discount = 0.0;
         if ($_SESSION['customers_status']['customers_status_discount'] != '0.00') {
             // BOF GM_MOD:
             $discount = $_SESSION['customers_status']['customers_status_discount'];
             if ($p_coo_product->data['products_discount_allowed'] < $_SESSION['customers_status']['customers_status_discount']) {
                 $discount = $p_coo_product->data['products_discount_allowed'];
             }
             if ($discount != '0.00') {
                 $this->set_content_data('PRODUCTS_DISCOUNT', $discount . '%');
             }
         }
         // BOF GM_MOD
         if (PRODUCT_IMAGE_INFO_WIDTH < 190 - 16) {
             $this->set_content_data('MIN_IMAGE_WIDTH', 188);
             $this->set_content_data('MIN_INFO_BOX_WIDTH', 156 - 10);
             $this->set_content_data('MARGIN_LEFT', 188 + 10);
         } else {
             $this->set_content_data('MIN_IMAGE_WIDTH', PRODUCT_IMAGE_INFO_WIDTH + 16);
             $this->set_content_data('MIN_INFO_BOX_WIDTH', PRODUCT_IMAGE_INFO_WIDTH + 16 - 32 - 10);
             $this->set_content_data('MARGIN_LEFT', PRODUCT_IMAGE_INFO_WIDTH + 16 + 10);
         }
         // EOF GM_MOD
         $coo_product_attributes = MainFactory::create_object('ProductAttributesContentView', array($p_coo_product->data['options_template']));
         $t_view_html = $coo_product_attributes->get_html($p_coo_product);
         $this->set_content_data('MODULE_product_options', $t_view_html);
         $coo_product_reviews = MainFactory::create_object('ProductReviewsContentView');
         $t_view_html = $coo_product_reviews->get_html($p_coo_product);
         $this->set_content_data('MODULE_products_reviews', $t_view_html);
         if (xtc_not_null($p_coo_product->data['products_url'])) {
             $this->set_content_data('PRODUCTS_URL', sprintf(TEXT_MORE_INFORMATION, xtc_href_link(FILENAME_REDIRECT, 'action=product&id=' . $p_coo_product->data['products_id'], 'NONSSL', true)));
         }
         if ($p_coo_product->data['products_date_available'] > date('Y-m-d H:i:s')) {
             $this->set_content_data('PRODUCTS_DATE_AVIABLE', sprintf(TEXT_DATE_AVAILABLE, xtc_date_long($p_coo_product->data['products_date_available'])));
         } else {
             // BOF GM_MOD:
             if ($p_coo_product->data['products_date_added'] != '0000-00-00 00:00:00' && $p_coo_product->data['gm_show_date_added'] == 1) {
                 $this->set_content_data('PRODUCTS_ADDED', sprintf(TEXT_DATE_ADDED, xtc_date_long($p_coo_product->data['products_date_added'])));
             }
         }
         $coo_product_media = MainFactory::create_object('ProductMediaContentView');
         $t_view_html = $coo_product_media->get_html($p_coo_product->data['products_id'], $_SESSION['languages_id']);
         $this->set_content_data('MODULE_products_media', $t_view_html);
         $coo_graduated_prices = MainFactory::create_object('GraduatedPricesContentView');
         $t_view_html = $coo_graduated_prices->get_html($p_coo_product);
         $this->set_content_data('MODULE_graduated_price', $t_view_html);
         $coo_also_purchased = MainFactory::create_object('AlsoPurchasedContentView');
         $t_view_html = $coo_also_purchased->get_html($p_coo_product);
         $this->set_content_data('MODULE_also_purchased', $t_view_html);
         $coo_cross_selling = MainFactory::create_object('CrossSellingContentView', array('cross_selling'));
         $t_view_html = $coo_cross_selling->get_html($p_coo_product);
         $this->set_content_data('MODULE_cross_selling', $t_view_html);
         $coo_reverse_cross_selling = MainFactory::create_object('CrossSellingContentView', array('reverse_cross_selling'));
         $t_view_html = $coo_reverse_cross_selling->get_html($p_coo_product);
         $this->set_content_data('MODULE_reverse_cross_selling', $t_view_html);
         $i = count($_SESSION['tracking']['products_history']);
         if ($i > 6) {
             array_shift($_SESSION['tracking']['products_history']);
             $_SESSION['tracking']['products_history'][6] = $p_coo_product->data['products_id'];
             $_SESSION['tracking']['products_history'] = array_unique($_SESSION['tracking']['products_history']);
         } else {
             $_SESSION['tracking']['products_history'][$i] = $p_coo_product->data['products_id'];
             $_SESSION['tracking']['products_history'] = array_unique($_SESSION['tracking']['products_history']);
         }
         $coo_stop_watch = new StopWatch();
         $coo_stop_watch->start();
         $coo_properties_view = MainFactory::create_object('PropertiesView', array($_GET, $_POST));
         $t_properties_selection_form = $coo_properties_view->get_selection_form($p_coo_product->data['products_id'], $_SESSION['languages_id']);
         if (trim($t_properties_selection_form) != "") {
             if ($p_coo_product->data['gm_show_qty_info'] == 1) {
                 if ($p_coo_product->data['use_properties_combis_quantity'] == 0 && STOCK_CHECK == 'true' && ATTRIBUTES_STOCK_CHECK == 'true' || $p_coo_product->data['use_properties_combis_quantity'] == 2) {
                     $this->set_content_data('PRODUCTS_QUANTITY', '-');
                     $this->set_content_data('SHOW_PRODUCTS_QUANTITY', true);
                 } else {
                     if ($p_coo_product->data['use_properties_combis_quantity'] == 1) {
                         $this->set_content_data('SHOW_PRODUCTS_QUANTITY', true);
                     }
                 }
             }
             $this->set_content_data('SHOW_PRODUCTS_MODEL', true);
             if (APPEND_PROPERTIES_MODEL == "false" || trim($p_coo_product->data['products_model']) == '') {
                 $this->set_content_data('PRODUCTS_MODEL', '-');
             }
             if (ACTIVATE_SHIPPING_STATUS == 'true' && $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0 && $p_coo_product->data['use_properties_combis_shipping_time'] == 1) {
                 $this->set_content_data('SHOW_SHIPPING_TIME', true);
                 $this->set_content_data('SHIPPING_NAME', '');
                 $this->set_content_data('SHIPPING_IMAGE', 'admin/images/icons/gray.png');
             }
         }
         $this->set_content_data('properties_selection_form', $t_properties_selection_form);
         $coo_stop_watch->stop();
         //$coo_stop_watch->log_total_time('PropertiesView get_selection_form');
         // BOF GM_MOD
         $t_gm_show_wishlist = gm_get_conf('GM_SHOW_WISHLIST');
         if ($t_gm_show_wishlist == 'true') {
             $this->set_content_data('GM_SHOW_WISHLIST', 1);
         }
         $t_show_facebook = gm_get_conf('SHOW_FACEBOOK');
         if ($t_show_facebook == 'true') {
             $this->set_content_data('SHOW_FACEBOOK', 1);
         }
         $t_show_twitter = gm_get_conf('SHOW_TWITTER');
         if ($t_show_twitter == 'true') {
             $this->set_content_data('SHOW_TWITTER', 1);
         }
         $t_show_googleplus = gm_get_conf('SHOW_GOOGLEPLUS');
         if ($t_show_googleplus == 'true') {
             $this->set_content_data('SHOW_GOOGLEPLUS', 1);
         }
         $t_show_pinterest = gm_get_conf('SHOW_PINTEREST');
         if ($t_show_pinterest == 'true') {
             $this->set_content_data('SHOW_PINTEREST', 1);
         }
         $t_show_print = gm_get_conf('SHOW_PRINT');
         if ($t_show_print == 'true') {
             $this->set_content_data('SHOW_PRINT', 1);
         }
         $t_show_bookmarking = gm_get_conf('SHOW_BOOKMARKING');
         if ($t_show_bookmarking == 'true') {
             $this->set_content_data('SHOW_BOOKMARKING', 1);
         }
         // EOF GM_MOD
         // Bitcoin Payment - Commerce Coding - BEGIN
         $multiplier = 1;
         $digits = 8;
         switch (MODULE_PAYMENT_BITCOIN_UNITS) {
             case 'uBTC':
                 $multiplier *= 1000;
                 $digits -= 3;
             case 'mBTC':
                 $multiplier *= 1000;
                 $digits -= 3;
             case 'BTC':
                 $btcPrice = number_format($products_price['plain'] / MODULE_PAYMENT_BITCOIN_BTCEUR * $multiplier, $digits, '.', '');
                 $this->set_content_data('BITCOIN_PRICE', $btcPrice . ' ' . MODULE_PAYMENT_BITCOIN_UNITS);
         }
         // Bitcoin Payment - Commerce Coding - END
         include_once DIR_FS_DOCUMENT_ROOT . '/shopgate/plugins/gambiogx/system/views/product_info/ProductInfoContentView.inc.php';
         $t_html_output = $this->build_html();
     }
     return $t_html_output;
 }
Example #13
0
         $smarty->assign('ORDER_LINK', xtc_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL'));
         $smarty->assign('ORDER_DATE', xtc_date_long($check_status['date_purchased']));
         $smarty->assign('ORDER_STATUS', $orders_status_array[$status]);
         if (defined('EMAIL_SIGNATURE')) {
             $smarty->assign('EMAIL_SIGNATURE_HTML', nl2br(EMAIL_SIGNATURE));
             $smarty->assign('EMAIL_SIGNATURE_TEXT', EMAIL_SIGNATURE);
         }
         $smarty->assign('NOTIFY_COMMENTS', nl2br($notify_comments));
         $html_mail = $smarty->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $order->info['language'] . '/change_order_mail.html');
         $smarty->assign('NOTIFY_COMMENTS', $notify_comments);
         $txt_mail = $smarty->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $order->info['language'] . '/change_order_mail.txt');
         // BOF GM_MOD
         if ($_SESSION['language'] == 'german') {
             xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $check_status['customers_email_address'], $check_status['customers_name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', 'Ihre Bestellung ' . $oID . ', ' . xtc_date_long($check_status['date_purchased']) . ', ' . $check_status['customers_name'], $html_mail, $txt_mail);
         } else {
             xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $check_status['customers_email_address'], $check_status['customers_name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', 'Your Order ' . $oID . ', ' . xtc_date_long($check_status['date_purchased']) . ', ' . $check_status['customers_name'], $html_mail, $txt_mail);
         }
         // EOF GM_MOD
         $customer_notified = '1';
     }
     xtc_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . xtc_db_input($oID) . "', '" . xtc_db_input($status) . "', now(), '" . $customer_notified . "', '" . xtc_db_input($comments) . "')");
     $order_updated = true;
 }
 if ($order_updated) {
     include_once DIR_FS_DOCUMENT_ROOT . '/shopgate/plugins/gambiogx/update_order.php';
     setShopgateOrderStatus($oID, $status);
     $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
 } else {
     $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
 }
 xtc_redirect(xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('action')) . 'action=edit'));