function zen_customer_greeting_for_smartphone()
{
    if (isset($_SESSION['customer_id']) && $_SESSION['customer_first_name']) {
        $greeting_string = sprintf(TEXT_GREETING_FOR_SMARTPHONE_PERSONAL, zen_href_link(FILENAME_ACCOUNT), zen_output_string_protected($_SESSION['customer_first_name']), zen_href_link(FILENAME_LOGOFF));
    } else {
        $greeting_string = sprintf(TEXT_GREETING_FOR_SMARTPHONE_GUEST, zen_href_link(FILENAME_LOGIN, '', 'SSL'), zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
    }
    return $greeting_string;
}
Example #2
0
function un_get_fullname($firstname = '', $lastname = '', $default = '')
{
    if (zen_not_null($firstname) && zen_not_null($lastname)) {
        $name = $firstname . " " . $lastname;
    } elseif (zen_not_null($firstname)) {
        $name = $firstname;
    } elseif (zen_not_null($lastname)) {
        $name = $lastname;
    } else {
        $name = $default;
    }
    return zen_output_string_protected($name);
}
function zen_draw_pull_down_menu_SBAmod($name, $values, $default = '', $parameters = '', $required = false, $disable = null, $options_menu_images = null)
{
    global $template_dir;
    $tmp_attribID = trim($name, 'id[]');
    //used to get the select ID reference to be used in jquery
    $field = '<script type="text/javascript">
	  			$(function(){
					$("#attrib-' . $tmp_attribID . '").on("click", function(){
						$("#SBA_ProductImage").attr("src", $(this).find(":selected").attr("data-src"));
					});
				});
			</script>';
    $field .= '<select name="' . zen_output_string($name) . '" onclick=""';
    if (zen_not_null($parameters)) {
        $field .= ' ' . $parameters;
    }
    $field .= '>' . "\n";
    if (empty($default) && isset($GLOBALS[$name]) && is_string($GLOBALS[$name])) {
        $default = stripslashes($GLOBALS[$name]);
    }
    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
        $field .= '  <option value="' . zen_output_string($values[$i]['id']) . '"';
        if ($default == $values[$i]['id']) {
            $field .= ' selected="selected"';
        }
        //"Stock by Attributes" // Need to determine this being disabled by a
        // numerical method rather than a text possessing method.  If PWA_OUTOF_STOCK is not present then the item may not be disabled... :/
        if ($disable && strpos($values[$i]['text'], trim(PWA_OUT_OF_STOCK))) {
            $field .= $disable;
        }
        //add image link if available
        if (!empty($options_menu_images[$i]['src'])) {
            $field .= ' data-src="' . $options_menu_images[$i]['src'] . '"';
        }
        //close tag and display text
        //      $field .= '>' . zen_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>' . "\n";
        $field .= '>' . zen_output_string_protected($values[$i]['text']) . '</option>' . "\n";
    }
    $field .= '</select>' . "\n";
    if ($required == true) {
        $field .= TEXT_FIELD_REQUIRED;
    }
    return $field;
}
Example #4
0
echo TABLE_HEADING_TOTAL_INCLUDING_TAX;
?>
</td>
      </tr>
<?php 
$decimals = $currencies->get_decimal_places($order->info['currency']);
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
    if (DISPLAY_PRICE_WITH_TAX_ADMIN == 'true') {
        $priceIncTax = $currencies->format(zen_round(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), $decimals) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']);
    } else {
        $priceIncTax = $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']);
    }
    echo '      <tr class="dataTableRow">' . "\n" . '        <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" . '        <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];
    if (isset($order->products[$i]['attributes']) && ($k = sizeof($order->products[$i]['attributes'])) > 0) {
        for ($j = 0; $j < $k; $j++) {
            echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
            if ($order->products[$i]['attributes'][$j]['price'] != '0') {
                echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
            }
            if ($order->products[$i]['attributes'][$j]['product_attribute_is_free'] == '1' and $order->products[$i]['product_is_free'] == '1') {
                echo TEXT_INFO_ATTRIBUTE_FREE;
            }
            echo '</i></small></nobr>';
        }
    }
    echo '        </td>' . "\n" . '        <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n";
    echo '        <td class="dataTableContent" align="right" valign="top">' . zen_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" . '        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . ($order->products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->format($order->products[$i]['onetime_charges'], true, $order->info['currency'], $order->info['currency_value']) : '') . '</b></td>' . "\n" . '        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . ($order->products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->format(zen_add_tax($order->products[$i]['onetime_charges'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) : '') . '</b></td>' . "\n" . '        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(zen_round($order->products[$i]['final_price'], $decimals) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ($order->products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->format($order->products[$i]['onetime_charges'], true, $order->info['currency'], $order->info['currency_value']) : '') . '</b></td>' . "\n" . '        <td class="dataTableContent" align="right" valign="top"><b>' . $priceIncTax . ($order->products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->format(zen_add_tax($order->products[$i]['onetime_charges'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) : '') . '</b></td>' . "\n";
    echo '      </tr>' . "\n";
}
?>
      <tr>
Example #5
0
     $exporter_output .= "  <row>\n";
     $exporter_output .= "    <access_date>" . $result->fields['access_date'] . "</access_date>\n";
     $exporter_output .= "    <admin_id>" . $result->fields['admin_id'] . "</admin_id>\n";
     $exporter_output .= "    <admin_name>" . htmlspecialchars($result->fields['admin_name'], ENT_COMPAT, CHARSET, TRUE) . "</admin_name>\n";
     $exporter_output .= "    <ip_address>" . $result->fields['ip_address'] . "</ip_address>\n";
     $exporter_output .= "    <page_accessed>" . $result->fields['page_accessed'] . "</page_accessed>\n";
     $exporter_output .= "    <page_parameters>" . htmlspecialchars($result->fields['page_parameters'], ENT_COMPAT, CHARSET, TRUE) . "</page_parameters>\n";
     $exporter_output .= "    <flagged>" . htmlspecialchars($result->fields['flagged'], ENT_COMPAT, CHARSET, TRUE) . "</flagged>\n";
     $exporter_output .= "    <attention>" . htmlspecialchars($result->fields['attention'], ENT_COMPAT, CHARSET, TRUE) . "</attention>\n";
     $exporter_output .= "    <postdata>" . $postoutput . "</postdata>\n";
     $exporter_output .= "  </row>\n";
 } else {
     // output non-XML data-format
     $postoutput = print_r(json_decode(@gzinflate($result->fields['gzpost'])), true);
     if ($format == 'HTML') {
         $postoutput = nl2br(zen_output_string_protected($postoutput));
     } else {
         $postoutput = nl2br($postoutput);
     }
     $exporter_output .= $LINESTART;
     $exporter_output .= $FIELDSTART . $result->fields['access_date'] . $FIELDEND;
     $exporter_output .= $FIELDSEPARATOR;
     $exporter_output .= $FIELDSTART . $result->fields['admin_id'] . ' ' . $result->fields['admin_name'] . $FIELDEND;
     $exporter_output .= $FIELDSEPARATOR;
     $exporter_output .= $FIELDSTART . $result->fields['ip_address'] . $FIELDEND;
     $exporter_output .= $FIELDSEPARATOR;
     $exporter_output .= $FIELDSTART . $result->fields['page_accessed'] . $FIELDEND;
     $exporter_output .= $FIELDSEPARATOR;
     $exporter_output .= $FIELDSTART . $result->fields['page_parameters'] . $FIELDEND;
     $exporter_output .= $FIELDSEPARATOR;
     $exporter_output .= $FIELDSTART . $result->fields['flagged'] . $FIELDEND;
 /**
  * Method to handle cart Action - multiple add products
  *
  * @param string forward destination
  * @param url parameters
  * @todo change while loop to a foreach
  */
 function actionMultipleAddProduct($goto, $parameters)
 {
     global $messageStack;
     if ($this->display_debug_messages) {
         $messageStack->add_session('header', 'FUNCTION ' . __FUNCTION__, 'caution');
     }
     $addCount = 0;
     if (is_array($_POST['products_id']) && sizeof($_POST['products_id']) > 0) {
         //echo '<pre>'; echo var_dump($_POST['products_id']); echo '</pre>';
         while (list($key, $val) = each($_POST['products_id'])) {
             $prodId = preg_replace('/[^0-9a-f:.]/', '', $key);
             if (is_numeric($val) && $val > 0) {
                 $adjust_max = false;
                 $qty = $val;
                 $add_max = zen_get_products_quantity_order_max($prodId);
                 $cart_qty = $this->in_cart_mixed($prodId);
                 $new_qty = $this->adjust_quantity($qty, $prodId, 'shopping_cart');
                 // bof: adjust new quantity to be same as current in stock
                 $chk_current_qty = zen_get_products_stock($prodId);
                 if (STOCK_ALLOW_CHECKOUT == 'false' && $new_qty > $chk_current_qty) {
                     $new_qty = $chk_current_qty;
                     $messageStack->add_session('shopping_cart', ($this->display_debug_messages ? 'FUNCTION ' . __FUNCTION__ . ': ' : '') . WARNING_PRODUCT_QUANTITY_ADJUSTED . zen_get_products_name($prodId), 'caution');
                 }
                 // eof: adjust new quantity to be same as current in stock
                 if ($add_max == 1 and $cart_qty == 1) {
                     // do not add
                     $adjust_max = 'true';
                 } else {
                     // bof: adjust new quantity to be same as current in stock
                     if (STOCK_ALLOW_CHECKOUT == 'false' && $new_qty + $cart_qty > $chk_current_qty) {
                         $adjust_new_qty = 'true';
                         $alter_qty = $chk_current_qty - $cart_qty;
                         $new_qty = $alter_qty > 0 ? $alter_qty : 0;
                         $messageStack->add_session('shopping_cart', ($this->display_debug_messages ? 'FUNCTION ' . __FUNCTION__ . ': ' : '') . WARNING_PRODUCT_QUANTITY_ADJUSTED . zen_get_products_name($prodId), 'caution');
                     }
                     // eof: adjust new quantity to be same as current in stock
                     // adjust quantity if needed
                     if ($new_qty + $cart_qty > $add_max and $add_max != 0) {
                         $adjust_max = 'true';
                         $new_qty = $add_max - $cart_qty;
                     }
                     $this->add_cart($prodId, $this->get_quantity($prodId) + $new_qty);
                     $addCount++;
                 }
                 if ($adjust_max == 'true') {
                     if ($this->display_debug_messages) {
                         $messageStack->add_session('header', 'FUNCTION ' . __FUNCTION__ . '<br>' . ERROR_MAXIMUM_QTY . zen_get_products_name($prodId), 'caution');
                     }
                     $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . zen_get_products_name($prodId), 'caution');
                 }
             }
             if (!is_numeric($val) || $val < 0) {
                 // adjust quantity when not a value
                 $chk_link = '<a href="' . zen_href_link(zen_get_info_page($prodId), 'cPath=' . zen_get_generated_category_path_rev(zen_get_products_category_id($prodId)) . '&products_id=' . $prodId) . '">' . zen_get_products_name($prodId) . '</a>';
                 $messageStack->add_session('header', ERROR_CORRECTIONS_HEADING . ERROR_PRODUCT_QUANTITY_UNITS_SHOPPING_CART . $chk_link . ' ' . PRODUCTS_ORDER_QTY_TEXT . zen_output_string_protected($val), 'caution');
                 $val = 0;
             }
         }
         // display message if all is good and not on shopping_cart page
         if ($addCount && DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART && $messageStack->size('shopping_cart') == 0) {
             $messageStack->add_session('header', ($this->display_debug_messages ? 'FUNCTION ' . __FUNCTION__ . ': ' : '') . SUCCESS_ADDED_TO_CART_PRODUCTS, 'success');
         } else {
             if (DISPLAY_CART == 'false') {
                 zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
             }
         }
         zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
     }
 }
Example #7
0
}
echo $orders_contents;
?>
  </div>
</div>
<div id="coltwo">
<div class="reportBox">
<div class="header"><?php 
echo BOX_ENTRY_NEW_CUSTOMERS;
?>
 </div>
  <?php 
$customers = $db->Execute("select c.customers_id as customers_id, c.customers_firstname as customers_firstname, c.customers_lastname as customers_lastname, a.customers_info_date_account_created as customers_info_date_account_created, a.customers_info_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_CUSTOMERS_INFO . " a on c.customers_id = a.customers_info_id order by a.customers_info_date_account_created DESC limit 5");
while (!$customers->EOF) {
    $customers->fields['customers_firstname'] = zen_output_string_protected($customers->fields['customers_firstname']);
    $customers->fields['customers_lastname'] = zen_output_string_protected($customers->fields['customers_lastname']);
    echo '              <div class="row"><span class="left"><a href="' . zen_href_link(FILENAME_CUSTOMERS, 'search=' . $customers->fields['customers_lastname'] . '&origin=' . FILENAME_DEFAULT, 'NONSSL') . '" class="contentlink">' . $customers->fields['customers_firstname'] . ' ' . $customers->fields['customers_lastname'] . '</a></span><span class="rigth">' . "\n";
    echo zen_date_short($customers->fields['customers_info_date_account_created']);
    echo '              </span></div>' . "\n";
    $customers->MoveNext();
}
?>
</div>

 <div class="reportBox">
<?php 
$counter_query = "select startdate, counter, session_counter from " . TABLE_COUNTER_HISTORY . " order by startdate DESC limit 10";
$counter = $db->Execute($counter_query);
?>
   <div class="header"><?php 
echo sprintf(LAST_10_DAYS, $counter->RecordCount());
        }
        $email_body .= sprintf(EMAIL_TEXT_LINK, zen_href_link(zen_get_info_page($_GET['products_id']), 'products_id=' . $_GET['products_id']), '', false) . "\n\n" . sprintf(EMAIL_TEXT_SIGNATURE, STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
        $html_msg['EMAIL_TEXT_HEADER'] = EMAIL_TEXT_HEADER;
        $html_msg['EMAIL_PRODUCT_LINK'] = sprintf(str_replace('\\n\\n', '<br />', EMAIL_TEXT_LINK), '<a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id']) . '">' . $product_info->fields['products_name'] . '</a>', '', false);
        $html_msg['EMAIL_TEXT_SIGNATURE'] = sprintf(str_replace('\\n', '', EMAIL_TEXT_SIGNATURE), '');
        // include disclaimer
        $email_body .= "\n\n" . EMAIL_ADVISORY . "\n\n";
        //send the email
        zen_mail($to_name, $to_email_address, $email_subject, $email_body, $from_name, $from_email_address, $html_msg, 'tell_a_friend');
        // send additional emails
        if (SEND_EXTRA_TELL_A_FRIEND_EMAILS_TO_STATUS == '1' and SEND_EXTRA_TELL_A_FRIEND_EMAILS_TO != '') {
            if ($_SESSION['customer_id']) {
                $account_query = "SELECT customers_firstname, customers_lastname, customers_email_address\n                          FROM " . TABLE_CUSTOMERS . "\n                          WHERE customers_id = :customersID";
                $account_query = $db->bindVars($account_query, ':customersID', $_SESSION['customer_id'], 'integer');
                $account = $db->Execute($account_query);
            }
            $extra_info = email_collect_extra_info($from_name, $from_email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address']);
            $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
            zen_mail('', SEND_EXTRA_TELL_A_FRIEND_EMAILS_TO, SEND_EXTRA_TELL_A_FRIEND_EMAILS_TO_SUBJECT . ' ' . $email_subject, $email_body . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'tell_a_friend_extra');
        }
        $messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info->fields['products_name'], zen_output_string_protected($to_name)), 'success');
        zen_redirect(zen_href_link(zen_get_info_page($_GET['products_id']), 'products_id=' . $_GET['products_id']));
    }
} elseif ($_SESSION['customer_id']) {
    $account_query = "SELECT customers_firstname, customers_lastname, customers_email_address\n                    FROM " . TABLE_CUSTOMERS . "\n                    WHERE customers_id = :customersID";
    $account_query = $db->bindVars($account_query, ':customersID', $_SESSION['customer_id'], 'integer');
    $account = $db->Execute($account_query);
    $from_name = $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'];
    $from_email_address = $account->fields['customers_email_address'];
}
$breadcrumb->add(NAVBAR_TITLE);
 function _draw_js_stock_array($combinations)
 {
     if (!(isset($combinations) && is_array($combinations) && sizeof($combinations) > 0)) {
         return '{}';
     }
     $out = '';
     foreach ($combinations[0]['comb'] as $oid => $ovid) {
         $out .= '{' . zen_output_string_protected($ovid) . ':';
         $opts[] = $oid;
     }
     $out .= '1';
     for ($combindex = 1; $combindex < sizeof($combinations); $combindex++) {
         $comb = $combinations[$combindex]['comb'];
         for ($i = 0; $i < sizeof($opts) - 1; $i++) {
             if ($comb[$opts[$i]] != $combinations[$combindex - 1]['comb'][$opts[$i]]) {
                 break;
             }
         }
         $out .= str_repeat('}', sizeof($opts) - 1 - $i) . ',';
         if ($i < sizeof($opts) - 1) {
             for ($j = $i; $j < sizeof($opts) - 1; $j++) {
                 $out .= zen_output_string_protected($comb[$opts[$j]]) . ':{';
             }
         }
         $out .= zen_output_string_protected($comb[$opts[sizeof($opts) - 1]]) . ':1';
     }
     $out .= str_repeat('}', sizeof($opts));
     return $out;
 }
                    echo zen_image(DIR_WS_ICONS . 'tick.gif', TEXT_YES) . "</td>\n";
                } else {
                    if ($orders_history_query->fields['customer_notified'] == '-1') {
                        echo zen_image(DIR_WS_ICONS . 'locked.gif', TEXT_HIDDEN) . "</td>\n";
                    } else {
                        echo zen_image(DIR_WS_ICONS . 'unlocked.gif', TEXT_VISIBLE) . "</td>\n";
                    }
                }
                echo '            <td class="smallText" valign="top">' . $orders_status_array[$orders_history_query->fields['orders_status_id']] . '</td>' . "\n";
                // TY TRACKER 5 BEGIN, DEFINE TRACKING INFORMATION ON SUPER_ORDERS.PHP FILE ----------------
                $display_track_id = '&nbsp;';
                $display_track_id .= empty($orders_history_query->fields['track_id1']) ? '' : CARRIER_NAME_1 . ": <a href=" . CARRIER_LINK_1 . nl2br(zen_output_string_protected($orders_history_query->fields['track_id1'])) . ' target="_blank">' . nl2br(zen_output_string_protected($orders_history_query->fields['track_id1'])) . "</a>&nbsp;";
                $display_track_id .= empty($orders_history_query->fields['track_id2']) ? '' : CARRIER_NAME_2 . ": <a href=" . CARRIER_LINK_2 . nl2br(zen_output_string_protected($orders_history_query->fields['track_id2'])) . ' target="_blank">' . nl2br(zen_output_string_protected($orders_history_query->fields['track_id2'])) . "</a>&nbsp;";
                $display_track_id .= empty($orders_history_query->fields['track_id3']) ? '' : CARRIER_NAME_3 . ": <a href=" . CARRIER_LINK_3 . nl2br(zen_output_string_protected($orders_history_query->fields['track_id3'])) . ' target="_blank">' . nl2br(zen_output_string_protected($orders_history_query->fields['track_id3'])) . "</a>&nbsp;";
                $display_track_id .= empty($orders_history_query->fields['track_id4']) ? '' : CARRIER_NAME_4 . ": <a href=" . CARRIER_LINK_4 . nl2br(zen_output_string_protected($orders_history_query->fields['track_id4'])) . ' target="_blank">' . nl2br(zen_output_string_protected($orders_history_query->fields['track_id4'])) . "</a>&nbsp;";
                $display_track_id .= empty($orders_history_query->fields['track_id5']) ? '' : CARRIER_NAME_5 . ": <a href=" . CARRIER_LINK_5 . nl2br(zen_output_string_protected($orders_history_query->fields['track_id5'])) . ' target="_blank">' . nl2br(zen_output_string_protected($orders_history_query->fields['track_id5'])) . "</a>&nbsp;";
                echo '            <td class="smallText">' . $display_track_id . '</td>' . "\n";
                // END TY TRACKER 5 -------------------------------------------------------------------
                echo '            <td class="smallText" valign="top">' . nl2br(zen_db_scrub_out($orders_history_query->fields['comments'])) . '&nbsp;</td>' . "\n" . '          </tr>' . "\n";
                $orders_history_query->MoveNext();
                $current_status = $orders_status_array[$orders_history_query->fields['orders_status_id']];
            }
        } else {
            echo '          <tr>' . "\n" . '            <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" . '          </tr>' . "\n";
        }
    } else {
        ?>

          <tr class="dataTableHeadingRow">
            <td class="smallText dataTableHeadingContent" width="20%"><strong><?php 
        echo TABLE_HEADING_DATE_ADDED;
Example #11
0
<?php

/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2010 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_reviews_random.php 16044 2010-04-23 01:15:45Z drbyte $
 */
$content = "";
$review_box_counter = 0;
while (!$random_review_sidebox_product->EOF) {
    $review_box_counter++;
    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
    $content .= '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_review_sidebox_product->fields['products_id'] . '&reviews_id=' . $random_review_sidebox_product->fields['reviews_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_review_sidebox_product->fields['products_image'], $random_review_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . zen_trunc_string(nl2br(zen_output_string_protected(stripslashes($random_review_sidebox_product->fields['reviews_text']))), 60) . '</a><br /><br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $random_review_sidebox_product->fields['reviews_rating'] . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_review_sidebox_product->fields['reviews_rating']));
    $content .= '</div>';
    $random_review_sidebox_product->MoveNextRandom();
}
                 $contents[] = array('align' => 'center', 'text' => $goto_gv);
             }
         }
         // indicate if comments exist
         $orders_history_query = $db->Execute("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . $oInfo->orders_id . "' and comments !='" . "'");
         if ($orders_history_query->RecordCount() > 0) {
             $contents[] = array('align' => 'left', 'text' => '<br />' . TABLE_HEADING_COMMENTS);
         }
         $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif', '', '100%', '3'));
         $order = new order($oInfo->orders_id);
         $contents[] = array('text' => 'Products Ordered: ' . sizeof($order->products));
         for ($i = 0; $i < sizeof($order->products); $i++) {
             $contents[] = array('text' => $order->products[$i]['qty'] . '&nbsp;x&nbsp;' . $order->products[$i]['name']);
             if (sizeof($order->products[$i]['attributes']) > 0) {
                 for ($j = 0; $j < sizeof($order->products[$i]['attributes']); $j++) {
                     $contents[] = array('text' => '&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value'])) . '</i></nobr>');
                 }
             }
             if ($i > MAX_DISPLAY_RESULTS_ORDERS_DETAILS_LISTING and MAX_DISPLAY_RESULTS_ORDERS_DETAILS_LISTING != 0) {
                 $contents[] = array('align' => 'left', 'text' => TEXT_MORE);
                 break;
             }
         }
         if (sizeof($order->products) > 0) {
             $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
         }
         break;
 }
 if (zen_not_null($heading) && zen_not_null($contents)) {
     echo '            <td width="25%" valign="top">' . "\n";
     $box = new box();
Example #13
0
function zen_address_format($address_format_id, $address, $html, $boln, $eoln)
{
    global $db;
    $address_format = $db->Execute("select address_format as format\n                             from " . TABLE_ADDRESS_FORMAT . "\n                             where address_format_id = '" . (int) $address_format_id . "'");
    $company = zen_output_string_protected($address['company']);
    if (isset($address['firstname']) && zen_not_null($address['firstname'])) {
        $firstname = zen_output_string_protected($address['firstname']);
        $lastname = zen_output_string_protected($address['lastname']);
    } elseif (isset($address['name']) && zen_not_null($address['name'])) {
        $firstname = zen_output_string_protected($address['name']);
        $lastname = '';
    } else {
        $firstname = '';
        $lastname = '';
    }
    $street = zen_output_string_protected($address['street_address']);
    $suburb = zen_output_string_protected($address['suburb']);
    $city = zen_output_string_protected($address['city']);
    $state = zen_output_string_protected($address['state']);
    $telephone = zen_output_string_protected($address['telephone']);
    $fax = zen_output_string_protected($address['fax']);
    if (isset($address['country_id']) && zen_not_null($address['country_id'])) {
        $country = zen_get_country_name($address['country_id']);
        if (isset($address['zone_id']) && zen_not_null($address['zone_id'])) {
            $state = zen_get_zone_code($address['country_id'], $address['zone_id'], $state);
        }
    } elseif (isset($address['country']) && zen_not_null($address['country'])) {
        $country = zen_output_string_protected($address['country']);
    } else {
        $country = '';
    }
    $postcode = zen_output_string_protected($address['postcode']);
    $zip = $postcode;
    if ($html) {
        // HTML Mode
        $HR = '<hr>';
        $hr = '<hr>';
        if ($boln == '' && $eoln == "\n") {
            // Values not specified, use rational defaults
            $CR = '<br>';
            $cr = '<br>';
            $eoln = $cr;
        } else {
            // Use values supplied
            $CR = $eoln . $boln;
            $cr = $CR;
        }
    } else {
        // Text Mode
        $CR = $eoln;
        $cr = $CR;
        $HR = '----------------------------------------';
        $hr = '----------------------------------------';
    }
    $statecomma = '';
    $streets = $street;
    $state = zen_convert_to_zone_name_m17n($state) . ' ';
    if ($suburb != '') {
        $streets = $street . $cr . $suburb;
    }
    if ($country == '') {
        $country = zen_output_string_protected($address['country']);
    }
    if ($state != '') {
        $statecomma = $state . ', ';
    }
    if ($telephone != '') {
        $telephone = ENTRY_TELEPHONE_NUMBER . $telephone;
    }
    if ($fax != '') {
        $fax = ENTRY_FAX_NUMBER . $fax;
    }
    $fmt = $address_format->fields['format'];
    eval("\$address = \"{$fmt}\";");
    if (ACCOUNT_COMPANY == 'true' && zen_not_null($company)) {
        $address = $company . $cr . $address;
    }
    return $address;
}
Example #14
0
 /**
  * Method to handle cart Action - update product
  *
  * @param string forward destination
  * @param url parameters
  */
 public function actionUpdateProduct($goto, $parameters)
 {
     $products_id = $this->getRequest()->request->get('products_id');
     for ($i = 0, $n = sizeof($products_id); $i < $n; $i++) {
         $adjust_max = 'false';
         if ($_POST['cart_quantity'][$i] == '') {
             $_POST['cart_quantity'][$i] = 0;
         }
         if (!is_numeric($_POST['cart_quantity'][$i]) || $_POST['cart_quantity'][$i] < 0) {
             $this->getMessageStack()->add_session('header', ERROR_CORRECTIONS_HEADING . ERROR_PRODUCT_QUANTITY_UNITS_SHOPPING_CART . zen_get_products_name($products_id[$i]) . ' ' . PRODUCTS_ORDER_QTY_TEXT . zen_output_string_protected($_POST['cart_quantity'][$i]), 'error');
             continue;
         }
         if (in_array($products_id[$i], isset($_POST['cart_delete']) && is_array($_POST['cart_delete']) ? $_POST['cart_delete'] : array()) or $_POST['cart_quantity'][$i] == 0) {
             $this->remove($products_id[$i]);
         } else {
             $add_max = zen_get_products_quantity_order_max($products_id[$i]);
             // maximum allowed
             $cart_qty = $this->in_cart_mixed($products_id[$i]);
             // total currently in cart
             $new_qty = $_POST['cart_quantity'][$i];
             // new quantity
             $current_qty = $this->get_quantity($products_id[$i]);
             // how many currently in cart for attribute
             $chk_mixed = zen_get_products_quantity_mixed($products_id[$i]);
             // use mixed
             $new_qty = $this->adjust_quantity($new_qty, $products_id[$i], 'shopping_cart');
             if (($add_max == 1 and $cart_qty == 1) && $new_qty != $cart_qty) {
                 // do not add
                 $adjust_max = 'true';
             } else {
                 if ($add_max != 0) {
                     // adjust quantity if needed
                     switch (true) {
                         case $new_qty == $current_qty:
                             // no change
                             $adjust_max = 'false';
                             $new_qty = $current_qty;
                             break;
                         case $new_qty > $add_max && $chk_mixed == false:
                             $adjust_max = 'true';
                             $new_qty = $add_max;
                             break;
                         case $add_max - $cart_qty + $new_qty >= $add_max && $new_qty > $add_max && $chk_mixed == true:
                             $adjust_max = 'true';
                             $requested_qty = $new_qty;
                             $new_qty = $current_qty;
                             break;
                         case $cart_qty + $new_qty - $current_qty > $add_max && $chk_mixed == true:
                             $adjust_max = 'true';
                             $requested_qty = $new_qty;
                             $new_qty = $current_qty;
                             break;
                         default:
                             $adjust_max = 'false';
                     }
                 }
                 // adjust minimum and units
                 $attributes = '';
                 if (isset($_POST['id'][$products_id[$i]])) {
                     $attributes = $_POST['id'][$products_id[$i]];
                 }
                 $this->add_cart($products_id[$i], $new_qty, $attributes, false);
             }
             if ($adjust_max == 'true') {
                 $this->getMessageStack()->add_session('shopping_cart', ERROR_MAXIMUM_QTY . zen_get_products_name($products_id[$i]), 'caution');
             } else {
                 // display message if all is good and not on shopping_cart page
                 if (DISPLAY_CART == 'false' && $this->getMainPage() != 'shopping_cart') {
                     $this->getMessageStack()->add_session('header', SUCCESS_ADDED_TO_CART_PRODUCT, 'success');
                 }
             }
         }
     }
     zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
 }
Example #15
0
    ?>
</td>
                    <td align="right"><?php 
    echo '<a href="' . zen_href_link(FILENAME_MAIL, 'cID=' . zen_db_prepare_input($_GET['cID']) . (isset($_GET['customer']) ? '&customer=' . zen_output_string_protected($_GET['customer']) : '') . (isset($_GET['origin']) ? '&origin=' . zen_output_string_protected($_GET['origin']) : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a> ' . zen_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL);
    ?>
</td>
                  </tr>
                </table></td>
              </tr>
              </table></td>
            </form></tr>
<?php 
} else {
    ?>
            <tr><?php 
    echo zen_draw_form('mail', FILENAME_MAIL, 'action=preview' . (isset($_GET['cID']) ? '&cID=' . (int) $_GET['cID'] : '') . (isset($_GET['customer']) ? '&customer=' . zen_output_string_protected($_GET['customer']) : '') . (isset($_GET['origin']) ? '&origin=' . zen_output_string_protected($_GET['origin']) : ''), 'post', 'onsubmit="return check_form(mail);" enctype="multipart/form-data"');
    ?>
              <td><table border="0" cellpadding="0" cellspacing="2">
            <tr>
              <td colspan="2"><?php 
    echo zen_draw_separator('pixel_trans.gif', '1', '10');
    ?>
</td>
            </tr>
<?php 
    $customers = get_audiences_list('email', '', isset($_GET['customer']) ? $_GET['customer'] : '');
    ?>
            <tr>
              <td class="main"><?php 
    echo TEXT_CUSTOMER;
    ?>
        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 />
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');
        }
    }
}
Example #18
0
        ?>
    </td>
  </tr>
  <tr>
    <td class="main"><span class="greetUser"><?php 
        echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews->fields['customers_name']));
        ?>
<span></td>
    <td class="smallText" align="right"><?php 
        echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($reviews->fields['date_added']));
        ?>
</td>
  </tr>
  <tr>
    <td valign="top" class="main" colspan="2"><?php 
        echo zen_break_string(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>
  </tr>
<?php 
        $reviews->MoveNext();
    }
} else {
    ?>
  <tr>
    <td align="left" class="smallText" colspan="2">
      <?php 
    echo '<a href="' . zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params()) . '">' . TEXT_PRODUCT_INFO . '</a>';
    ?>
    </td>
  </tr>
</th>
       </tr>
<?php 
    foreach ($statusArray as $statuses) {
        ?>
    <tr>
        <td><?php 
        echo zen_date_short($statuses['date_added']);
        ?>
</td>
        <td><?php 
        echo $statuses['orders_status_name'];
        ?>
</td>
        <td><?php 
        echo empty($statuses['comments']) ? '&nbsp;' : nl2br(zen_output_string_protected($statuses['comments']));
        ?>
</td> 
     </tr>
<?php 
    }
    ?>
</table>
<?php 
}
?>

<hr />
<div id="myAccountShipInfo" class="floatingBox back">
<?php 
if ($order->delivery != false) {
Example #20
0
function zen_get_all_get_params($exclude_array = array())
{
    if (!is_array($exclude_array)) {
        $exclude_array = array();
    }
    $exclude_array = array_merge($exclude_array, array(zen_session_name(), 'error', 'x', 'y'));
    // de-duplicating this is less performant than just letting it repeat the loop on duplicates
    $get_url = '';
    if (is_array($_GET) && sizeof($_GET) > 0) {
        reset($_GET);
        while (list($key, $value) = each($_GET)) {
            if (!in_array($key, $exclude_array)) {
                if (!is_array($value)) {
                    //             if (is_numeric($value) || (is_string($value) && strlen($value) > 0)) {
                    if (strlen($value) > 0) {
                        $get_url .= zen_output_string_protected($key) . '=' . rawurlencode(stripslashes($value)) . '&';
                    }
                } else {
                    continue;
                    // legacy code doesn't support passing arrays by GET, so skipping any arrays
                    foreach (array_filter($value) as $arr) {
                        $get_url .= zen_output_string_protected($key) . '[]=' . rawurlencode(stripslashes($arr)) . '&';
                    }
                }
            }
        }
    }
    while (strstr($get_url, '&&')) {
        $get_url = str_replace('&&', '&', $get_url);
    }
    while (strstr($get_url, '&amp;&amp;')) {
        $get_url = str_replace('&amp;&amp;', '&amp;', $get_url);
    }
    return $get_url;
}
Example #21
0
 *
 * @package page
 * @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: header_php.php 19517 2011-09-14 21:28:12Z wilt $
 */
require DIR_WS_MODULES . zen_get_module_directory('require_languages.php');
$text_coupon_help = '';
if (isset($_POST['lookup_discount_coupon']) and $_POST['lookup_discount_coupon'] != '') {
    // lookup requested discount coupon
    $coupon = $db->Execute("select * from " . TABLE_COUPONS . " where coupon_code = '" . zen_db_input($_POST['lookup_discount_coupon']) . "' and  coupon_type != 'G'");
    $_POST['lookup_discount_coupon'] = zen_sanitize_string($_POST['lookup_discount_coupon']);
    if ($coupon->RecordCount() < 1) {
        // invalid discount coupon code
        $text_coupon_help = sprintf(TEXT_COUPON_FAILED, zen_output_string_protected($_POST['lookup_discount_coupon']));
    } else {
        // valid discount coupon code
        $lookup_coupon_id = $coupon->fields['coupon_id'];
        $coupon_desc = $db->Execute("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . (int) $lookup_coupon_id . "' and language_id = '" . (int) $_SESSION['languages_id'] . "'");
        $text_coupon_help = TEXT_COUPON_HELP_HEADER;
        $text_coupon_help .= sprintf(TEXT_COUPON_HELP_NAME, $coupon_desc->fields['coupon_name']);
        if (zen_not_null($coupon_desc->fields['coupon_description'])) {
            $text_coupon_help .= sprintf(TEXT_COUPON_HELP_DESC, $coupon_desc->fields['coupon_description']);
        }
        $coupon_amount = $coupon->fields['coupon_amount'];
        switch ($coupon->fields['coupon_type']) {
            case 'F':
                $text_coupon_help .= sprintf(TEXT_COUPON_HELP_FIXED, $currencies->format($coupon->fields['coupon_amount']));
                break;
            case 'P':
&nbsp;x</td>
          <td class="cartProductDisplay"><?php 
    echo $order->products[$i]['name'];
    ?>
          <?php 
    echo $order->products[$i]['stock_check'];
    ?>

<?php 
    // if there are attributes, loop thru them and display one per line
    if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
        echo '<ul id="cartAttribsList">';
        for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
            ?>
      <li><?php 
            echo $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
            ?>
</li>
<?php 
        }
        // end loop
        echo '</ul>';
    }
    // endif attribute-info
    ?>
        </td>

<?php 
    // display tax info if exists
    if (sizeof($order->info['tax_groups']) > 1) {
        ?>
<script language="javascript" type="text/javascript">
function shipincart_submit(){
  document.estimator.submit();
  return false;
}
</script>

<?php 
// Only do when something is in the cart
if ($_SESSION['cart']->count_contents() > 0) {
    $zip_code = isset($_SESSION['cart_zip_code']) ? $_SESSION['cart_zip_code'] : '';
    $zip_code = isset($_POST['zip_code']) ? strip_tags(addslashes($_POST['zip_code'])) : $zip_code;
    $state_zone_id = isset($_SESSION['cart_zone']) ? (int) $_SESSION['cart_zone'] : '';
    $state_zone_id = isset($_POST['zone_id']) ? (int) $_POST['zone_id'] : $state_zone_id;
    $selectedState = zen_output_string_protected($_POST['state']);
    // Could be placed in english.php
    // shopping cart quotes
    // shipping cost
    require_once 'includes/classes/http_client.php';
    // shipping in basket
    /*
     * // moved below and altered to include Tare // totals info $totalsDisplay = ''; switch (true) { case (SHOW_TOTALS_IN_CART == '1'): $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_WEIGHT . $_SESSION['cart']->show_weight() . TEXT_PRODUCT_WEIGHT_UNIT . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total()); break; case (SHOW_TOTALS_IN_CART == '2'): $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . ($_SESSION['cart']->show_weight() > 0 ? TEXT_TOTAL_WEIGHT . $_SESSION['cart']->show_weight() . TEXT_PRODUCT_WEIGHT_UNIT : '') . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total()); break; case (SHOW_TOTALS_IN_CART == '3'): $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total()); break; }
     */
    // if($cart->get_content_type() !== 'virtual') {
    if ($_SESSION['customer_id']) {
        // user is logged in
        if (isset($_POST['address_id'])) {
            // user changed address
            $sendto = $_POST['address_id'];
        } elseif ($_SESSION['cart_address_id']) {
Example #24
0
    }
    $free_shipping = false;
    if ($pass == true && $_SESSION['cart']->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
        $free_shipping = true;
    }
} else {
    $free_shipping = false;
}
require DIR_WS_MODULES . zen_get_module_directory('require_languages.php');
if (isset($_SESSION['comments'])) {
    $comments = $_SESSION['comments'];
}
// process the selected shipping method
if (isset($_POST['action']) && $_POST['action'] == 'process') {
    if (zen_not_null($_POST['comments'])) {
        $_SESSION['comments'] = zen_output_string_protected($_POST['comments']);
    }
    $comments = $_SESSION['comments'];
    $quote = array();
    if (zen_count_shipping_modules() > 0 || $free_shipping == true) {
        if (isset($_POST['shipping']) && strpos($_POST['shipping'], '_')) {
            /**
             * check to be sure submitted data hasn't been tampered with
             */
            if ($_POST['shipping'] == 'free_free' && ($order->content_type != 'virtual' && !$pass)) {
                $quote['error'] = 'Invalid input. Please make another selection.';
            }
            list($module, $method) = explode('_', $_POST['shipping']);
            if (is_object(${$module}) || $_POST['shipping'] == 'free_free') {
                if ($_POST['shipping'] == 'free_free') {
                    $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
 * Retrieve relevant data from relational tables, for the current products_id:
 */
$tpl_page_body = '/tpl_product_music_info_display.php';
$sql = "select * from " . TABLE_PRODUCT_MUSIC_EXTRA . "\n            where products_id = '" . (int) $_GET['products_id'] . "'";
$music_extras = $db->Execute($sql);
$sql = "select * from " . TABLE_RECORD_ARTISTS . "\n            where artists_id = '" . $music_extras->fields['artists_id'] . "'";
$artist = $db->Execute($sql);
$sql = "select * from " . TABLE_RECORD_ARTISTS_INFO . "\n            where artists_id = '" . $music_extras->fields['artists_id'] . "'\n            and languages_id = '" . (int) $_SESSION['languages_id'] . "'";
$artist_info = $db->Execute($sql);
$sql = "select * from " . TABLE_RECORD_COMPANY . "\n            where record_company_id = '" . $music_extras->fields['record_company_id'] . "'";
$record_company = $db->Execute($sql);
$sql = "select * from " . TABLE_RECORD_COMPANY_INFO . "\n            where record_company_id = '" . $music_extras->fields['record_company_id'] . "'\n            and languages_id = '" . (int) $_SESSION['languages_id'] . "'";
$record_company_info = $db->Execute($sql);
$sql = "select * from " . TABLE_MUSIC_GENRE . "\n            where music_genre_id = '" . $music_extras->fields['music_genre_id'] . "'";
$music_genre = $db->Execute($sql);
/*
 * extract info from queries for use as template-variables:
 */
$products_artist_name = $artist->fields['artists_name'];
$products_artist_url = $artist_info->fields['artists_url'];
$products_record_company_name = $record_company->fields['record_company_name'];
$products_record_company_url = $record_company_info->fields['record_company_url'];
$products_music_genre_name = $music_genre->fields['music_genre_name'];
if (!empty($products_artist_url)) {
    $products_artist_name = '<a href="' . zen_href_link(FILENAME_REDIRECT, 'action=music_arist&artists_id=' . zen_output_string_protected($music_extras->fields['artists_id']), 'NONSSL', true, false) . '" target="_BLANK">' . $products_artist_name . '</a>';
}
if (!empty($products_record_company_url)) {
    $products_record_company_name = '<a href="' . zen_href_link(FILENAME_REDIRECT, 'action=music_record_company&record_company_id=' . zen_output_string_protected($music_extras->fields['record_company_id']), 'NONSSL', true, false) . '" target="_BLANK">' . $products_record_company_name . '</a>';
}
// This should be last line of the script:
$zco_notifier->notify('NOTIFY_PRODUCT_TYPE_VARS_END_PRODUCT_MUSIC_INFO');
<?php 
if ($messageStack->size('review_text') > 0) {
    ?>
  <tr>
    <td class="main" colspan="2"><?php 
    echo $messageStack->output('review_text');
    ?>
</td>
  </tr>
<?php 
}
?>
  <tr>
    <td align="left" class="smallText">
    <?php 
echo '<a href="' . zen_href_link(zen_get_info_faq_page($_GET['faqs_id']), zen_get_all_get_params()) . '">' . TEXT_FAQ_INFO . '</a>' . '<br /><br />' . SUB_TITLE_FROM, zen_output_string_protected($customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname']) . '<br />' . SUB_TITLE_REVIEW;
?>
    </td>
    <td align="center" valign="top" class="smallText">
      <?php 
if (zen_not_null($faqs_image)) {
    require DIR_WS_MODULES . 'pages/' . $current_page_base . '/main_template_vars_images.php';
}
?>
    </td>
  </tr>
  <tr>
    <td class="main" colspan="2"><?php 
echo zen_draw_textarea_field('review_text', 'soft', 60, 15);
?>
</td>
Example #27
0
         $attributes = $db->bindVars($attributes, ':productsID', $products[$i]['id'], 'integer');
         $attributes = $db->bindVars($attributes, ':optionsID', $option, 'integer');
         $attributes = $db->bindVars($attributes, ':optionsValuesID', $value, 'integer');
         $attributes = $db->bindVars($attributes, ':languageID', $_SESSION['languages_id'], 'integer');
         $attributes_values = $db->Execute($attributes);
         //clr 030714 determine if attribute is a text attribute and assign to $attr_value temporarily
         if ($value == PRODUCTS_OPTIONS_VALUES_TEXT_ID) {
             $attributeHiddenField .= zen_draw_hidden_field('id[' . $products[$i]['id'] . '][' . TEXT_PREFIX . $option . ']', $products[$i]['attributes_values'][$option]);
             $attr_value = $products[$i]['attributes_values'][$option];
         } else {
             $attributeHiddenField .= zen_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
             $attr_value = $attributes_values->fields['products_options_values_name'];
         }
         $attrArray[$option]['products_options_name'] = $attributes_values->fields['products_options_name'];
         $attrArray[$option]['options_values_id'] = $value;
         $attrArray[$option]['products_options_values_name'] = zen_output_string_protected($attr_value);
         $attrArray[$option]['options_values_price'] = $attributes_values->fields['options_values_price'];
         $attrArray[$option]['price_prefix'] = $attributes_values->fields['price_prefix'];
     }
 }
 //end foreach [attributes]
 if (STOCK_CHECK == 'true') {
     $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
     if ($flagStockCheck == true) {
         $flagAnyOutOfStock = true;
     }
 }
 $linkProductsImage = zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']);
 $linkProductsName = zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']);
 $productsImage = IMAGE_SHOPPING_CART_STATUS == 1 ? zen_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT) : '';
 $show_products_quantity_max = zen_get_products_quantity_order_max($products[$i]['id']);
Example #28
0
<?php

/**
 * Header code file for the Advanced Search Input page
 *
 * @package page
 * @copyright Copyright 2003-2010 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 17600 2010-09-22 00:45:20Z drbyte $
 */
require DIR_WS_MODULES . zen_get_module_directory('require_languages.php');
$breadcrumb->add(NAVBAR_TITLE_1);
//test:
//&keyword=die+hard&categories_id=10&inc_subcat=1&manufacturers_id=4&pfrom=1&pto=50&dfrom=01%2F01%2F2003&dto=12%2F20%2F2005
$sData['keyword'] = stripslashes(isset($_GET['keyword']) ? zen_output_string_protected($_GET['keyword']) : zen_output_string_protected(KEYWORD_FORMAT_STRING));
$sData['search_in_description'] = isset($_GET['search_in_description']) ? zen_output_string((int) $_GET['search_in_description']) : 1;
$sData['categories_id'] = isset($_GET['categories_id']) ? zen_output_string((int) $_GET['categories_id']) : 0;
$sData['inc_subcat'] = isset($_GET['inc_subcat']) ? zen_output_string((int) $_GET['inc_subcat']) : 1;
$sData['manufacturers_id'] = isset($_GET['manufacturers_id']) ? zen_output_string((int) $_GET['manufacturers_id']) : 0;
$sData['dfrom'] = isset($_GET['dfrom']) ? zen_output_string($_GET['dfrom']) : zen_output_string(DOB_FORMAT_STRING);
$sData['dto'] = isset($_GET['dto']) ? zen_output_string($_GET['dto']) : zen_output_string(DOB_FORMAT_STRING);
$sData['pfrom'] = isset($_GET['pfrom']) ? zen_output_string($_GET['pfrom']) : '';
$sData['pto'] = isset($_GET['pto']) ? zen_output_string($_GET['pto']) : '';
Example #29
0
function zen_customer_greeting()
{
    if (isset($_SESSION['customer_id']) && $_SESSION['customer_first_name']) {
        $greeting_string = sprintf(TEXT_GREETING_PERSONAL, zen_output_string_protected($_SESSION['customer_first_name']), zen_href_link(FILENAME_PRODUCTS_NEW));
    } else {
        $greeting_string = sprintf(TEXT_GREETING_GUEST, zen_href_link(FILENAME_LOGIN, '', 'SSL'), zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
    }
    return $greeting_string;
}
		<div id="createAcctSuccessMainContent" class="content"><?php 
echo TEXT_ACCOUNT_CREATED;
?>
</div>
		<div class="panel-title"><?php 
echo PRIMARY_ADDRESS_TITLE;
?>
</div>
		
		<div class="row">
		<?php 
foreach ($addressArray as $addresses) {
    ?>
			<div class="col-xs-6 col-sm-6 col-md-6">
				<h3 class="addressBookDefaultName"><?php 
    echo zen_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']);
    ?>
</h3>
				<address><?php 
    echo zen_address_format($addresses['format_id'], $addresses['address'], true, ' ', '<br />');
    ?>
</address>
				<div class="form-inline">
					<a class="btn btn-default" href="<?php 
    echo zen_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL');
    ?>
"><?php 
    echo BUTTON_EDIT_SMALL_ALT;
    ?>
</a>
					<a class="btn btn-default" href="<?php