[TEP-COMMIT] [CVS catalog] the new orders pages based on a CSS layout, and a new account orders module
hpdl-OfajU3CKLf1/[email protected] 29 Mar 2005 23:36:49 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>catalog/catalog/includes</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt>content/pages/<a href="#file1"><span id="added">account_history.php</span></a></tt></td><td align="right" id="added">+90</td><td></td><td nowrap="nowrap" align="right">added <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages/account_history.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></td></tr>
<tr class="alt"><td><tt> /<a href="#file2"><span id="added">account_history_info.php</span></a></tt></td><td align="right" id="added">+164</td><td></td><td nowrap="nowrap" align="right">added <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages/account_history_info.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></td></tr>
<tr><td><tt>modules/account/<a href="#file3"><span id="added">orders.php</span></a></tt></td><td align="right" id="added">+70</td><td></td><td nowrap="nowrap" align="right">added <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/account/orders.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></td></tr>
<tr><td></td><td align="right" id="added">+324</td><td></td><td></td></tr>
</table>
<small id="info">3 added files</small><br />
<pre class="comment">
the new orders pages based on a CSS layout, and a new account orders module
to handle the processing logic
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname" id="added"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content">content</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages">pages</a><br /></span>
<div class="fileheader" id="added"><big><b>account_history.php</b></big> <small id="info">added at <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages/account_history.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></small></div>
<pre class="diff"><small id="info">diff -N account_history.php
--- /dev/null Wed Mar 30 01:36:34 2005
+++ /tmp/cvsAAAchayrB Wed Mar 30 01:36:43 2005
@@ -0,0 +1,90 @@
</small></pre><pre class="diff" id="added">+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2005 osCommerce
+
+ Released under the GNU General Public License
+*/
+?>
+
+<div class="pageHeading">
+ <span class="pageHeadingImage"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE_ORDERS, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></span>
+
+ <h1><?php echo HEADING_TITLE_ORDERS; ?></h1>
+</div>
+
+<?php
+ if (tep_count_customer_orders() > 0) {
+ $Qhistory = $osC_Database->query('select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from :table_orders o, :table_orders_total ot, :table_orders_status s where o.customers_id = :customers_id and o.orders_id = ot.orders_id and ot.class = "ot_total" and o.orders_status = s.orders_status_id and s.language_id = :language_id order by orders_id desc');
+ $Qhistory->bindTable(':table_orders', TABLE_ORDERS);
+ $Qhistory->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);
+ $Qhistory->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
+ $Qhistory->bindInt(':customers_id', $osC_Customer->id);
+ $Qhistory->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qhistory->setBatchLimit((isset($_GET['page']) ? $_GET['page'] : 1), MAX_DISPLAY_ORDER_HISTORY);
+ $Qhistory->execute();
+
+ while ($Qhistory->next()) {
+ $Qproducts = $osC_Database->query('select count(*) as count from :table_orders_products where orders_id = :orders_id');
+ $Qproducts->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
+ $Qproducts->bindInt(':orders_id', $Qhistory->valueInt('orders_id'));
+ $Qproducts->execute();
+
+ if (tep_not_null($Qhistory->value('delivery_name'))) {
+ $order_type = TEXT_ORDER_SHIPPED_TO;
+ $order_name = $Qhistory->value('delivery_name');
+ } else {
+ $order_type = TEXT_ORDER_BILLED_TO;
+ $order_name = $Qhistory->value('billing_name');
+ }
+?>
+
+<div class="moduleBox">
+ <div class="outsideHeading">
+ <span style="float: right; text-align: right;"><?php echo TEXT_ORDER_STATUS . ' ' . $Qhistory->value('orders_status_name'); ?></span>
+
+ <?php echo TEXT_ORDER_NUMBER . ' ' . $Qhistory->valueInt('orders_id'); ?>
+ </div>
+
+ <div class="content">
+ <table border="0" width="100%" cellspacing="2" cellpadding="4">
+ <tr>
+ <td width="50%" valign="top"><?php echo '<b>' . TEXT_ORDER_DATE . '</b> ' . tep_date_long($Qhistory->value('date_purchased')) . '<br><b>' . $order_type . '</b> ' . tep_output_string_protected($order_name); ?></td>
+ <td width="30%" valign="top"><?php echo '<b>' . TEXT_ORDER_PRODUCTS . '</b> ' . $Qproducts->valueInt('count') . '<br><b>' . TEXT_ORDER_COST . '</b> ' . strip_tags($Qhistory->value('order_total')); ?></td>
+ <td width="20%"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, 'orders=' . $Qhistory->valueInt('orders_id') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'SSL') . '">' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
+ </tr>
+ </table>
+ </div>
+</div>
+
+<?php
+ }
+?>
+
+<div class="listingPageLinks">
+ <span style="float: right;"><?php echo $Qhistory->displayBatchLinksPullDown(); ?></span>
+
+ <?php echo $Qhistory->displayBatchLinksTotal(TEXT_DISPLAY_NUMBER_OF_ORDERS); ?>
+</div>
+
+<?php
+ } else {
+?>
+
+<div class="moduleBox">
+ <div class="content">
+ <?php echo TEXT_NO_PURCHASES; ?>
+ </div>
+</div>
+
+<?php
+ }
+?>
+
+<div class="submitFormButtons">
+ <?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?>
+</div>
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname" id="added"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content">content</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages">pages</a><br /></span>
<div class="fileheader" id="added"><big><b>account_history_info.php</b></big> <small id="info">added at <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages/account_history_info.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></small></div>
<pre class="diff"><small id="info">diff -N account_history_info.php
--- /dev/null Wed Mar 30 01:36:34 2005
+++ /tmp/cvsAAAlmaisB Wed Mar 30 01:36:44 2005
@@ -0,0 +1,164 @@
</small></pre><pre class="diff" id="added">+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2005 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ require('includes/classes/order.php');
+ $order = new order($_GET['orders']);
+?>
+
+<div class="pageHeading">
+ <span class="pageHeadingImage"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', sprintf(NAVBAR_TITLE_ORDER_INFORMATION, $_GET['orders']), HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></span>
+
+ <h1><?php echo sprintf(NAVBAR_TITLE_ORDER_INFORMATION, $_GET['orders']); ?></h1>
+</div>
+
+<div class="moduleBox">
+ <div class="outsideHeading">
+ <span style="float: right;">&nbsp;<br><?php echo HEADING_ORDER_TOTAL . ' ' . $order->info['total']; ?></span>
+
+ <?php echo sprintf(HEADING_ORDER_NUMBER, $_GET['orders']) . ' <small>(' . $order->info['orders_status'] . ')</small><br>' . HEADING_ORDER_DATE . ' ' . tep_date_long($order->info['date_purchased']); ?>
+ </div>
+
+ <div class="content">
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td width="30%" valign="top">
+
+<?php
+ if ($order->delivery != false) {
+?>
+ <p><b><?php echo HEADING_DELIVERY_ADDRESS; ?></b></p>
+ <p><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></p>
+
+<?php
+ if (tep_not_null($order->info['shipping_method'])) {
+?>
+
+ <p><b><?php echo HEADING_SHIPPING_METHOD; ?></b></p>
+ <p><?php echo $order->info['shipping_method']; ?></p>
+
+<?php
+ }
+ }
+?>
+
+ <p><b><?php echo HEADING_BILLING_ADDRESS; ?></b></p>
+ <p><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>'); ?></p>
+
+ <p><b><?php echo HEADING_PAYMENT_METHOD; ?></b></p>
+ <p><?php echo $order->info['payment_method']; ?></p>
+ </td>
+ <td width="70%" valign="top">
+ <div style="border: 1px; border-style: solid; border-color: #CCCCCC; background-color: #FBFBFB; padding: 5px;">
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+ if (sizeof($order->info['tax_groups']) > 1) {
+?>
+ <tr>
+ <td colspan="2"><b><?php echo HEADING_PRODUCTS; ?></b></td>
+ <td align="right"><b><?php echo HEADING_TAX; ?></b></td>
+ <td align="right"><b><?php echo HEADING_TOTAL; ?></b></td>
+ </tr>
+<?php
+ } else {
+?>
+ <tr>
+ <td colspan="3"><b><?php echo HEADING_PRODUCTS; ?></b></td>
+ </tr>
+<?php
+ }
+
+ for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+ echo ' <tr>' . "\n" .
+ ' <td align="right" valign="top" width="30">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
+ ' <td valign="top">' . $order->products[$i]['name'];
+
+ if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
+ for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
+ echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
+ }
+ }
+
+ echo '</td>' . "\n";
+
+ if (sizeof($order->info['tax_groups']) > 1) {
+ echo ' <td valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";
+ }
+
+ echo ' <td align="right" valign="top">' . $osC_Currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" .
+ ' </tr>' . "\n";
+ }
+?>
+
+ </table>
+
+ <p>&nbsp;</p>
+
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+
+<?php
+ for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
+ echo ' <tr>' . "\n" .
+ ' <td align="right" width="100%">' . $order->totals[$i]['title'] . '</td>' . "\n" .
+ ' <td>&nbsp;&nbsp;</td>' . "\n" .
+ ' <td align="right">' . $order->totals[$i]['text'] . '</td>' . "\n" .
+ ' </tr>' . "\n";
+ }
+?>
+ </table>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+</div>
+
+<?php
+ $Qstatus = $osC_Database->query('select os.orders_status_name, osh.date_added, osh.comments from :table_orders_status os, :table_orders_status_history osh where osh.orders_id = :orders_id and osh.orders_status_id = os.orders_status_id and os.language_id = :language_id order by osh.date_added');
+ $Qstatus->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
+ $Qstatus->bindTable(':table_orders_status_history', TABLE_ORDERS_STATUS_HISTORY);
+ $Qstatus->bindInt(':orders_id', $_GET['orders']);
+ $Qstatus->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qstatus->execute();
+
+ if ($Qstatus->numberOfRows() > 0) {
+?>
+
+<div class="moduleBox">
+ <div class="outsideHeading"><?php echo HEADING_ORDER_HISTORY; ?></div>
+
+ <div class="content">
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+ while ($Qstatus->next()) {
+ echo ' <tr>' . "\n" .
+ ' <td valign="top" width="70">' . tep_date_short($Qstatus->value('date_added')) . '</td>' . "\n" .
+ ' <td valign="top" width="70">' . $Qstatus->value('orders_status_name') . '</td>' . "\n" .
+ ' <td valign="top">' . (tep_not_null($Qstatus->valueProtected('comments')) ? nl2br($Qstatus->valueProtected('comments')) : '&nbsp;') . '</td>' . "\n" .
+ ' </tr>' . "\n";
+ }
+?>
+ </table>
+ </div>
+</div>
+
+<?php
+ }
+
+ if (DOWNLOAD_ENABLED == 'true') {
+ include('includes/modules/downloads.php');
+ }
+?>
+
+
+<div class="submitFormButtons">
+ <?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, 'orders' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?>
+</div>
</pre></div>
<hr /><a name="file3" /><div class="file">
<span class="pathname" id="added"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules">modules</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/account">account</a><br /></span>
<div class="fileheader" id="added"><big><b>orders.php</b></big> <small id="info">added at <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/account/orders.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></small></div>
<pre class="diff"><small id="info">diff -N orders.php
--- /dev/null Wed Mar 30 01:36:34 2005
+++ /tmp/cvsAAAGxaWsB Wed Mar 30 01:36:44 2005
@@ -0,0 +1,70 @@
</small></pre><pre class="diff" id="added">+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2005 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ class osC_Account_Orders {
+
+/* Public variables */
+
+ var $page_contents = 'account_history.php';
+
+/* Private variables */
+
+ var $_module = 'orders';
+
+/* Class constructor */
+
+ function osC_Account_Orders() {
+ global $osC_Services, $breadcrumb;
+
+ if ($osC_Services->isStarted('breadcrumb')) {
+ $breadcrumb->add(NAVBAR_TITLE_MY_ORDERS, tep_href_link(FILENAME_ACCOUNT, $this->_module, 'SSL'));
+
+ if (is_numeric($_GET[$this->_module])) {
+ $breadcrumb->add(sprintf(NAVBAR_TITLE_ORDER_INFORMATION, $_GET[$this->_module]), tep_href_link(FILENAME_ACCOUNT, $this->_module . '=' . $_GET[$this->_module], 'SSL'));
+ }
+ }
+
+ if (is_numeric($_GET[$this->_module])) {
+ $this->page_contents = 'account_history_info.php';
+ }
+
+ if (tep_not_null($_GET[$this->_module])) {
+ $this->_process();
+ }
+ }
+
+/* Public methods */
+
+ function getPageContentsFile() {
+ return $this->page_contents;
+ }
+
+/* Private methods */
+
+ function _process() {
+ global $osC_Database, $osC_Customer;
+
+ if (is_numeric($_GET[$this->_module]) === false) {
+ tep_redirect(tep_href_link(FILENAME_ACCOUNT, $this->_module, 'SSL'));
+ }
+
+ $Qcheck = $osC_Database->query('select customers_id from :table_orders where orders_id = :orders_id');
+ $Qcheck->bindTable(':table_orders', TABLE_ORDERS);
+ $Qcheck->bindInt(':orders_id', $_GET[$this->_module]);
+ $Qcheck->execute();
+
+ if ($Qcheck->valueInt('customers_id') != $osC_Customer->id) {
+ tep_redirect(tep_href_link(FILENAME_ACCOUNT, $this->_module, 'SSL'));
+ }
+ }
+ }
+?>
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.9</small></center>
</body></html>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click