Пример #1
0
 function before_process()
 {
     global $order;
     parent::before_process();
     $days = 7;
     if (is_numeric(MODULE_PAYMENT_PAYMILL_ELV_PRENOTIFICATION_DAYS)) {
         $days = MODULE_PAYMENT_PAYMILL_ELV_PRENOTIFICATION_DAYS;
     }
     $date = zen_date_long(date('Y-m-d', strtotime("+{$days} day")) . ' 00:00:00');
     if ($order->info['comments']) {
         $order->info['comments'] .= "\n" . SEPA_DRAWN_TEXT . $date;
     } else {
         $order->info['comments'] = "\n" . SEPA_DRAWN_TEXT . $date;
     }
 }
function email_latest_status($oID)
{
    require DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . 'order_status_email.php';
    global $db;
    $orders_status_array = array();
    $orders_status = $db->Execute("select orders_status_id, orders_status_name\n                                 from " . TABLE_ORDERS_STATUS . "\n                                 where language_id = '" . (int) $_SESSION['languages_id'] . "'");
    while (!$orders_status->EOF) {
        $orders_status_array[$orders_status->fields['orders_status_id']] = $orders_status->fields['orders_status_name'];
        $orders_status->MoveNext();
    }
    $customer_info = $db->Execute("SELECT customers_name, customers_email_address, date_purchased\n                                 FROM " . TABLE_ORDERS . "\n                                 WHERE orders_id = '" . $oID . "'");
    $status_info = $db->Execute("SELECT orders_status_id, comments\n                               FROM " . TABLE_ORDERS_STATUS_HISTORY . "\n                               WHERE orders_id = '" . $oID . "'\n                               ORDER BY date_added Desc limit 1");
    $status = $status_info->fields['orders_status_id'];
    if ($_POST['notify_comments'] == 'on' && zen_not_null($status_info->fields['comments']) && $status_info->fields['comments'] != '') {
        $notify_comments = EMAIL_TEXT_COMMENTS_UPDATE . $status_info->fields['comments'] . "\n\n";
    }
    // send email to customer
    $message = STORE_NAME . " " . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n\n" . EMAIL_TEXT_INVOICE_URL . ' ' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($customer_info->fields['date_purchased']) . "\n\n" . strip_tags($notify_comments) . EMAIL_TEXT_STATUS_UPDATED . sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status]) . EMAIL_TEXT_STATUS_PLEASE_REPLY;
    $html_msg['EMAIL_CUSTOMERS_NAME'] = $customer_info->fields['customers_name'];
    $html_msg['EMAIL_TEXT_ORDER_NUMBER'] = EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID;
    $html_msg['EMAIL_TEXT_INVOICE_URL'] = '<a href="' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . '">' . str_replace(':', '', EMAIL_TEXT_INVOICE_URL) . '</a>';
    $html_msg['EMAIL_TEXT_DATE_ORDERED'] = EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($customer_info->fields['date_purchased']);
    $html_msg['EMAIL_TEXT_STATUS_COMMENTS'] = nl2br($notify_comments);
    $html_msg['EMAIL_TEXT_STATUS_UPDATED'] = str_replace('\\n', '', EMAIL_TEXT_STATUS_UPDATED);
    $html_msg['EMAIL_TEXT_STATUS_LABEL'] = str_replace('\\n', '', sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status]));
    $html_msg['EMAIL_TEXT_NEW_STATUS'] = $orders_status_array[$status];
    $html_msg['EMAIL_TEXT_STATUS_PLEASE_REPLY'] = str_replace('\\n', '', EMAIL_TEXT_STATUS_PLEASE_REPLY);
    $html_msg['EMAIL_PAYPAL_TRANSID'] = '';
    // End Zen Cart v1.5 Modified Core Code
    zen_mail($customer_info->fields['customers_name'], $customer_info->fields['customers_email_address'], EMAIL_TEXT_SUBJECT . ' #' . $oID, $message, STORE_NAME, EMAIL_FROM, $html_msg, 'order_status');
    // PayPal Trans ID, if any
    $sql = "select txn_id, parent_txn_id from " . TABLE_PAYPAL . " where order_id = :orderID order by last_modified DESC, date_added DESC, parent_txn_id DESC, paypal_ipn_id DESC ";
    $sql = $db->bindVars($sql, ':orderID', $oID, 'integer');
    $result = $db->Execute($sql);
    if ($result->RecordCount() > 0) {
        $message .= "\n\n" . ' PayPal Trans ID: ' . $result->fields['txn_id'];
        $html_msg['EMAIL_PAYPAL_TRANSID'] = $result->fields['txn_id'];
    }
    // End Zen Cart v1.5 Modified Core Code
    // send extra emails
    if (SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO_STATUS == '1' and SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO != '') {
        zen_mail('', SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO, SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO_SUBJECT . ' ' . EMAIL_TEXT_SUBJECT . ' #' . $oID, $message, STORE_NAME, EMAIL_FROM, $html_msg, 'order_status_extra');
    }
    //_TODO accept an optional array of additional recipients
}
Пример #3
0
 function updateStatus($pParamHash)
 {
     global $gBitUser;
     $order_updated = false;
     // default to order status if not specified
     $status = !empty($pParamHash['status']) ? zen_db_prepare_input($pParamHash['status']) : $this->getStatus();
     $comments = !empty($pParamHash['comments']) ? zen_db_prepare_input($pParamHash['comments']) : NULL;
     $statusChanged = $this->getStatus() != $status;
     if ($statusChanged || !empty($comments)) {
         $this->StartTrans();
         $this->mDb->query("update " . TABLE_ORDERS . "\n\t\t\t\t\t\t\t\tset `orders_status` = ?, `last_modified` = " . $this->mDb->NOW() . "\n\t\t\t\t\t\t\t\twhere `orders_id` = ?", array($status, $this->mOrdersId));
         $this->info['orders_status_id'] = $status;
         $this->info['orders_status'] = zen_get_order_status_name($status);
         $customer_notified = '0';
         if (isset($pParamHash['notify']) && $pParamHash['notify'] == 'on') {
             $notify_comments = '';
             if (!empty($comments)) {
                 $notify_comments = $comments . "\n\n";
             }
             //send emails
             $textMessage = STORE_NAME . "\n------------------------------------------------------\n" . tra('Order Number') . ': ' . $this->mOrdersId . "\n" . tra('Date Ordered') . ': ' . zen_date_long($this->info['date_purchased']) . "\n" . $this->getDisplayUrl() . "\n\n" . strip_tags($notify_comments);
             if ($statusChanged) {
                 $textMessage .= tra('Your order has been updated to the following status') . ': ' . $this->info['orders_status'] . "\n\n";
             }
             $textMessage .= tra('Please reply to this email if you have any questions.');
             $emailVars['EMAIL_CUSTOMERS_NAME'] = $this->customer['name'];
             $emailVars['EMAIL_TEXT_ORDER_NUMBER'] = tra('Order Number') . ': ' . $this->mOrdersId;
             $emailVars['EMAIL_TEXT_INVOICE_URL'] = $this->getDisplayLink();
             $emailVars['EMAIL_TEXT_DATE_ORDERED'] = tra('Date Ordered') . ': ' . zen_date_long($this->info['date_purchased']);
             $emailVars['EMAIL_TEXT_STATUS_COMMENTS'] = nl2br($notify_comments);
             if ($statusChanged) {
                 $emailVars['EMAIL_TEXT_STATUS_UPDATED'] = tra('Your order has been updated to the following status') . ': ';
                 $emailVars['EMAIL_TEXT_NEW_STATUS'] = $this->info['orders_status'];
             }
             $emailVars['EMAIL_TEXT_STATUS_PLEASE_REPLY'] = tra('Please reply to this email if you have any questions.');
             $emailVars['order'] = $this;
             zen_mail($this->customer['name'], $this->customer['email_address'], STORE_NAME . ' ' . tra('Order Update') . ' #' . $this->mOrdersId, $textMessage, STORE_NAME, EMAIL_FROM, $emailVars, 'order_status');
             $customer_notified = '1';
             //send extra emails
             if (SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO_STATUS == '1' and SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO != '') {
                 zen_mail('', SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO, SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO_SUBJECT . ' ' . EMAIL_TEXT_SUBJECT . ' #' . $this->mOrdersId, $textMessage, STORE_NAME, EMAIL_FROM, $emailVars, 'order_status_extra');
             }
         }
         $this->mDb->query("insert into " . TABLE_ORDERS_STATUS_HISTORY . "\n\t\t\t\t\t\t(`orders_id`, `orders_status_id`, `date_added`, `customer_notified`, `comments`, `user_id`)\n\t\t\t\t\t\tvalues ( ?, ?, ?, ?, ?, ? )", array($this->mOrdersId, $status, $this->mDb->NOW(), $customer_notified, $comments, $gBitUser->mUserId));
         $this->CompleteTrans();
         $order_updated = true;
     }
     return $order_updated;
 }
Пример #4
0
  </tr>
  <tr>
    <td class="main"><b><?php 
echo ENTRY_ORDER_ID . $oID;
?>
</b></td>
  </tr>
  <tr>
    <td><table border="0" cellspacing="0" cellpadding="2">
      <tr>
        <td class="main"><strong><?php 
echo ENTRY_DATE_PURCHASED;
?>
</strong></td>
        <td class="main"><?php 
echo zen_date_long($order->info['date_purchased']);
?>
</td>
      </tr>
      <tr>
        <td class="main"><b><?php 
echo ENTRY_PAYMENT_METHOD;
?>
</b></td>
        <td class="main"><?php 
echo $order->info['payment_method'];
?>
</td>
      </tr>
    </table></td>
  </tr>
Пример #5
0
function zen_build_html_email_from_template($module = 'default', $block)
{
    // Identify and Read the template file for the type of message being sent
    $template_filename_base = DIR_FS_EMAIL_TEMPLATES . "email_template_";
    if (file_exists($template_filename_base . str_replace(array('_extra', '_admin'), '', $module) . '.html')) {
        $template_filename = $template_filename_base . str_replace(array('_extra', '_admin'), '', $module) . '.html';
    } elseif (file_exists($template_filename_base . 'default' . '.html')) {
        $template_filename = $template_filename_base . 'default' . '.html';
    } else {
        echo 'ERROR: The email template file for ' . $template_filename_base . ' or ' . $template_filename . ' cannot be found.';
        return '';
        // couldn't find template file, so return an empty string for html message.
    }
    if (!($fh = fopen($template_filename, 'rb'))) {
        // note: the 'b' is for compatibility with Windows systems
        echo 'ERROR: The email template file ' . $template_filename_base . ' or ' . $template_filename . ' cannot be opened';
    }
    $file_holder = fread($fh, filesize($template_filename));
    fclose($fh);
    //strip linebreaks and tabs out of the template
    $file_holder = zen_convert_linefeeds(array("\r\n", "\n", "\r", "\t"), '', $file_holder);
    //check for some specifics that need to be included with all messages
    if ($block['EMAIL_STORE_NAME'] == '') {
        $block['EMAIL_STORE_NAME'] = STORE_NAME;
    }
    if ($block['EMAIL_STORE_URL'] == '') {
        $block['EMAIL_STORE_URL'] = '<a href="' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . '">' . STORE_NAME . '</a>';
    }
    if ($block['EMAIL_STORE_OWNER'] == '') {
        $block['EMAIL_STORE_OWNER'] = STORE_OWNER;
    }
    if ($block['EMAIL_FOOTER_COPYRIGHT'] == '') {
        $block['EMAIL_FOOTER_COPYRIGHT'] = EMAIL_FOOTER_COPYRIGHT;
    }
    if ($block['EMAIL_DISCLAIMER'] == '') {
        $block['EMAIL_DISCLAIMER'] = sprintf(EMAIL_DISCLAIMER, '<a href="mailto:' . STORE_OWNER_EMAIL_ADDRESS . '">' . STORE_OWNER_EMAIL_ADDRESS . ' </a>');
    }
    if ($block['EMAIL_SPAM_DISCLAIMER'] == '') {
        $block['EMAIL_SPAM_DISCLAIMER'] = EMAIL_SPAM_DISCLAIMER;
    }
    if ($block['BASE_HREF'] == '') {
        $block['BASE_HREF'] = HTTP_SERVER . DIR_WS_CATALOG;
    }
    if ($block['EMAIL_DATE_SHORT'] == '') {
        $block['EMAIL_DATE_SHORT'] = zen_date_short(date("Y-m-d"));
    }
    if ($block['EMAIL_DATE_LONG'] == '') {
        $block['EMAIL_DATE_LONG'] = zen_date_long(date("Y-m-d"));
    }
    if ($block['EXTRA_INFO'] == 'EXTRA_INFO') {
        $block['EXTRA_INFO'] = '';
    }
    if (substr($module, -6) != '_extra' && $module != 'contact_us') {
        $block['EXTRA_INFO'] = '';
    }
    $block['COUPON_BLOCK'] = '';
    if ($block['COUPON_TEXT_VOUCHER_IS'] && $block['COUPON_TEXT_TO_REDEEM']) {
        $block['COUPON_BLOCK'] = '<div class="coupon-block">' . $block['COUPON_TEXT_VOUCHER_IS'] . $block['COUPON_DESCRIPTION'] . '<br />' . $block['COUPON_TEXT_TO_REDEEM'] . '<span class="coupon-code">' . $block['COUPON_CODE'] . '</span></div>';
    }
    $block['GV_BLOCK'] = '';
    if ($block['GV_WORTH'] && $block['GV_REDEEM'] && $block['GV_CODE_URL']) {
        $block['GV_BLOCK'] = '<div class="gv-block">' . $block['GV_WORTH'] . '<br />' . $block['GV_REDEEM'] . $block['GV_CODE_URL'] . '<br />' . $block['GV_LINK_OTHER'] . '</div>';
    }
    //prepare the "unsubscribe" link:
    if (function_exists(zen_catalog_href_link)) {
        $block['UNSUBSCRIBE_LINK'] = str_replace("\n", '', TEXT_UNSUBSCRIBE) . ' <a href="' . zen_catalog_href_link(FILENAME_UNSUBSCRIBE, "unsubscribe_address=" . $block['EMAIL_TO_ADDRESS']) . '">' . zen_catalog_href_link(FILENAME_UNSUBSCRIBE, "unsubscribe_address=" . $block['EMAIL_TO_ADDRESS']) . '</a>';
    } else {
        $block['UNSUBSCRIBE_LINK'] = str_replace("\n", '', TEXT_UNSUBSCRIBE) . ' <a href="' . zen_href_link(FILENAME_UNSUBSCRIBE, "unsubscribe_address=" . $block['EMAIL_TO_ADDRESS']) . '">' . zen_href_link(FILENAME_UNSUBSCRIBE, "unsubscribe_address=" . $block['EMAIL_TO_ADDRESS']) . '</a>';
    }
    //now replace the $BLOCK_NAME items in the template file with the values passed to this function's array
    foreach ($block as $key => $value) {
        $file_holder = str_replace('$' . $key, $value, $file_holder);
    }
    //DEBUG -- to display preview on-screen
    if (EMAIL_SYSTEM_DEBUG == 'on') {
        echo $file_holder;
    }
    return $file_holder;
}
while (!$customers_orders->EOF) {
    //    echo $customers_orders->fields['orders_id'] . ' ' . $customers_orders->fields['order_total'] . '<br />';
    $current_orders_id = $customers_orders->fields['orders_id'];
    $orders_total_query = "select * from " . TABLE_ORDERS_TOTAL . " where orders_id='" . $current_orders_id . "'";
    $orders_total = $db->Execute($orders_total_query);
    $order = new order($customers_orders->fields['orders_id']);
    ?>
          <tr>
            <td colspan="2"><?php 
    echo zen_draw_separator('pixel_trans.gif', '1', '10');
    ?>
</td>
          </tr>
          <tr>
            <td class="main" align="left"><?php 
    echo zen_date_long($customers_orders->fields['date_purchased']);
    ?>
</td>
            <td class="main" align="left">Order #<?php 
    echo $customers_orders->fields['orders_id'];
    ?>
</td>
            <td class="main" align="left">Discount Coupon ID# <?php 
    echo $customers_orders->fields['coupon_code'];
    ?>
</td>
            <td class="main" align="left"><?php 
    echo '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $customers_orders->fields['orders_id'] . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>';
    ?>
</td>
          </tr>
Пример #7
0
/**
 * select email template based on 'module' (supplied as param to function)
 * selectively go thru each template tag and substitute appropriate text
 * finally, build full html content as "return" output from class
**/
function zen_build_html_email_from_template($module = 'default', $content = '')
{
    global $messageStack, $current_page_base;
    $block = array();
    if (is_array($content)) {
        $block = $content;
    } else {
        $block['EMAIL_MESSAGE_HTML'] = $content;
    }
    // Identify and Read the template file for the type of message being sent
    $langfolder = strtolower($_SESSION['languages_code']) == 'en' ? '' : strtolower($_SESSION['languages_code']) . '/';
    $template_filename_base = DIR_FS_EMAIL_TEMPLATES . $langfolder . "email_template_";
    $template_filename = DIR_FS_EMAIL_TEMPLATES . $langfolder . "email_template_" . $current_page_base . ".html";
    if (!file_exists($template_filename)) {
        if (isset($block['EMAIL_TEMPLATE_FILENAME']) && $block['EMAIL_TEMPLATE_FILENAME'] != '' && file_exists($block['EMAIL_TEMPLATE_FILENAME'] . '.html')) {
            $template_filename = $block['EMAIL_TEMPLATE_FILENAME'] . '.html';
        } elseif (file_exists($template_filename_base . str_replace(array('_extra', '_admin'), '', $module) . '.html')) {
            $template_filename = $template_filename_base . str_replace(array('_extra', '_admin'), '', $module) . '.html';
        } elseif (file_exists($template_filename_base . 'default' . '.html')) {
            $template_filename = $template_filename_base . 'default' . '.html';
        } else {
            $messageStack->add('header', 'ERROR: The email template file for (' . $template_filename_base . ') or (' . $template_filename . ') cannot be found.', 'caution');
            return '';
            // couldn't find template file, so return an empty string for html message.
        }
    }
    if (!($fh = fopen($template_filename, 'rb'))) {
        // note: the 'b' is for compatibility with Windows systems
        $messageStack->add('header', 'ERROR: The email template file (' . $template_filename_base . ') or (' . $template_filename . ') cannot be opened', 'caution');
    }
    $file_holder = fread($fh, filesize($template_filename));
    fclose($fh);
    //strip linebreaks and tabs out of the template
    //  $file_holder = str_replace(array("\r\n", "\n", "\r", "\t"), '', $file_holder);
    $file_holder = str_replace(array("\t"), ' ', $file_holder);
    if (!defined('HTTP_CATALOG_SERVER')) {
        define('HTTP_CATALOG_SERVER', HTTP_SERVER);
    }
    //check for some specifics that need to be included with all messages
    if ($block['EMAIL_STORE_NAME'] == '') {
        $block['EMAIL_STORE_NAME'] = STORE_NAME;
    }
    if ($block['EMAIL_STORE_URL'] == '') {
        $block['EMAIL_STORE_URL'] = '<a href="' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . '">' . STORE_NAME . '</a>';
    }
    if ($block['EMAIL_STORE_OWNER'] == '') {
        $block['EMAIL_STORE_OWNER'] = STORE_OWNER;
    }
    if ($block['EMAIL_FOOTER_COPYRIGHT'] == '') {
        $block['EMAIL_FOOTER_COPYRIGHT'] = EMAIL_FOOTER_COPYRIGHT;
    }
    if ($block['EMAIL_DISCLAIMER'] == '') {
        $block['EMAIL_DISCLAIMER'] = sprintf(EMAIL_DISCLAIMER, '<a href="mailto:' . STORE_OWNER_EMAIL_ADDRESS . '">' . STORE_OWNER_EMAIL_ADDRESS . ' </a>');
    }
    if ($block['EMAIL_SPAM_DISCLAIMER'] == '') {
        $block['EMAIL_SPAM_DISCLAIMER'] = EMAIL_SPAM_DISCLAIMER;
    }
    if ($block['BASE_HREF'] == '') {
        $block['BASE_HREF'] = HTTP_SERVER . DIR_WS_CATALOG;
    }
    if ($block['EMAIL_DATE_SHORT'] == '') {
        $block['EMAIL_DATE_SHORT'] = zen_date_short(date("Y-m-d"));
    }
    if ($block['EMAIL_DATE_LONG'] == '') {
        $block['EMAIL_DATE_LONG'] = zen_date_long(date("Y-m-d"));
    }
    if ($block['CHARSET'] == '') {
        $block['CHARSET'] = CHARSET;
    }
    //  if ($block['EMAIL_STYLESHEET']=='')       $block['EMAIL_STYLESHEET']       = str_replace(array("\r\n", "\n", "\r"), "",@file_get_contents(DIR_FS_EMAIL_TEMPLATES.'stylesheet.css'));
    if (!isset($block['EXTRA_INFO'])) {
        $block['EXTRA_INFO'] = '';
    }
    if (substr($module, -6) != '_extra' && $module != 'contact_us') {
        $block['EXTRA_INFO'] = '';
    }
    $block['COUPON_BLOCK'] = '';
    if ($block['COUPON_TEXT_VOUCHER_IS'] && $block['COUPON_TEXT_TO_REDEEM']) {
        $block['COUPON_BLOCK'] = '<div class="coupon-block">' . $block['COUPON_TEXT_VOUCHER_IS'] . $block['COUPON_DESCRIPTION'] . '<br />' . $block['COUPON_TEXT_TO_REDEEM'] . '<span class="coupon-code">' . $block['COUPON_CODE'] . '</span></div>';
    }
    $block['GV_BLOCK'] = '';
    if ($block['GV_WORTH'] && $block['GV_REDEEM'] && $block['GV_CODE_URL']) {
        $block['GV_BLOCK'] = '<div class="gv-block">' . $block['GV_WORTH'] . '<br />' . $block['GV_REDEEM'] . $block['GV_CODE_URL'] . '<br />' . $block['GV_LINK_OTHER'] . '</div>';
    }
    //prepare the "unsubscribe" link:
    if (IS_ADMIN_FLAG === true) {
        // is this admin version, or catalog?
        $block['UNSUBSCRIBE_LINK'] = str_replace("\n", '', TEXT_UNSUBSCRIBE) . ' <a href="' . zen_catalog_href_link(FILENAME_UNSUBSCRIBE, "addr=" . $block['EMAIL_TO_ADDRESS']) . '">' . zen_catalog_href_link(FILENAME_UNSUBSCRIBE, "addr=" . $block['EMAIL_TO_ADDRESS']) . '</a>';
    } else {
        $block['UNSUBSCRIBE_LINK'] = str_replace("\n", '', TEXT_UNSUBSCRIBE) . ' <a href="' . zen_href_link(FILENAME_UNSUBSCRIBE, "addr=" . $block['EMAIL_TO_ADDRESS']) . '">' . zen_href_link(FILENAME_UNSUBSCRIBE, "addr=" . $block['EMAIL_TO_ADDRESS']) . '</a>';
    }
    //now replace the $BLOCK_NAME items in the template file with the values passed to this function's array
    foreach ($block as $key => $value) {
        $file_holder = str_replace('$' . $key, $value, $file_holder);
    }
    //DEBUG -- to display preview on-screen
    if (EMAIL_SYSTEM_DEBUG == 'preview') {
        echo $file_holder;
    }
    return $file_holder;
}
 if (PRODUCT_ALL_LIST_WEIGHT != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'weight')) {
     $display_products_weight = TEXT_PRODUCTS_WEIGHT . $products_all->fields['products_weight'] . TEXT_SHIPPING_WEIGHT . str_repeat('', substr(PRODUCT_ALL_LIST_WEIGHT, 3, 1));
 } else {
     $display_products_weight = '';
 }
 if (PRODUCT_ALL_LIST_QUANTITY != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'quantity')) {
     if ($products_all->fields['products_quantity'] <= 0) {
         $display_products_quantity = TEXT_OUT_OF_STOCK . str_repeat('', substr(PRODUCT_ALL_LIST_QUANTITY, 3, 1));
     } else {
         $display_products_quantity = TEXT_PRODUCTS_QUANTITY . $products_all->fields['products_quantity'] . str_repeat('', substr(PRODUCT_ALL_LIST_QUANTITY, 3, 1));
     }
 } else {
     $display_products_quantity = '';
 }
 if (PRODUCT_ALL_LIST_DATE_ADDED != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'date_added')) {
     $display_products_date_added = TEXT_DATE_ADDED . ' ' . zen_date_long($products_all->fields['products_date_added']) . str_repeat('', substr(PRODUCT_ALL_LIST_DATE_ADDED, 3, 1));
 } else {
     $display_products_date_added = '';
 }
 if (PRODUCT_ALL_LIST_MANUFACTURER != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'manufacturer')) {
     $display_products_manufacturers_name = $products_all->fields['manufacturers_name'] != '' ? TEXT_MANUFACTURER . ' ' . $products_all->fields['manufacturers_name'] . str_repeat('', substr(PRODUCT_ALL_LIST_MANUFACTURER, 3, 1)) : '';
 } else {
     $display_products_manufacturers_name = '';
 }
 if (PRODUCT_ALL_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($products_all->fields['products_id']) == 'Y' and zen_check_show_prices() == true) {
     $products_price = zen_mb_get_products_display_price($products_all->fields['products_id']);
     $display_products_price = TEXT_PRICE . ' ' . $products_price . str_repeat('', substr(PRODUCT_ALL_LIST_PRICE, 3, 1)) . (zen_get_show_product_switch($products_all->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($products_all->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : '');
 } else {
     $display_products_price = '';
     $products_price = '';
 }
Пример #9
0
                    if (isset($_POST['notify']) && $_POST['notify'] == '1') {
                        $customer_notified = '1';
                    }
                    // Here we check to see if we have clicked on the Hide RadioButton and if so, set the Variable to -1
                    if (isset($_POST['notify']) && $_POST['notify'] == '-1') {
                        // hide comment
                        $customer_notified = '-1';
                    }
                    // OK, we have our Customer Notified Status Number, now update the Order Status History Table
                    update_status($oID, $status, $customer_notified, $comments);
                    //   Send E-Mail to Customer if they should be notified. Send comments if append comments is checked.
                    if ($customer_notified == '1') {
                        if (isset($_POST['notify_comments'])) {
                            $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $_POST[comments]) . "\n\n";
                        }
                        $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' <a href="' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . '">' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "</a>\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
                        $html_msg['EMAIL_MESSAGE_HTML'] = str_replace('
', '<br />', $email);
                        zen_mail($check_status->fields['customers_name'], $check_status->fields['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, $html_msg, NULL);
                    }
                }
                // Update Products
                $RunningSubTotal = 0;
                $RunningTax = 0;
                $update_products = $_POST['update_products'];
                foreach ($update_products as $orders_products_id => $products_details) {
                    $AddedOptionsPrice = 0;
                    $AddedOptionsPrice_OneTime = 0;
                    // Update orders_products Table
                    //UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
                    #$order = zen_db_fetch_array($order_query);
Пример #10
0
function zen_email_templates_replace_keywords(&$db, $email_contents, &$customers_email, $customers_id)
{
    if ((int) $customers_id) {
        $customers_query = $db->Execute("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customers_id . "'");
    } elseif (zen_not_null($customers_email)) {
        $customers_query = $db->Execute("select * from " . TABLE_CUSTOMERS . " where customers_email_address = '" . $customers_email . "'");
    }
    if ($customers_query->RecordCount() > 0 && zen_not_null($email_contents)) {
        $customers = $customers_query->fields;
        $out = $email_contents;
        $out = str_replace('[CUSTOMER_NAME]', stripslashes($customers['customers_firstname'] . ' ' . $customers['customers_lastname']), $out);
        $out = str_replace('[CUSTOMER_EMAIL]', $customers['customers_email_address'], $out);
        $out = str_replace('[CUSTOMER_DOB]', zen_date_long($customers['customers_dob']), $out);
        $out = str_replace('[CUSTOMER_PHONE]', $customers['customers_telephone'], $out);
        $out = str_replace('[CUSTOMER_FAX]', $customers['customers_fax'], $out);
        if (!zen_not_null($customers_email)) {
            $customers_email = $customers['customers_email_address'];
        }
    } else {
        $out = $email_contents;
    }
    return $out;
}
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
// | Do Not Remove: Coded for Zen-Cart by geeks4u.com                     |
// | Dedicated to Memory of Amelita "Emmy" Abordo Gelarderes		  |
// +----------------------------------------------------------------------+
// $Id: tpl_more_news_default.php,v 1.2 2004/08/26
//
$newsId = zen_db_prepare_input((int) $_GET['news_id']);
$languages_id = zen_db_prepare_input((int) $_SESSION['languages_id']);
$news_box_query = $db->Execute("select nc.news_title, nc.news_content, n.news_published_date, n.news_end_date\r\n\t\t\t\t\t\t\t\tfrom " . TABLE_BOX_NEWS_CONTENT . " nc, " . TABLE_BOX_NEWS . " n \r\n\t\t\t\t\t\t\t\twhere nc.box_news_id = " . $newsId . " and n.box_news_id = nc.box_news_id and nc.languages_id = " . $languages_id . " and n.news_status = 1 and now() between n.news_start_date and n.news_end_date");
$newsTitle = nl2br($news_box_query->fields['news_title']);
$newsContent = nl2br($news_box_query->fields['news_content']);
if ($newsContent) {
    $newsInfo = TEXT_NEWS_PUBLISHED_DATE . ' ' . zen_date_long($news_box_query->fields['news_published_date']);
} else {
    $newsInfo = TEXT_NO_NEWS_FOR_LANGUAGE;
}
?>

<div class="centerColumn" id="moreNewsDefault">

<h1 id="moreNewsHeading"><?php 
echo HEADING_TITLE . ' ' . $newsTitle;
?>
</h1>

<div class="newsInfo"><?php 
echo $newsInfo;
?>
Пример #12
0
if ($faqs_new_split->number_of_rows > 0) {
    $faqs_new = $db->Execute($faqs_new_split->sql_query);
    while (!$faqs_new->EOF) {
        $fcPath = zen_get_faq_path($faqs_new->fields['faqs_id']);
        if (FAQ_NEW_LIST_IMAGE != '0') {
            $display_faqs_image = '<a href="' . zen_href_link(zen_get_info_faq_page($faqs_new->fields['faqs_id']), 'fcPath=' . $fcPath . '&faqs_id=' . $faqs_new->fields['faqs_id']) . '">' . zen_image(DIR_WS_IMAGES . $faqs_new->fields['faqs_image'], $faqs_new->fields['faqs_name'], IMAGE_FAQ_NEW_LISTING_WIDTH, IMAGE_FAQ_NEW_LISTING_HEIGHT) . '</a>' . str_repeat('<br clear="all" />', substr(FAQ_NEW_LIST_IMAGE, 3, 1));
        } else {
            $display_faqs_image = '';
        }
        if (FAQ_NEW_LIST_NAME != '0') {
            $display_faqs_name = '<a href="' . zen_href_link(zen_get_info_faq_page($faqs_new->fields['faqs_id']), 'fcPath=' . $fcPath . '&faqs_id=' . $faqs_new->fields['faqs_id']) . '"><strong>' . $faqs_new->fields['faqs_name'] . '</strong></a>' . str_repeat('<br clear="all" />', substr(FAQ_NEW_LIST_NAME, 3, 1));
        } else {
            $display_faqs_name = '';
        }
        if (FAQ_NEW_LIST_DATE_ADDED != '0' and zen_get_show_faq_switch($faqs_new->fields['faqs_id'], 'date_added')) {
            $display_faqs_date_added = TEXT_DATE_ADDED . ' ' . zen_date_long($faqs_new->fields['faqs_date_added']) . str_repeat('<br clear="all" />', substr(FAQ_NEW_LIST_DATE_ADDED, 3, 1));
        } else {
            $display_faqs_date_added = '';
        }
        $link = '<a href="' . zen_href_link(zen_get_info_faq_page($faqs_new->fields['faqs_id']), 'fcPath=' . $fcPath . '&faqs_id=' . $faqs_new->fields['faqs_id']) . '">' . MORE_INFO_TEXT . '</a>';
        $the_button = $link;
        $faqs_link = '<a href="' . zen_href_link(zen_get_info_faq_page($faqs_new->fields['faqs_id']), 'fcPath=' . $fcPath . '&faqs_id=' . $faqs_new->fields['faqs_id']) . '">' . MORE_INFO_TEXT . '</a>';
        if (FAQ_NEW_LIST_DESCRIPTION != '0') {
            $disp_text = zen_get_faqs_description($faqs_new->fields['faqs_id']);
            $disp_text = zen_clean_html($disp_text);
            $display_faqs_description = stripslashes(zen_trunc_string($disp_text, 150, '<a href="' . zen_href_link(zen_get_info_faq_page($faqs_new->fields['faqs_id']), 'fcPath=' . $fcPath . '&faqs_id=' . $faqs_new->fields['faqs_id']) . '"> ' . MORE_INFO_TEXT . '</a>'));
        } else {
            $display_faqs_description = '';
        }
        ?>
          <tr>
function email_latest_status($oID)
{
    require DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . 'order_status_email.php';
    global $db;
    $orders_status_array = array();
    $orders_status = $db->Execute("select orders_status_id, orders_status_name\n                                 from " . TABLE_ORDERS_STATUS . "\n                                 where language_id = '" . (int) $_SESSION['languages_id'] . "'");
    while (!$orders_status->EOF) {
        $orders_status_array[$orders_status->fields['orders_status_id']] = $orders_status->fields['orders_status_name'];
        $orders_status->MoveNext();
    }
    $customer_info = $db->Execute("SELECT customers_name, customers_email_address, date_purchased\n                                 FROM " . TABLE_ORDERS . "\n                                 WHERE orders_id = '" . $oID . "'");
    $status_info = $db->Execute("SELECT orders_status_id, comments\n                               FROM " . TABLE_ORDERS_STATUS_HISTORY . "\n                               WHERE orders_id = '" . $oID . "'\n                               ORDER BY date_added Desc limit 1");
    $status = $status_info->fields['orders_status_id'];
    if (zen_not_null($status_info->fields['comments']) && $status_info->fields['comments'] != '') {
        $notify_comments = EMAIL_TEXT_COMMENTS_UPDATE . $status_info->fields['comments'] . "\n\n";
    }
    // send email to customer
    $message = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n\n" . EMAIL_TEXT_INVOICE_URL . ' ' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($customer_info->fields['date_purchased']) . "\n\n" . strip_tags($notify_comments) . EMAIL_TEXT_STATUS_UPDATED . sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status]) . EMAIL_TEXT_STATUS_PLEASE_REPLY;
    $html_msg['EMAIL_CUSTOMERS_NAME'] = $customer_info->fields['customers_name'];
    $html_msg['EMAIL_TEXT_ORDER_NUMBER'] = EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID;
    $html_msg['EMAIL_TEXT_INVOICE_URL'] = '<a href="' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . '">' . str_replace(':', '', EMAIL_TEXT_INVOICE_URL) . '</a>';
    $html_msg['EMAIL_TEXT_DATE_ORDERED'] = EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($customer_info->fields['date_purchased']);
    $html_msg['EMAIL_TEXT_STATUS_COMMENTS'] = $notify_comments;
    $html_msg['EMAIL_TEXT_STATUS_UPDATED'] = str_replace('\\n', '', EMAIL_TEXT_STATUS_UPDATED);
    $html_msg['EMAIL_TEXT_STATUS_LABEL'] = str_replace('\\n', '', sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status]));
    $html_msg['EMAIL_TEXT_NEW_STATUS'] = $orders_status_array[$status];
    $html_msg['EMAIL_TEXT_STATUS_PLEASE_REPLY'] = str_replace('\\n', '', EMAIL_TEXT_STATUS_PLEASE_REPLY);
    zen_mail($customer_info->fields['customers_name'], $customer_info->fields['customers_email_address'], EMAIL_TEXT_SUBJECT . ' #' . $oID, $message, STORE_NAME, EMAIL_FROM, $html_msg, 'order_status');
    // send extra emails
    if (SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO_STATUS == '1' and SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO != '') {
        zen_mail('', SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO, SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO_SUBJECT . ' ' . EMAIL_TEXT_SUBJECT . ' #' . $oID, $message, STORE_NAME, EMAIL_FROM, $html_msg, 'order_status_extra');
    }
    //_TODO accept an optional array of additional recipients
}
 if (PRODUCT_SPECIALS_WEIGHT != '0' and zen_get_show_product_switch($specials->fields['products_id'], 'weight')) {
     $display_products_weight = TEXT_PRODUCTS_WEIGHT . $specials->fields['products_weight'] . TEXT_SHIPPING_WEIGHT . str_repeat('', substr(PRODUCT_SPECIALS_WEIGHT, 3, 1));
 } else {
     $display_products_weight = '';
 }
 if (PRODUCT_SPECIALS_QUANTITY != '0' and zen_get_show_product_switch($specials->fields['products_id'], 'quantity')) {
     if ($specials->fields['products_quantity'] <= 0) {
         $display_products_quantity = TEXT_OUT_OF_STOCK . str_repeat('', substr(PRODUCT_SPECIALS_QUANTITY, 3, 1));
     } else {
         $display_products_quantity = TEXT_PRODUCTS_QUANTITY . $specials->fields['products_quantity'] . str_repeat('', substr(PRODUCT_SPECIALS_QUANTITY, 3, 1));
     }
 } else {
     $display_products_quantity = '';
 }
 if (PRODUCT_SPECIALS_DATE_ADDED != '0' and zen_get_show_product_switch($specials->fields['products_id'], 'date_added')) {
     $display_products_date_added = TEXT_DATE_ADDED . ' ' . zen_date_long($specials->fields['products_date_added']) . str_repeat('', substr(PRODUCT_SPECIALS_DATE_ADDED, 3, 1));
 } else {
     $display_products_date_added = '';
 }
 if (PRODUCT_SPECIALS_MANUFACTURER != '0' and zen_get_show_product_switch($specials->fields['products_id'], 'manufacturer')) {
     $display_products_manufacturers_name = $specials->fields['manufacturers_name'] != '' ? TEXT_MANUFACTURER . ' ' . $specials->fields['manufacturers_name'] . str_repeat('', substr(PRODUCT_SPECIALS_MANUFACTURER, 3, 1)) : '';
 } else {
     $display_products_manufacturers_name = '';
 }
 if (PRODUCT_SPECIALS_PRICE != '0' and zen_get_products_allow_add_to_cart($specials->fields['products_id']) == 'Y' and zen_check_show_prices() == true) {
     $products_price = zen_mb_get_products_display_price($specials->fields['products_id']);
     $display_products_price = TEXT_PRICE . ' ' . $products_price . str_repeat('', substr(PRODUCT_SPECIALS_PRICE, 3, 1)) . (zen_get_show_product_switch($specials->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($specials->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : '');
 } else {
     $display_products_price = '';
     $products_price = '';
 }
     }
     foreach ($track_id as $id => $track) {
         if (zen_not_null($track) && constant('CARRIER_STATUS_' . $id) == 'True') {
             $notify_comments .= "Your " . constant('CARRIER_NAME_' . $id) . " Tracking ID is " . $track . " \n<br /><a href=" . constant('CARRIER_LINK_' . $id) . $track . ">Click here</a> to track your package. \n<br />If the above link does not work, copy the following URL address and paste it into your Web browser. \n<br />" . constant('CARRIER_LINK_' . $id) . $track . "\n\n<br /><br />It may take up to 24 hours for the tracking information to appear on the website." . "\n<br />";
         }
     }
     unset($id);
     unset($track);
     // END TY TRACKER 32 - EMAIL TRACKING INFORMATION
 }
 //send emails
 $message = STORE_NAME . " " . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n\n" . EMAIL_TEXT_INVOICE_URL . ' ' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']) . "\n\n" . strip_tags($notify_comments) . EMAIL_TEXT_STATUS_UPDATED . sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status]) . EMAIL_TEXT_STATUS_PLEASE_REPLY;
 $html_msg['EMAIL_CUSTOMERS_NAME'] = $check_status->fields['customers_name'];
 $html_msg['EMAIL_TEXT_ORDER_NUMBER'] = EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID;
 $html_msg['EMAIL_TEXT_INVOICE_URL'] = '<a href="' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . '">' . str_replace(':', '', EMAIL_TEXT_INVOICE_URL) . '</a>';
 $html_msg['EMAIL_TEXT_DATE_ORDERED'] = EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']);
 $html_msg['EMAIL_TEXT_STATUS_COMMENTS'] = nl2br($notify_comments);
 $html_msg['EMAIL_TEXT_STATUS_UPDATED'] = str_replace('\\n', '', EMAIL_TEXT_STATUS_UPDATED);
 $html_msg['EMAIL_TEXT_STATUS_LABEL'] = str_replace('\\n', '', sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status]));
 $html_msg['EMAIL_TEXT_NEW_STATUS'] = $orders_status_array[$status];
 $html_msg['EMAIL_TEXT_STATUS_PLEASE_REPLY'] = str_replace('\\n', '', EMAIL_TEXT_STATUS_PLEASE_REPLY);
 $html_msg['EMAIL_PAYPAL_TRANSID'] = '';
 zen_mail($check_status->fields['customers_name'], $check_status->fields['customers_email_address'], EMAIL_TEXT_SUBJECT . ' #' . $oID, $message, STORE_NAME, EMAIL_FROM, $html_msg, 'order_status');
 $customer_notified = '1';
 // PayPal Trans ID, if any
 $sql = "select txn_id, parent_txn_id from " . TABLE_PAYPAL . " where order_id = :orderID order by last_modified DESC, date_added DESC, parent_txn_id DESC, paypal_ipn_id DESC ";
 $sql = $db->bindVars($sql, ':orderID', $oID, 'integer');
 $result = $db->Execute($sql);
 if ($result->RecordCount() > 0) {
     $message .= "\n\n" . ' PayPal Trans ID: ' . $result->fields['txn_id'];
     $html_msg['EMAIL_PAYPAL_TRANSID'] = $result->fields['txn_id'];
Пример #16
0
        // orders note   
        if($nInfo->orders_id > 0)
          $contents[] = array('text' => '<a href="' . FILENAME_ORDERS . '.php' . '?oID=' . $nInfo->orders_id . '&action=edit' . '"><strong>' . TEXT_INFO_NOTE_ORDER . '</strong></a>');
        
        if(zen_not_null($nInfo->categories_id))
          $contents[] = array('text' => '<a href="' . FILENAME_CATEGORIES . '.php' . '?cPath=' . $nInfo->categories_id . '"><strong>' . TEXT_INFO_NOTE_CATEGORY . '</strong></a>');
        
        // products note
        if($nInfo->products_id > 0)
          $contents[] = array('text' => '<a href="' . FILENAME_PRODUCT . '.php' . '?action=new_product&pID=' . $nInfo->products_id . '&product_type=' . zen_get_products_type($nInfo->products_id) . '&cPath=' . zen_get_products_category_id($nInfo->products_id) . '"><strong>' . TEXT_INFO_NOTE_PRODUCT . '</strong></a>');                                
        // eof note links
         
        $contents[] = array('text' => '<br />' . TEXT_INFO_NOTE_TEXT . '<p style="font-weight: bold; ">' . nl2br(stripslashes($nInfo->notes_text)) . '</p>');
        
         $contents[] = array('text' => '<br />' . TEXT_INFO_DATE_CREATED . zen_date_long($nInfo->notes_date_created));
        if (zen_not_null($nInfo->notes_date_modified)) $contents[] = array('text' => TEXT_INFO_NOTE_DATE_MODIFIED . ': ' . zen_date_long($nInfo->notes_date_modified));

      }
        break;
    }

    if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
      echo '            <td width="25%" valign="top">' . "\n";

      $box = new box;
      echo $box->infoBox($heading, $contents);

      echo '            </td>' . "\n";
    }
?>
          </tr>
 function convert_product_result($fields)
 {
     $fields['path_image'] = self::get_product_path_image($fields);
     $fields['name'] = $fields['products_name'];
     $fields['url'] = zen_href_link(zen_get_info_page($fields['products_id']), 'products_id=' . $fields['products_id'] . '&categories_id=' . $this->search_params['categories_id']);
     $fields['description'] = zen_trunc_string(zen_clean_html(stripslashes($fields['products_description']), PRODUCT_LIST_DESCRIPTION));
     $fields['model'] = $fields['products_model'];
     $fields['quantity'] = $fields['products_quantity'];
     $fields['date_added'] = zen_date_long($fields['products_date_added']);
     $fields['price'] = $fields['products_price'];
     #FIXME
     $fields['final_price'] = zen_get_products_display_price($fields['products_id']);
     $fields['cart_button'] = self::get_product_cart_button($fields);
     $categories = self::get_product_categories($fields['products_id']);
     foreach ($categories as $category_id) {
         $fields['categories_path'][] = self::get_categories_path($category_id, self::get_super_products_list_link('results'));
     }
     $fields['always_free_shipping'] = $fields['product_is_always_free_shipping'];
     return $fields;
 }
Пример #18
0
        ?>
</td>
  </tr>
  <tr>
    <td colspan="2" class="pageHeading"><?php 
        echo $reviews->fields['products_name'];
        ?>
</td>
  </tr>
  <tr>
    <td class="smallText"><?php 
        echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews->fields['customers_name']));
        ?>
</td>
    <td class="smallText" align="left"><?php 
        echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_long($reviews->fields['date_added']));
        ?>
</td>
  </tr>
  <tr>
    <td width="<?php 
        echo SMALL_IMAGE_WIDTH + 10;
        ?>
" align="left" valign="top" class="main"><?php 
        echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews->fields['products_id'] . '&reviews_id=' . $reviews->fields['reviews_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($reviews->fields['products_id'], 'avatar'), $reviews->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
        ?>
</td>
    <td valign="top" class="main"><?php 
        echo zen_break_string(nl2br(zen_output_string_protected(stripslashes(substr($reviews->fields['reviews_text'], 0, 100)))), 60, '-<br />') . (strlen($reviews->fields['reviews_text']) >= 100 ? '..' : '') . '<br /><br /><i>' . sprintf(TEXT_REVIEW_RATING, zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $reviews->fields['reviews_rating'] . '.png', sprintf(TEXT_OF_5_STARS, $reviews->fields['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews->fields['reviews_rating'])) . '</i>';
        ?>
</td>
Пример #19
0
 * @package page
 * @copyright Copyright 2010 oasis Team
 * @copyright Portions 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 5403 2010-03-30 13:35:58Z john $
 */
// This should be first line of the script:
$zco_notifier->notify('NOTIFY_HEADER_START_PRINT_ORDER');
// check if custmer is allowed to see this order!
$order_query_check = $db->Execute("SELECT\tcustomers_id\n\t\t\t\t\t\t\t\t\t\tFROM " . TABLE_ORDERS . "\n\t\t\t\t\t\t\t\t\t\tWHERE orders_id='" . (int) $_GET['oID'] . "'");
$oID = (int) $_GET['oID'];
if ($order_query_check->RecordCount() > 0) {
    if ($_SESSION['customer_id'] == $order_query_check->fields['customers_id']) {
        require DIR_WS_MODULES . zen_get_module_directory('require_languages.php');
        // get order data
        require DIR_WS_CLASSES . 'order.php';
        $print_order = new order($oID);
        $address_label_customer = zen_address_format($print_order->customer['format_id'], $print_order->customer, 1, '', '<br />');
        $address_label_shipping = zen_address_format($print_order->delivery['format_id'], $print_order->delivery, 1, '', '<br />');
        $address_label_payment = zen_address_format($print_order->billing['format_id'], $print_order->billing, 1, '', '<br />');
        $csID = $print_order->customer['csID'];
        $language = $_SESSION['language'];
        if ($print_order->info['payment_method'] != '' && $print_order->info['payment_method'] != 'no_payment') {
            include DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $print_order->print_order['payment_method'] . '.php';
            $payment_method = constant(strtoupper('MODULE_PAYMENT_' . $print_order->info['payment_method'] . '_TEXT_TITLE'));
        }
        $comment = $print_order->info['comments'];
        $date = zen_date_long($print_order->info['date_purchased']);
    }
}
Пример #20
0
      }
?>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
<?php
      if ($pInfo->products_date_available > date('Y-m-d')) {
?>
      <tr>
        <td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_AVAILABLE, zen_date_long($pInfo->products_date_available)); ?></td>
      </tr>
<?php
      } else {
?>
      <tr>
        <td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_ADDED, zen_date_long($pInfo->products_date_added)); ?></td>
      </tr>
<?php
      }
?>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
<?php
    }

    if (isset($_GET['read']) && ($_GET['read'] == 'only')) {
      if (isset($_GET['origin'])) {
        $pos_params = strpos($_GET['origin'], '?', 0);
        if ($pos_params != false) {
          $back_url = substr($_GET['origin'], 0, $pos_params);
        echo TEXT_ORDER_NUMBER . $history['orders_id'];
        ?>
</legend>
      <div>
      </div>
      <div>
        <div class="col-sm-7" >
          <span class='visible-xs'><strong><?php 
        echo TEXT_ORDER_STATUS;
        ?>
</strong><span class='text-info'><?php 
        echo $history['orders_status_name'];
        ?>
</span></span>
          <?php 
        echo '<strong>' . TEXT_ORDER_DATE . '</strong> ' . zen_date_long($history['date_purchased']) . '<br /><strong>' . $history['order_type'] . '</strong> ' . zen_output_string_protected($history['order_name']);
        ?>
          <br />
          <?php 
        echo '<strong>' . TEXT_ORDER_PRODUCTS . '</strong> ' . $history['product_count'] . '<br /><strong>' . TEXT_ORDER_COST . '</strong> ' . strip_tags($history['order_total']);
        ?>
        </div>
        <div class="col-sm-5 text-center">
          <span class='hidden-xs'><strong><?php 
        echo TEXT_ORDER_STATUS;
        ?>
</strong><span class='text-info'><?php 
        echo $history['orders_status_name'];
        ?>
</span></span>
          <br />
Пример #22
0
      </tr>
<?php 
    if ($pInfo->products_date_available > date('Y-m-d')) {
        ?>
      <tr>
        <td align="center" class="smallText"><?php 
        echo sprintf(TEXT_PRODUCT_DATE_AVAILABLE, zen_date_long($pInfo->products_date_available));
        ?>
</td>
      </tr>
<?php 
    } else {
        ?>
      <tr>
        <td align="center" class="smallText"><?php 
        echo sprintf(TEXT_PRODUCT_DATE_ADDED, zen_date_long($pInfo->products_date_added));
        ?>
</td>
      </tr>
<?php 
    }
    ?>
      <tr>
        <td><?php 
    echo zen_draw_separator('pixel_trans.gif', '1', '10');
    ?>
</td>
      </tr>
<?php 
}
if (isset($_GET['read']) && $_GET['read'] == 'only') {
function draw_packing_slip_order($order, &$pdf)
{
    global $db;
    require_once DIR_WS_CLASSES . 'currencies.php';
    $currencies = new currencies();
    // prepare order-status pulldown list
    $orders_statuses = array();
    $orders_status_array = array();
    $orders_status = $db->Execute("select orders_status_id, orders_status_name\n                from " . TABLE_ORDERS_STATUS . "\n                where language_id = '" . (int) $_SESSION['languages_id'] . "'");
    while (!$orders_status->EOF) {
        $orders_statuses[] = array('id' => $orders_status->fields['orders_status_id'], 'text' => $orders_status->fields['orders_status_name'] . ' [' . $orders_status->fields['orders_status_id'] . ']');
        $orders_status_array[$orders_status->fields['orders_status_id']] = $orders_status->fields['orders_status_name'];
        $orders_status->MoveNext();
    }
    /* display order information header */
    $pdf->SetFont('Arial', 'B', 6);
    /* order object doesn't include orderid.  added id to info so we can retrieve it here */
    $pdf->Cell(120, 14, ENTRY_ORDER_ID . $order->info['id']);
    $pdf->Cell(236, 14, ENTRY_DATE_PURCHASED . ' ' . zen_date_long($order->info['date_purchased']));
    $pdf->MultiCell(220, 14, ENTRY_PAYMENT_METHOD . ' ' . $order->info['payment_method']);
    $pdf->SetFont('Arial', '', 10);
    if (TAX_ID_NUMBER != '') {
        $pdf->SetFillColor(180, 180, 180);
        $pdf->Cell(30, 14, TABLE_HEADING_QTY, 1, 0, '', 1);
        $pdf->Cell(160, 14, TABLE_HEADING_PRODUCTS, 1, 0, '', 1);
        $pdf->Cell(160, 14, TABLE_HEADING_PRODUCTS_MODEL, 1, 0, '', 1);
        $pdf->Cell(60, 14, TABLE_HEADING_TAX, 1, 0, '', 1);
        $pdf->Cell(78, 14, TABLE_HEADING_PRICE_NO_TAX, 1, 0, 'R', 1);
        $pdf->MultiCell(78, 14, TABLE_HEADING_TOTAL_NO_TAX, 1, 'R', 1);
    } else {
        $pdf->SetFillColor(180, 180, 180);
        $pdf->Cell(25, 14, TABLE_HEADING_QTY, 1, 0, '', 1);
        $pdf->Cell(120, 14, TABLE_HEADING_PRODUCTS, 1, 0, '', 1);
        $pdf->Cell(120, 14, TABLE_HEADING_PRODUCTS_MODEL, 1, 0, '', 1);
        $pdf->Cell(40, 14, TABLE_HEADING_TAX, 1, 0, 'R', 1);
        $pdf->Cell(68, 14, TABLE_HEADING_PRICE_EXCLUDING_TAX, 1, 0, 'R', 1);
        $pdf->Cell(68, 14, TABLE_HEADING_PRICE_INCLUDING_TAX, 1, 0, 'R', 1);
        $pdf->Cell(68, 14, TABLE_HEADING_TOTAL_EXCLUDING_TAX, 1, 0, 'R', 1);
        $pdf->MultiCell(68, 14, TABLE_HEADING_TOTAL_INCLUDING_TAX, 1, 'R', 1);
    }
    $pdf->SetFillColor(256, 256, 256);
    if (TAX_ID_NUMBER != '') {
        /* draw order items in table when tax ID number is NOT null*/
        for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
            /* BEGIN update (Loose Chicken Software Development, david@loosechicken.com 01-03-2011) */
            /* break attributes onto new lines */
            $prod_name = $order->products[$i]['name'];
            $prod_attrs = array();
            if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
                for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
                    $prod_attrs[] = $order->products[$i]['attributes'][$j]['option'] . ': ' . zen_output_string_protected($order->products[$i]['attributes'][$j]['value']);
                }
            }
            /* BEGIN add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* Find height of model and Product names */
            $h_model = $pdf->MultiCellHeight(160, 14, $order->products[$i]['model'], 'LRT', 'L', 1);
            $h = $h_model;
            $h_product_name = $pdf->MultiCellHeight(160, 14, $prod_name, 'LRT', 'L', 1);
            $h = $h_product_name > $h ? $h_product_name : $h;
            /* If cells would be too tall, force a page break */
            if ($pdf->y + $h > $pdf->PageBreakTrigger) {
                $pdf->AddPage();
            }
            /* Get current y, to use with $h_product_name later when placing attributes */
            $y_top = $pdf->getY();
            /* END add (Loose Chicken Software Development 01-07-2011) */
            $pdf->Cell(30, 14, $order->products[$i]['qty'], 'LRT', 0, '', 1);
            /* BEGIN update (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* 
             * Changed Cell to MultiCell for the test wrapping. 
             * Because MultiCell doesn't leave the cursor in the right place:
             * Retrived cursor before drawing cell, and placed it afterward base on origal location and cell width 
             */
            $y = $pdf->getY();
            $x = $pdf->getX();
            $pdf->MultiCell(160, 14, $prod_name, 'LRT', 'L', 1);
            $max_y = $pdf->getY();
            $pdf->setXY($x + 160, $y);
            $y = $pdf->getY();
            $x = $pdf->getX();
            $pdf->MultiCell(160, 14, $order->products[$i]['model'], 'LRT', 'L', 1);
            $max_y = $pdf->getY() > $max_y ? $pdf->getY() : $max_y;
            $pdf->setXY($x + 160, $y);
            /* END update (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            $pdf->Cell(60, 14, ENTRY_NO_TAX, 'LRT', 0, '', 1);
            $pdf->Cell(78, 14, $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']), 'LRT', 0, 'R', 1);
            $pdf->MultiCell(78, 14, $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']), 'LRT', 'R', 1);
            /* BEGIN add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* 
             * Draw cell borders in case model or product name wrapped and thus would leave blank
             * spaces on the other cells. (This must be transparent so the cells are not overritten)
             */
            $x = $pdf->GetX();
            $y = $pdf->GetY();
            if ($max_y > $y) {
                $h = $max_y - $y;
                $pdf->Cell(30, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(160, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(160, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(60, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(78, $h, '', 'LR', 0, '', 0);
                $pdf->MultiCell(78, $h, '', 'LR', 'J', 0);
                $pdf->setXY($x, $y);
            }
            $max_y_page = $pdf->PageNo();
            /* Place attributes below product_name */
            $pdf->setXY($x, $y_top + $h_product_name);
            /* END add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            $pdf->SetFont('Arial', '', 8);
            $pdf->SetTextColor(40, 40, 40);
            foreach ($prod_attrs as $prod_attr) {
                $pdf->Cell(30, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(160, 10, '  - ' . $prod_attr, 'LR', 0, '', 1);
                $pdf->Cell(160, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(60, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(78, 10, '', 'LR', 0, '', 1);
                $pdf->MultiCell(78, 10, '', 'LR', 'J', 1);
            }
            $x = $pdf->GetX();
            $y = $pdf->GetY();
            /* BEGIN add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* 
             * If after drawing the attributes the cursor is not as low as after drawing 
             * the model and product name lower the cursor for the drawing of the bottom line 
             */
            if ($max_y > $y && $max_y_page == $pdf->PageNo()) {
                $y = $max_y;
            }
            /* END add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            $pdf->Line($x, $y, $x + 30 + 160 + 160 + 60 + 78 + 78, $y);
            $pdf->SetTextColor(0, 0, 0);
            $pdf->SetFont('Arial', '', 10);
            /* END modification (Loose Chicken Software Development 01-03-2011) */
        }
    } else {
        /* draw order items in table  when tax ID number IS null*/
        for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
            /* BEGIN update (Loose Chicken Software Development, david@loosechicken.com 01-03-2011) */
            /* break attributes onto new lines */
            $prod_name = $order->products[$i]['name'];
            $prod_attrs = array();
            if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
                for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
                    $prod_attrs[] = $order->products[$i]['attributes'][$j]['option'] . ': ' . zen_output_string_protected($order->products[$i]['attributes'][$j]['value']);
                }
            }
            /* BEGIN add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* Find height of model and Product names */
            $h_model = $pdf->MultiCellHeight(120, 14, $order->products[$i]['model'], 'LRT', 'L', 1);
            $h = $h_model;
            $h_product_name = $pdf->MultiCellHeight(120, 14, $prod_name, 'LRT', 'L', 1);
            $h = $h_product_name > $h ? $h_product_name : $h;
            /* If cells would be too tall, force a page break */
            if ($pdf->y + $h > $pdf->PageBreakTrigger) {
                $pdf->AddPage();
            }
            /* Get current y, to use with $h_product_name later when placing attributes */
            $y_top = $pdf->getY();
            /* END add (Loose Chicken Software Development 01-07-2011) */
            $pdf->Cell(25, 14, $order->products[$i]['qty'], 'LRT', 0, '', 1);
            /* BEGIN update (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* 
             * Changed Cell to MultiCell for the test wrapping. 
             * Because MultiCell doesn't leave the cursor in the right place:
             * Retrived cursor before drawing cell, and placed it afterward base on origal location and cell width 
             */
            $y = $pdf->getY();
            $x = $pdf->getX();
            $pdf->MultiCell(120, 14, $prod_name, 'LRT', 'L', 1);
            $max_y = $pdf->getY();
            $pdf->setXY($x + 120, $y);
            $y = $pdf->getY();
            $x = $pdf->getX();
            $pdf->MultiCell(120, 14, $order->products[$i]['model'], 'LRT', 'L', 1);
            $max_y = $pdf->getY() > $max_y ? $pdf->getY() : $max_y;
            $pdf->setXY($x + 120, $y);
            /* END update (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /*$pdf->Cell(40, 14, zen_display_tax_value($order->products[$i]['tax']) . '%', 'LRT', 0, 'R', 1);     
                      
            	     $pdf->Cell(68, 14, $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']), 'LRT', 0, 'R', 1);     
                      
            	   
            	    $pdf->Cell(68, 14, $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']), 'LRT', 0, 'R', 1);
            		
            		
            		
                       $pdf->Cell(68, 14, $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']), 'LRT', 0, 'R', 1); 
            		
            		
            		    
                       $pdf->MultiCell(68, 14, $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']), 'LRT', 'R', 1);
                                */
            $pdf->Cell(40, 14, html_entity_decode(zen_display_tax_value($order->products[$i]['tax']) . '%', ENT_QUOTES, "ISO-8859-15"), 'LRT', 0, 'R', 1);
            if ($order->info['currency'] == 'EUR') {
                $f1 = str_replace('&euro;', '€', $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']));
                $pdf->Cell(68, 14, html_entity_decode($f1), 'LRT', 'R', 1);
            } else {
                $pdf->Cell(68, 14, html_entity_decode($currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']), ENT_QUOTES, "ISO-8859-15"), 'LRT', 0, 'R', 1);
            }
            if ($order->info['currency'] == 'EUR') {
                $f2 = str_replace('&euro;', '€', $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']));
                $pdf->Cell(68, 14, html_entity_decode($f2), 'LRT', 'R', 1);
            } else {
                $pdf->Cell(68, 14, html_entity_decode($currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']), ENT_QUOTES, "ISO-8859-15"), 'LRT', 0, 'R', 1);
            }
            if ($order->info['currency'] == 'EUR') {
                $f3 = str_replace('&euro;', '€', $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']));
                $pdf->Cell(68, 14, html_entity_decode($f3), 'LRT', 'R', 1);
            } else {
                $pdf->Cell(68, 14, html_entity_decode($currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']), ENT_QUOTES, "ISO-8859-15"), 'LRT', 0, 'R', 1);
            }
            if ($order->info['currency'] == 'EUR') {
                $f = str_replace('&euro;', '€', $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']));
                $pdf->MultiCell(68, 14, html_entity_decode($f), 'LRT', 'R', 1);
            } else {
                $pdf->MultiCell(68, 14, html_entity_decode($currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']), ENT_QUOTES, "ISO-8859-15"), 'LRT', 'R', 1);
            }
            /* BEGIN add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* 
             * Draw cell borders in case model or product name wrapped and thus would leave blank
             * spaces on the other cells. (This must be transparent so the cells are not overritten)
             */
            $x = $pdf->GetX();
            $y = $pdf->GetY();
            if ($max_y > $y) {
                $h = $max_y - $y;
                $pdf->Cell(25, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(120, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(120, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(40, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(68, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(68, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(68, $h, '', 'LR', 0, '', 0);
                $pdf->MultiCell(68, $h, '', 'LR', 'J', 0);
                $pdf->setXY($x, $y);
            }
            $max_y_page = $pdf->PageNo();
            /* Place attributes below product_name */
            $pdf->setXY($x, $y_top + $h_product_name);
            /* END add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            $pdf->SetFont('Arial', '', 8);
            $pdf->SetTextColor(40, 40, 40);
            foreach ($prod_attrs as $prod_attr) {
                $pdf->Cell(25, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(120, 10, '  - ' . $prod_attr, 'LR', 0, '', 1);
                $pdf->Cell(120, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(40, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(68, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(68, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(68, 10, '', 'LR', 0, '', 1);
                $pdf->MultiCell(68, 10, '', 'LR', 'J', 1);
            }
            $x = $pdf->GetX();
            $y = $pdf->GetY();
            /* BEGIN add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* 
             * If after drawing the attributes the cursor is not as low as after drawing 
             * the model and product name lower the cursor for the drawing of the bottom line 
             */
            if ($max_y > $y && $max_y_page == $pdf->PageNo()) {
                $y = $max_y;
            }
            /* END add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            $pdf->Line($x, $y, $x + 25 + 120 + 120 + 40 + 68 + 68 + 68 + 68, $y);
            $pdf->SetTextColor(0, 0, 0);
            $pdf->SetFont('Arial', '', 10);
            /* END modification (Loose Chicken Software Development 01-03-2011) */
        }
    }
    /* order cost summary */
    $pdf->Ln();
    for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
        $title = strip_tags($order->totals[$i]['title']);
        $text = strip_tags($order->totals[$i]['text']);
        /* $pdf->Cell(516, 14, $title, 0, 0, 'R');             
           $pdf->MultiCell(50, 14, $text, 0, 'R'); */
        $pdf->Cell(516, 14, html_entity_decode($title, ENT_QUOTES, "ISO-8859-15"), 0, 0, 'R');
        //echo substr($text,0,5);
        if (substr($text, 0, 5) == '&euro') {
            $a = str_replace('&euro;', '€', $text);
            $pdf->MultiCell(50, 14, html_entity_decode($a, ENT_QUOTES, "ISO-8859-15"), 0, 0, 'R');
        } else {
            $pdf->MultiCell(50, 14, html_entity_decode($text, ENT_QUOTES, "ISO-8859-15"), 0, 0, 'R');
        }
    }
    /* order balance */
    /*$orders_balance = $db->Execute("select orders_id , balance_due
    				from " . TABLE_ORDERS . "
    					where orders_id = '" . zen_db_input($order->info['id']) . "'
    					order by orders_id");
    		$balance_due = $orders_balance->fields['balance_due'];*/
    $pdf->SetFont('Arial', 'B', '');
    require_once DIR_WS_CLASSES . 'super_order.php';
    $so = new super_order($order->info['id']);
    $pdf->Cell(516, 14, 'Amount Paid: ', 0, 0, 'R');
    // $pdf->MultiCell(50, 14, $currencies->format($so->amount_applied), 0, 'R');
    //  $pdf->MultiCell(50, 14, $currencies->format($balance_due), 0, 'R');
    // $pdf->MultiCell(50, 14, $currencies->format($so->balance_due), 0, 'R');
    $var1 = substr($currencies->format($so->amount_applied), 0, 5);
    if ($var1 == '&euro') {
        $pdf->MultiCell(50, 14, '€' . $so->amount_applied, 0, 'R');
    } else {
        $pdf->MultiCell(50, 14, html_entity_decode($currencies->format($so->amount_applied), ENT_QUOTES, "ISO-8859-15"), 0, 'R');
    }
    $pdf->Cell(516, 14, 'Balance Due:', 0, 0, 'R');
    $var = substr($currencies->format($so->balance_due), 0, 5);
    if ($var == '&euro') {
        $pdf->MultiCell(50, 14, '€' . $so->balance_due, 0, 'R');
    } else {
        $pdf->MultiCell(50, 14, html_entity_decode($currencies->format($so->balance_due), ENT_QUOTES, "ISO-8859-15"), 0, 'R');
    }
    //$pdf->SetFont('Arial','', 7);
    if (ORDER_COMMENTS_PACKING_SLIP > 0) {
        $pdf->Ln();
        $pdf->SetFillColor(180, 180, 180);
        $pdf->SetFont('Arial', 'B', 10);
        $pdf->MultiCell(576, 14, 'Order Comments & Status', 'B');
        $pdf->SetFont('Arial', '', 7);
        $pdf->SetFillColor(256, 256, 256);
        $orders_history = $db->Execute("select orders_status_id, date_added, customer_notified, comments\n                    from " . TABLE_ORDERS_STATUS_HISTORY . "\n                    where orders_id = '" . zen_db_input($order->info['id']) . "' and customer_notified >= 0\n                    order by date_added");
        $count_comments = 0;
        if ($orders_history->RecordCount() >= 1 && ORDER_COMMENTS_PACKING_SLIP == 1) {
            while (!$orders_history->EOF) {
                if ($orders_history->fields['comments'] != '' && strpos($orders_history->fields['comments'], 'PayPal status:') === false) {
                    $count_comments++;
                    $pdf->Cell(120, 14, zen_datetime_short($orders_history->fields['date_added']));
                    $pdf->MultiCell(456, 14, $orders_status_array[$orders_history->fields['orders_status_id']]);
                    $pdf->Cell(27, 14, '', 0, 0, '', 1);
                    /* BEGIN modify (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
                    /* removed function zen_db_output, which was converting output into html code */
                    //$pdf->MultiCell(549, 14, (zen_db_output($orders_history->fields['comments'])), 'B');
                    $pdf->MultiCell(549, 14, $orders_history->fields['comments'], 'B');
                    /* END modify (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
                    $pdf->SetLineWidth(0.5);
                    $pdf->Line(18, $pdf->GetY(), 594, $pdf->GetY());
                }
                $orders_history->MoveNext();
                /*if (ORDER_COMMENTS_PACKING_SLIP == 1 && $count_comments >= 1) {
                     break;
                  } */
            }
        }
        if ($count_comments == 0) {
            $pdf->MultiCell(576, 14, TEXT_NO_ORDER_HISTORY, 'B');
        }
    }
}
 if (PRODUCT_FEATURED_LIST_WEIGHT != '0' and zen_get_show_product_switch($featured_products->fields['products_id'], 'weight')) {
     $display_products_weight = TEXT_PRODUCTS_WEIGHT . $featured_products->fields['products_weight'] . TEXT_SHIPPING_WEIGHT . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_WEIGHT, 3, 1));
 } else {
     $display_products_weight = '';
 }
 if (PRODUCT_FEATURED_LIST_QUANTITY != '0' and zen_get_show_product_switch($featured_products->fields['products_id'], 'quantity')) {
     if ($featured_products->fields['products_quantity'] <= 0) {
         $display_products_quantity = TEXT_OUT_OF_STOCK . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_QUANTITY, 3, 1));
     } else {
         $display_products_quantity = TEXT_PRODUCTS_QUANTITY . $featured_products->fields['products_quantity'] . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_QUANTITY, 3, 1));
     }
 } else {
     $display_products_quantity = '';
 }
 if (PRODUCT_FEATURED_LIST_DATE_ADDED != '0' and zen_get_show_product_switch($featured_products->fields['products_id'], 'date_added')) {
     $display_products_date_added = TEXT_DATE_ADDED . ' ' . zen_date_long($featured_products->fields['products_date_added']) . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_DATE_ADDED, 3, 1));
 } else {
     $display_products_date_added = '';
 }
 if (PRODUCT_FEATURED_LIST_MANUFACTURER != '0' and zen_get_show_product_switch($featured_products->fields['products_id'], 'manufacturer')) {
     $display_products_manufacturers_name = $featured_products->fields['manufacturers_name'] != '' ? TEXT_MANUFACTURER . ' ' . $featured_products->fields['manufacturers_name'] . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_MANUFACTURER, 3, 1)) : '';
 } else {
     $display_products_manufacturers_name = '';
 }
 if (PRODUCT_FEATURED_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($featured_products->fields['products_id']) == 'Y' and zen_check_show_prices() == true) {
     $products_price = zen_get_products_display_price($featured_products->fields['products_id']);
     $display_products_price = TEXT_PRICE . ' ' . $products_price . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_PRICE, 3, 1)) . (zen_get_show_product_switch($featured_products->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($featured_products->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : '');
 } else {
     $display_products_price = '';
 }
 // more info in place of buy now
 * Page Template
 *
 * Loaded automatically by index.php?main_page=account_edit.<br />
 * Displays information related to a single specific order
 *
 * @package templateSystem
 * @copyright Copyright 2003-2011 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_account_history_info_default.php 19103 2011-07-13 18:10:46Z wilt $
 */
?>
<div class="centerColumn" id="accountHistInfo">

<div class="forward"><?php 
echo HEADING_ORDER_DATE . ' ' . zen_date_long($order->info['date_purchased']);
?>
</div>
<br class="clearBoth" />

<table border="0" width="100%" cellspacing="0" cellpadding="0" summary="Itemized listing of previous order, includes number ordered, items and prices">
<caption><h2 id="orderHistoryDetailedOrder"><?php 
echo HEADING_TITLE . ORDER_HEADING_DIVIDER . sprintf(HEADING_ORDER_NUMBER, $_GET['order_id']);
?>
</h2></caption>
    <tr class="tableHeading">
	  	<!--JT mod - Product Image-->
        <th scope="col" id="myAccountQuantity"> </th>
		<!--JT mod - Product Image-->     
        <th scope="col" id="myAccountQuantity"><?php 
echo HEADING_QUANTITY;
Пример #26
0
            <td class="main" align="left"><?php echo HEADER_PO_TERMS; ?></td>
            <td class="main" align="right"><?php echo HEADER_PO_TERMS_LENGTH; ?></td>
          </tr>
        </table></td>
<?php } ?>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
    <td><table border="0" cellpadding="2" cellspacing="0">
      <tr>
        <td class="main"><strong><?php echo ENTRY_DATE_PURCHASED; ?></strong></td>
        <td class="main"><?php echo zen_date_long($order->info['date_purchased']); ?></td>
      </tr>
      <tr>
        <td class="main"><strong><?php echo ENTRY_PAYMENT_METHOD; ?></strong></td>
        <td class="main"><?php echo $order->info['payment_method']; ?></td>
      </tr>
      <tr>
        <td class="main" colspan="2"><strong> </strong></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
    <td><table border="0" cellpadding="2" cellspacing="0" width="100%">
 if (PRODUCT_NEW_LIST_WEIGHT != '0' and zen_get_show_product_switch($products_new->fields['products_id'], 'weight')) {
     $display_products_weight = '<br />' . TEXT_PRODUCTS_WEIGHT . $products_new->fields['products_weight'] . TEXT_SHIPPING_WEIGHT . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_WEIGHT, 3, 1));
 } else {
     $display_products_weight = '';
 }
 if (PRODUCT_NEW_LIST_QUANTITY != '0' and zen_get_show_product_switch($products_new->fields['products_id'], 'quantity')) {
     if ($products_new->fields['products_quantity'] <= 0) {
         $display_products_quantity = TEXT_OUT_OF_STOCK . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_QUANTITY, 3, 1));
     } else {
         $display_products_quantity = TEXT_PRODUCTS_QUANTITY . $products_new->fields['products_quantity'] . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_QUANTITY, 3, 1));
     }
 } else {
     $display_products_quantity = '';
 }
 if (PRODUCT_NEW_LIST_DATE_ADDED != '0' and zen_get_show_product_switch($products_new->fields['products_id'], 'date_added')) {
     $display_products_date_added = TEXT_DATE_ADDED . ' ' . zen_date_long($products_new->fields['products_date_added']) . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_DATE_ADDED, 3, 1));
 } else {
     $display_products_date_added = '';
 }
 if (PRODUCT_NEW_LIST_MANUFACTURER != '0' and zen_get_show_product_switch($products_new->fields['products_id'], 'manufacturer')) {
     $display_products_manufacturers_name = $products_new->fields['manufacturers_name'] != '' ? TEXT_MANUFACTURER . ' ' . $products_new->fields['manufacturers_name'] . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_MANUFACTURER, 3, 1)) : '';
 } else {
     $display_products_manufacturers_name = '';
 }
 if (PRODUCT_NEW_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($products_new->fields['products_id']) == 'Y' and zen_check_show_prices() == true) {
     $products_price = zen_get_products_display_price($products_new->fields['products_id']);
     $display_products_price = TEXT_PRICE . ' ' . $products_price . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_PRICE, 3, 1)) . (zen_get_show_product_switch($products_new->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($products_new->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : '');
 } else {
     $display_products_price = '';
 }
 // more info in place of buy now
 if (PRODUCT_ALL_LIST_WEIGHT != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'weight')) {
     $display_products_weight = TEXT_PRODUCTS_WEIGHT . $products_all->fields['products_weight'] . TEXT_SHIPPING_WEIGHT . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_WEIGHT, 3, 1));
 } else {
     $display_products_weight = '';
 }
 if (PRODUCT_ALL_LIST_QUANTITY != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'quantity')) {
     if ($products_all->fields['products_quantity'] <= 0) {
         $display_products_quantity = TEXT_OUT_OF_STOCK . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_QUANTITY, 3, 1));
     } else {
         $display_products_quantity = TEXT_PRODUCTS_QUANTITY . $products_all->fields['products_quantity'] . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_QUANTITY, 3, 1));
     }
 } else {
     $display_products_quantity = '';
 }
 if (PRODUCT_ALL_LIST_DATE_ADDED != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'date_added')) {
     $display_products_date_added = '<span class="service-text">' . TEXT_DATE_ADDED . ' ' . zen_date_long($products_all->fields['products_date_added']) . '</span>' . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_DATE_ADDED, 3, 1));
 } else {
     $display_products_date_added = '';
 }
 if (PRODUCT_ALL_LIST_MANUFACTURER != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'manufacturer')) {
     $display_products_manufacturers_name = $products_all->fields['manufacturers_name'] != '' ? TEXT_MANUFACTURER . ' ' . $products_all->fields['manufacturers_name'] . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_MANUFACTURER, 3, 1)) : '';
 } else {
     $display_products_manufacturers_name = '';
 }
 if (PRODUCT_ALL_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($products_all->fields['products_id']) == 'Y' and zen_check_show_prices() == true) {
     $products_price = zen_get_products_display_price($products_all->fields['products_id']);
     $display_products_price = '<span class="table-price">' . $products_price . '</span>' . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_PRICE, 3, 1)) . (zen_get_show_product_switch($products_all->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($products_all->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : '');
 } else {
     $display_products_price = '';
 }
 // more info in place of buy now
 <!--bof Product date added/available-->
<?php 
if ($products_date_available > date('Y-m-d H:i:s')) {
    if ($flag_show_product_info_date_available == 1) {
        ?>
  <p id="productDateAvailable" class="docProduct centeredContent"><?php 
        echo sprintf(TEXT_DATE_AVAILABLE, zen_date_long($products_date_available));
        ?>
</p>
<?php 
    }
} else {
    if ($flag_show_product_info_date_added == 1) {
        ?>
      <p id="productDateAdded" class="docProduct centeredContent"><?php 
        echo sprintf(TEXT_DATE_ADDED, zen_date_long($products_date_added));
        ?>
</p>
<?php 
    }
    // $flag_show_product_info_date_added
}
?>
<!--eof Product date added/available -->

<!--bof Product URL -->
<?php 
if (zen_not_null($products_url)) {
    if ($flag_show_product_info_url == 1) {
        ?>
    <p id="productInfoLink" class="docProduct centeredContent"><?php 
Пример #30
0
$group_id = zen_get_configuration_key_value('FAQ_LISTS_GROUP_ID');
if ($featured_faqs_split->number_of_rows > 0) {
    $featured_faqs = $db->Execute($featured_faqs_split->sql_query);
    while (!$featured_faqs->EOF) {
        if (FAQ_FEATURED_LIST_IMAGE != '0') {
            $display_faqs_image = '<a href="' . zen_href_link(zen_get_info_faq_page($featured_faqs->fields['faqs_id']), 'faqs_id=' . $featured_faqs->fields['faqs_id']) . '">' . zen_image(DIR_WS_IMAGES . $featured_faqs->fields['faqs_image'], $featured_faqs->fields['faqs_name'], IMAGE_FEATURED_FAQS_LISTING_WIDTH, IMAGE_FEATURED_FAQS_LISTING_HEIGHT) . '</a>' . str_repeat('<br clear="all" />', substr(FAQ_FEATURED_LIST_IMAGE, 3, 1));
        } else {
            $display_faqs_image = '';
        }
        if (FAQ_FEATURED_LIST_NAME != '0') {
            $display_faqs_name = '<a href="' . zen_href_link(zen_get_info_faq_page($featured_faqs->fields['faqs_id']), 'faqs_id=' . $featured_faqs->fields['faqs_id']) . '"><strong>' . $featured_faqs->fields['faqs_name'] . '</strong></a>' . str_repeat('<br clear="all" />', substr(FAQ_FEATURED_LIST_NAME, 3, 1));
        } else {
            $display_faqs_name = '';
        }
        if (FAQ_FEATURED_LIST_DATE_ADDED != '0' and zen_get_show_faq_switch($featured_faqs->fields['faqs_id'], 'date_added')) {
            $display_faqs_date_added = TEXT_DATE_ADDED . ' ' . zen_date_long($featured_faqs->fields['faqs_date_added']) . str_repeat('<br clear="all" />', substr(FAQ_FEATURED_LIST_DATE_ADDED, 3, 1));
        } else {
            $display_faqs_date_added = '';
        }
        $link = '<a href="' . zen_href_link(zen_get_info_faq_page($featured_faqs->fields['faqs_id']), 'faqs_id=' . $featured_faqs->fields['faqs_id']) . '">' . MORE_INFO_TEXT . '</a>';
        $the_button = $link;
        $faqs_link = '<a href="' . zen_href_link(zen_get_info_faq_page($featured_faqs->fields['faqs_id']), 'faqs_id=' . $featured_faqs->fields['faqs_id']) . '">' . MORE_INFO_TEXT . '</a>';
        if (FAQ_FEATURED_LIST_DESCRIPTION != '0') {
            $disp_text = zen_get_faqs_description($featured_faqs->fields['faqs_id']);
            $disp_text = zen_clean_html($disp_text);
            $display_faqs_description = stripslashes(zen_trunc_string($disp_text, 150, '<a href="' . zen_href_link(zen_get_info_faq_page($featured_faqs->fields['faqs_id']), 'faqs_id=' . $featured_faqs->fields['faqs_id']) . '"> ' . MORE_INFO_TEXT . '</a>'));
        } else {
            $display_faqs_description = '';
        }
        ?>
          <tr>