[TEP-COMMIT] [CVS catalog] use the new database class
hpdl-OfajU3CKLf1/[email protected] 23 Feb 2005 15:24:28 -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</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">account.php</a></tt></td><td align="right" id="added">+22</td><td align="right" id="removed">-14</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account.php?rev=1.62&content-type=text/vnd.viewcvs-markup">1.62</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account.php.diff?r1=1.62&r2=1.63">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account.php?rev=1.63&content-type=text/vnd.viewcvs-markup">1.63</a></td></tr>
<tr class="alt"><td><tt><a href="#file2">account_history.php</a></tt></td><td align="right" id="added">+30</td><td align="right" id="removed">-18</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history.php?rev=1.64&content-type=text/vnd.viewcvs-markup">1.64</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history.php.diff?r1=1.64&r2=1.65">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history.php?rev=1.65&content-type=text/vnd.viewcvs-markup">1.65</a></td></tr>
<tr><td><tt><a href="#file3">account_history_info.php</a></tt></td><td align="right" id="added">+17</td><td align="right" id="removed">-9</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history_info.php?rev=1.102&content-type=text/vnd.viewcvs-markup">1.102</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history_info.php.diff?r1=1.102&r2=1.103">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history_info.php?rev=1.103&content-type=text/vnd.viewcvs-markup">1.103</a></td></tr>
<tr class="alt"><td><tt><a href="#file4">account_newsletters.php</a></tt></td><td align="right" id="added">+17</td><td align="right" id="removed">-7</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_newsletters.php?rev=1.5&content-type=text/vnd.viewcvs-markup">1.5</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_newsletters.php.diff?r1=1.5&r2=1.6">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_newsletters.php?rev=1.6&content-type=text/vnd.viewcvs-markup">1.6</a></td></tr>
<tr><td><tt><a href="#file5">account_notifications.php</a></tt></td><td align="right" id="added">+69</td><td align="right" id="removed">-25</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_notifications.php?rev=1.4&content-type=text/vnd.viewcvs-markup">1.4</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_notifications.php.diff?r1=1.4&r2=1.5">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_notifications.php?rev=1.5&content-type=text/vnd.viewcvs-markup">1.5</a></td></tr>
<tr class="alt"><td><tt><a href="#file6">address_book.php</a></tt></td><td align="right" id="added">+12</td><td align="right" id="removed">-8</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book.php?rev=1.60&content-type=text/vnd.viewcvs-markup">1.60</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book.php.diff?r1=1.60&r2=1.61">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book.php?rev=1.61&content-type=text/vnd.viewcvs-markup">1.61</a></td></tr>
<tr><td><tt><a href="#file7">address_book_process.php</a></tt></td><td align="right" id="added">+22</td><td align="right" id="removed">-9</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book_process.php?rev=1.83&content-type=text/vnd.viewcvs-markup">1.83</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book_process.php.diff?r1=1.83&r2=1.84">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book_process.php?rev=1.84&content-type=text/vnd.viewcvs-markup">1.84</a></td></tr>
<tr><td></td><td align="right" id="added">+189</td><td align="right" id="removed">-90</td><td></td></tr>
</table>
<small id="info">7 modified files</small><br />
<pre class="comment">
use the new database class
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a><br /></span>
<div class="fileheader"><big><b>account.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account.php?rev=1.62&content-type=text/vnd.viewcvs-markup">1.62</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account.php.diff?r1=1.62&r2=1.63">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account.php?rev=1.63&content-type=text/vnd.viewcvs-markup">1.63</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.62 -r1.63
--- account.php 2003/11/17 20:45:28 1.62
+++ account.php 2005/02/23 15:24:24 1.63
@@ -5,7 +5,7 @@
</small></pre><pre class="diff" id="context"> osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
</pre><pre class="diff" id="removed">- Copyright (c) 200<span id="removedchars">3</span> osCommerce
</pre><pre class="diff" id="added">+ Copyright (c) 200<span id="addedchars">5</span> osCommerce
</pre><pre class="diff" id="context">
Released under the GNU General Public License
*/
</pre><pre class="diff"><small id="info">@@ -95,23 +95,31 @@
</small></pre><pre class="diff" id="context"> <td class="main" align="center" valign="top" width="130"><?php echo '<b>' . OVERVIEW_PREVIOUS_ORDERS . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
</pre><pre class="diff" id="removed">- $orders_query = tep_db_query("select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, 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 = '" . (int)$osC_Customer->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 = '" . (int)$osC_Session->value('languages_id') . "' order by orders_id desc limit 3");
- while ($orders = tep_db_fetch_array($orders_query)) {
- if (tep_not_null($orders['delivery_name'])) {
- $order_name = $orders['delivery_name'];
- $order_country = $orders['delivery_country'];
</pre><pre class="diff" id="added">+ $Qorders = $osC_Database->query('select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, 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 = :class and o.orders_status = s.orders_status_id and s.language_id = :language_id order by orders_id desc limit 3');
+ $Qorders->bindTable(':table_orders', TABLE_ORDERS);
+ $Qorders->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);
+ $Qorders->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
+ $Qorders->bindInt(':customers_id', $osC_Customer->id);
+ $Qorders->bindValue(':class', 'ot_total');
+ $Qorders->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qorders->execute();
+
+ while ($Qorders->next()) {
+ if (tep_not_null($Qorders->value('delivery_name'))) {
+ $order_name = $Qorders->value('delivery_name');
+ $order_country = $Qorders->value('delivery_country');
</pre><pre class="diff" id="context"> } else {
</pre><pre class="diff" id="removed">- $order_name = $orders['billing_name'];
- $order_country = $orders['billing_country'];
</pre><pre class="diff" id="added">+ $order_name = $Qorders->value('billing_name');
+ $order_country = $Qorders->value('billing_country');
</pre><pre class="diff" id="context"> }
?>
</pre><pre class="diff" id="removed">- <tr class="moduleRow" onMouseOver="rowOverEffect(this)" onMouseOut="rowOutEffect(this)" onClick="document.location.href='<?php echo tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL'); ?>'">
- <td class="main" width="80"><?php echo tep_date_short($orders['date_purchased']); ?></td>
- <td class="main"><?php echo '#' . $orders['orders_id']; ?></td>
</pre><pre class="diff" id="added">+ <tr class="moduleRow" onMouseOver="rowOverEffect(this)" onMouseOut="rowOutEffect(this)" onClick="document.location.href='<?php echo tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $Qorders->valueInt('orders_id'), 'SSL'); ?>'">
+ <td class="main" width="80"><?php echo tep_date_short($Qorders->value('date_purchased')); ?></td>
+ <td class="main"><?php echo '#' . $Qorders->valueInt('orders_id'); ?></td>
</pre><pre class="diff" id="context"> <td class="main"><?php echo tep_output_string_protected($order_name) . ', ' . $order_country; ?></td>
</pre><pre class="diff" id="removed">- <td class="main"><?php echo $orders['orders_status_name']; ?></td>
- <td class="main" align="right"><?php echo $orders['order_total']; ?></td>
- <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL') . '">' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
</pre><pre class="diff" id="added">+ <td class="main"><?php echo $Qorders->value('orders_status_name'); ?></td>
+ <td class="main" align="right"><?php echo $Qorders->value('order_total'); ?></td>
+ <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $Qorders->valueInt('orders_id'), 'SSL') . '">' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
</pre><pre class="diff" id="context"> </tr>
<?php
}
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a><br /></span>
<div class="fileheader"><big><b>account_history.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history.php?rev=1.64&content-type=text/vnd.viewcvs-markup">1.64</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history.php.diff?r1=1.64&r2=1.65">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history.php?rev=1.65&content-type=text/vnd.viewcvs-markup">1.65</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.64 -r1.65
--- account_history.php 2003/11/17 20:45:28 1.64
+++ account_history.php 2005/02/23 15:24:25 1.65
@@ -5,7 +5,7 @@
</small></pre><pre class="diff" id="context"> osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
</pre><pre class="diff" id="removed">- Copyright (c) 200<span id="removedchars">3</span> osCommerce
</pre><pre class="diff" id="added">+ Copyright (c) 200<span id="addedchars">5</span> osCommerce
</pre><pre class="diff" id="context">
Released under the GNU General Public License
*/
</pre><pre class="diff"><small id="info">@@ -18,6 +18,10 @@
</small></pre><pre class="diff" id="context"> tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
</pre><pre class="diff" id="added">+ if (!isset($_GET['page']) || (isset($_GET['page']) && !is_numeric($_GET['page']))) {
+ $_GET['page'] = 1;
+ }
+
</pre><pre class="diff" id="context"> require(DIR_WS_LANGUAGES . $osC_Session->value('language') . '/' . FILENAME_ACCOUNT_HISTORY);
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
</pre><pre class="diff"><small id="info">@@ -63,35 +67,43 @@
</small></pre><pre class="diff" id="context"> $orders_total = tep_count_customer_orders();
if ($orders_total > 0) {
</pre><pre class="diff" id="removed">- $history_query_raw = "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 = '" . (int)$osC_Customer->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 = '" . (int)$osC_Session->value('languages_id') . "' order by orders_id DESC";
- $history_split = new splitPageResults($history_query_raw, MAX_DISPLAY_ORDER_HISTORY);
- $history_query = tep_db_query($history_split->sql_query);
-
- while ($history = tep_db_fetch_array($history_query)) {
- $products_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$history['orders_id'] . "'");
- $products = tep_db_fetch_array($products_query);
</pre><pre class="diff" id="added">+ $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 = :class 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->bindValue(':class', 'ot_total');
+ $Qhistory->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qhistory->setBatchLimit($_GET['page'], 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();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if (tep_not_null($history['delivery_name'])) {
</pre><pre class="diff" id="added">+ if (tep_not_null($Qhistory->value('delivery_name'))) {
</pre><pre class="diff" id="context"> $order_type = TEXT_ORDER_SHIPPED_TO;
</pre><pre class="diff" id="removed">- $order_name = $history['delivery_name'];
</pre><pre class="diff" id="added">+ $order_name = $Qhistory->value('delivery_name');
</pre><pre class="diff" id="context"> } else {
$order_type = TEXT_ORDER_BILLED_TO;
</pre><pre class="diff" id="removed">- $order_name = $history['billing_name'];
</pre><pre class="diff" id="added">+ $order_name = $Qhistory->value('billing_name');
</pre><pre class="diff" id="context"> }
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
</pre><pre class="diff" id="removed">- <td class="main"><?php echo '<b>' . TEXT_ORDER_NUMBER . '</b> ' . $history['orders_id']; ?></td>
- <td class="main" align="right"><?php echo '<b>' . TEXT_ORDER_STATUS . '</b> ' . $history['orders_status_name']; ?></td>
</pre><pre class="diff" id="added">+ <td class="main"><?php echo '<b>' . TEXT_ORDER_NUMBER . '</b> ' . $Qhistory->valueInt('orders_id'); ?></td>
+ <td class="main" align="right"><?php echo '<b>' . TEXT_ORDER_STATUS . '</b> ' . $Qhistory->value('orders_status_name'); ?></td>
</pre><pre class="diff" id="context"> </tr>
</table>
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="2" cellpadding="4">
<tr>
</pre><pre class="diff" id="removed">- <td class="main" width="50%" valign="top"><?php echo '<b>' . TEXT_ORDER_DATE . '</b> ' . tep_date_long($history['date_purchased']) . '<br><b>' . $order_type . '</b> ' . tep_output_string_protected($order_name); ?></td>
- <td class="main" width="30%" valign="top"><?php echo '<b>' . TEXT_ORDER_PRODUCTS . '</b> ' . $products['count'] . '<br><b>' . TEXT_ORDER_COST . '</b> ' . strip_tags($history['order_total']); ?></td>
- <td class="main" width="20%"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'order_id=' . $history['orders_id'], 'SSL') . '">' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
</pre><pre class="diff" id="added">+ <td class="main" 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 class="main" 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 class="main" width="20%"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'order_id=' . $Qhistory->valueInt('orders_id'), 'SSL') . '">' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
</pre><pre class="diff" id="context"> </tr>
</table></td>
</tr>
</pre><pre class="diff"><small id="info">@@ -125,8 +137,8 @@
</small></pre><pre class="diff" id="context"> <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
</pre><pre class="diff" id="removed">- <td class="smallText" valign="top"><?php echo $history_split->display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
- <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $history_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</pre><pre class="diff" id="added">+ <td class="smallText" valign="top"><?php echo $Qhistory->displayBatchLinksTotal(TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
+ <td class="smallText" align="right"><?php echo $Qhistory->displayBatchLinksPullDown(); ?></td>
</pre><pre class="diff" id="context"> </tr>
</table></td>
</tr>
</pre></div>
<hr /><a name="file3" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a><br /></span>
<div class="fileheader"><big><b>account_history_info.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history_info.php?rev=1.102&content-type=text/vnd.viewcvs-markup">1.102</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history_info.php.diff?r1=1.102&r2=1.103">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history_info.php?rev=1.103&content-type=text/vnd.viewcvs-markup">1.103</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.102 -r1.103
--- account_history_info.php 2003/12/18 23:52:13 1.102
+++ account_history_info.php 2005/02/23 15:24:25 1.103
@@ -5,7 +5,7 @@
</small></pre><pre class="diff" id="context"> osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
</pre><pre class="diff" id="removed">- Copyright (c) 200<span id="removedchars">3</span> osCommerce
</pre><pre class="diff" id="added">+ Copyright (c) 200<span id="addedchars">5</span> osCommerce
</pre><pre class="diff" id="context">
Released under the GNU General Public License
*/
</pre><pre class="diff"><small id="info">@@ -22,10 +22,12 @@
</small></pre><pre class="diff" id="context"> tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
}
</pre><pre class="diff" id="removed">- $customer_info_query = tep_db_query("select customers_id from " . TABLE_ORDERS . " where orders_id = '". (int)$_GET['order_id'] . "'");
- $customer_info = tep_db_fetch_array($customer_info_query);
</pre><pre class="diff" id="added">+ $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['order_id']);
+ $Qcheck->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if ($customer_info['customers_id'] != $osC_Customer->id) {
</pre><pre class="diff" id="added">+ if ($Qcheck->valueInt('customers_id') != $osC_Customer->id) {
</pre><pre class="diff" id="context"> tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
}
</pre><pre class="diff"><small id="info">@@ -212,12 +214,18 @@
</small></pre><pre class="diff" id="context"> <tr class="infoBoxContents">
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
</pre><pre class="diff" id="removed">- $statuses_query = tep_db_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 = '" . (int)$_GET['order_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int)$osC_Session->value('languages_id') . "' order by osh.date_added");
- while ($statuses = tep_db_fetch_array($statuses_query)) {
</pre><pre class="diff" id="added">+ $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['order_id']);
+ $Qstatus->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qstatus->execute();
+
+ while ($Qstatus->next()) {
</pre><pre class="diff" id="context"> echo ' <tr>' . "\n" .
</pre><pre class="diff" id="removed">- ' <td class="main" valign="top" width="70">' . tep_date_short($statuses['date_added']) . '</td>' . "\n" .
- ' <td class="main" valign="top" width="70">' . $statuses['orders_status_name'] . '</td>' . "\n" .
- ' <td class="main" valign="top">' . (empty($statuses['comments']) ? '&nbsp;' : nl2br(tep_output_string_protected($statuses['comments']))) . '</td>' . "\n" .
</pre><pre class="diff" id="added">+ ' <td class="main" valign="top" width="70">' . tep_date_short($Qstatus->value('date_added')) . '</td>' . "\n" .
+ ' <td class="main" valign="top" width="70">' . $Qstatus->value('orders_status_name') . '</td>' . "\n" .
+ ' <td class="main" valign="top">' . (tep_not_null($Qstatus->valueProtected('comments')) ? nl2br($Qstatus->valueProtected('comments')) : '&nbsp;') . '</td>' . "\n" .
</pre><pre class="diff" id="context"> ' </tr>' . "\n";
}
?>
</pre></div>
<hr /><a name="file4" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a><br /></span>
<div class="fileheader"><big><b>account_newsletters.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_newsletters.php?rev=1.5&content-type=text/vnd.viewcvs-markup">1.5</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_newsletters.php.diff?r1=1.5&r2=1.6">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_newsletters.php?rev=1.6&content-type=text/vnd.viewcvs-markup">1.6</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.5 -r1.6
--- account_newsletters.php 2004/07/22 17:23:52 1.5
+++ account_newsletters.php 2005/02/23 15:24:25 1.6
@@ -5,7 +5,7 @@
</small></pre><pre class="diff" id="context"> osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
</pre><pre class="diff" id="removed">- Copyright (c) 200<span id="removedchars">4</span> osCommerce
</pre><pre class="diff" id="added">+ Copyright (c) 200<span id="addedchars">5</span> osCommerce
</pre><pre class="diff" id="context">
Released under the GNU General Public License
*/
</pre><pre class="diff"><small id="info">@@ -21,8 +21,10 @@
</small></pre><pre class="diff" id="context"> // needs to be included earlier to set the success message in the messageStack
require(DIR_WS_LANGUAGES . $osC_Session->value('language') . '/' . FILENAME_ACCOUNT_NEWSLETTERS);
</pre><pre class="diff" id="removed">- $newsletter_query = tep_db_query("select customers_newsletter from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$osC_Customer->id . "'");
- $newsletter = tep_db_fetch_array($newsletter_query);
</pre><pre class="diff" id="added">+ $Qnewsletter = $osC_Database->query('select customers_newsletter from :table_customers where customers_id = :customers_id');
+ $Qnewsletter->bindTable(':table_customers', TABLE_CUSTOMERS);
+ $Qnewsletter->bindInt(':customers_id', $osC_Customer->id);
+ $Qnewsletter->execute();
</pre><pre class="diff" id="context">
if (isset($_POST['action']) && ($_POST['action'] == 'process')) {
if (isset($_POST['newsletter_general']) && is_numeric($_POST['newsletter_general'])) {
</pre><pre class="diff"><small id="info">@@ -31,10 +33,18 @@
</small></pre><pre class="diff" id="context"> $newsletter_general = '0';
}
</pre><pre class="diff" id="removed">- if ($newsletter_general != $newsletter['customers_newsletter']) {
- $newsletter_general = (($newsletter['customers_newsletter'] == '1') ? '0' : '1');
</pre><pre class="diff" id="added">+ if ($newsletter_general != $Qnewsletter->value('customers_newsletter')) {
+ $newsletter_general = (($Qnewsletter->value('customers_newsletter') == '1') ? '0' : '1');
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- tep_db_query("update " . TABLE_CUSTOMERS . " set customers_newsletter = '" . (int)$newsletter_general . "' where customers_id = '" . (int)$osC_Customer->id . "'");
</pre><pre class="diff" id="added">+ $Qupdate = $osC_Database->query('update :table_customers set customers_newsletter = :customers_newsletter where customers_id = :customers_id');
+ $Qupdate->bindTable(':table_customers', TABLE_CUSTOMERS);
+ $Qupdate->bindInt(':customers_newsletter', $newsletter_general);
+ $Qupdate->bindInt(':customers_id', $osC_Customer->id);
+ $Qupdate->execute();
+
+ if ($Qupdate->affectedRows() === 1) {
+ $messageStack->add_session('account', SUCCESS_NEWSLETTER_UPDATED, 'success');
+ }
</pre><pre class="diff" id="context"> }
$messageStack->add_session('account', SUCCESS_NEWSLETTER_UPDATED, 'success');
</pre><pre class="diff"><small id="info">@@ -103,7 +113,7 @@
</small></pre><pre class="diff" id="context"> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('newsletter_general')">
</pre><pre class="diff" id="removed">- <td class="main"><?php echo osc_draw_checkbox_field('newsletter_general', '1', $<span id="removedchars">newsletter['customers_newsletter']</span>, 'onclick="checkBox(\'newsletter_general\')"'); ?></td>
</pre><pre class="diff" id="added">+ <td class="main"><?php echo osc_draw_checkbox_field('newsletter_general', '1', $<span id="addedchars">Qnewsletter->value('customers_newsletter')</span>, 'onclick="checkBox(\'newsletter_general\')"'); ?></td>
</pre><pre class="diff" id="context"> <td class="main"><b><?php echo MY_NEWSLETTERS_GENERAL_NEWSLETTER; ?></b></td>
</tr>
<tr>
</pre></div>
<hr /><a name="file5" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a><br /></span>
<div class="fileheader"><big><b>account_notifications.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_notifications.php?rev=1.4&content-type=text/vnd.viewcvs-markup">1.4</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_notifications.php.diff?r1=1.4&r2=1.5">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_notifications.php?rev=1.5&content-type=text/vnd.viewcvs-markup">1.5</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.4 -r1.5
--- account_notifications.php 2004/07/22 17:23:52 1.4
+++ account_notifications.php 2005/02/23 15:24:25 1.5
@@ -5,7 +5,7 @@
</small></pre><pre class="diff" id="context"> osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
</pre><pre class="diff" id="removed">- Copyright (c) 200<span id="removedchars">4</span> osCommerce
</pre><pre class="diff" id="added">+ Copyright (c) 200<span id="addedchars">5</span> osCommerce
</pre><pre class="diff" id="context">
Released under the GNU General Public License
*/
</pre><pre class="diff"><small id="info">@@ -21,10 +21,14 @@
</small></pre><pre class="diff" id="context"> // needs to be included earlier to set the success message in the messageStack
require(DIR_WS_LANGUAGES . $osC_Session->value('language') . '/' . FILENAME_ACCOUNT_NOTIFICATIONS);
</pre><pre class="diff" id="removed">- $global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$osC_Customer->id . "'");
- $global = tep_db_fetch_array($global_query);
</pre><pre class="diff" id="added">+ $Qglobal = $osC_Database->query('select global_product_notifications from :table_customers_info where customers_info_id = :customers_info_id');
+ $Qglobal->bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
+ $Qglobal->bindInt(':customers_info_id', $osC_Customer->id);
+ $Qglobal->execute();
</pre><pre class="diff" id="context">
if (isset($_POST['action']) && ($_POST['action'] == 'process')) {
</pre><pre class="diff" id="added">+ $updated = false;
+
</pre><pre class="diff" id="context"> if (isset($_POST['product_global']) && is_numeric($_POST['product_global'])) {
$product_global = tep_db_prepare_input($_POST['product_global']);
} else {
</pre><pre class="diff"><small id="info">@@ -36,32 +40,62 @@
</small></pre><pre class="diff" id="context"> } else {
$products = array();
}
</pre><pre class="diff" id="added">+
+ if ($product_global != $Qglobal->valueInt('global_product_notifications')) {
+ $product_global = (($Qglobal->valueInt('global_product_notifications') == '1') ? '0' : '1');
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if ($product_global != $global['global_product_notifications']) {
- $product_global = (($global['global_product_notifications'] == '1') ? '0' : '1');
</pre><pre class="diff" id="added">+ $Qupdate = $osC_Database->query('update :table_customers_info set global_product_notifications = :global_product_notifications where customers_info_id = :customers_info_id');
+ $Qupdate->bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
+ $Qupdate->bindInt(':global_product_notifications', $product_global);
+ $Qupdate->bindInt(':customers_info_id', $osC_Customer->id);
+ $Qupdate->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set global_product_notifications = '" . (int)$product_global . "' where customers_info_id = '" . (int)$osC_Customer->id . "'");
</pre><pre class="diff" id="added">+ if ($Qupdate->affectedRows() == 1) {
+ $updated = true;
+ }
</pre><pre class="diff" id="context"> } elseif (sizeof($products) > 0) {
$products_parsed = tep_array_filter($products, 'is_numeric');
if (sizeof($products_parsed) > 0) {
</pre><pre class="diff" id="removed">- $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$osC_Customer->id . "' and products_id not in (" . implode(',', $products_parsed) . ")");
- $check = tep_db_fetch_array($check_query);
-
- if ($check['total'] > 0) {
- tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$osC_Customer->id . "' and products_id not in (" . implode(',', $products_parsed) . ")");
</pre><pre class="diff" id="added">+ $Qcheck = $osC_Database->query('select count(*) as total from :table_products_notifications where customers_id = :customers_id and products_id not in :products_id');
+ $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
+ $Qcheck->bindInt(':customers_id', $osC_Customer->id);
+ $Qcheck->bindRaw(':products_id', '(' . implode(',', $products_parsed) . ')');
+ $Qcheck->execute();
+
+ if ($Qcheck->valueInt('total') > 0) {
+ $Qdelete = $osC_Database->query('delete from :table_products_notifications where customers_id = :customers_id and products_id not in :products_id');
+ $Qdelete->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
+ $Qdelete->bindInt(':customers_id', $osC_Customer->id);
+ $Qdelete->bindRaw(':products_id', '(' . implode(',', $products_parsed) . ')');
+ $Qdelete->execute();
+
+ if ($Qdelete->affectedRows() > 0) {
+ $updated = true;
+ }
</pre><pre class="diff" id="context"> }
}
} else {
</pre><pre class="diff" id="removed">- $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$osC_Customer->id . "'");
- $check = tep_db_fetch_array($check_query);
</pre><pre class="diff" id="added">+ $Qcheck = $osC_Database->query('select count(*) as total from :table_products_notifications where customers_id = :customers_id');
+ $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
+ $Qcheck->bindInt(':customers_id', $osC_Customer->id);
+ $Qcheck->execute();
+
+ if ($Qcheck->valueInt('total') > 0) {
+ $Qdelete = $osC_Database->query('delete from :table_products_notifications where customers_id = :customers_id');
+ $Qdelete->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
+ $Qdelete->bindInt(':customers_id', $osC_Customer->id);
+ $Qdelete->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if ($check['total'] > 0) {
- tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$osC_Customer->id . "'");
</pre><pre class="diff" id="added">+ if ($Qdelete->affectedRows() > 0) {
+ $updated = true;
+ }
</pre><pre class="diff" id="context"> }
}
</pre><pre class="diff" id="removed">- $messageStack->add_session('account', SUCCESS_NOTIFICATIONS_UPDATED, 'success');
</pre><pre class="diff" id="added">+ if ($updated === true) {
+ $messageStack->add_session('account', SUCCESS_NOTIFICATIONS_UPDATED, 'success');
+ }
</pre><pre class="diff" id="context">
tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
}
</pre><pre class="diff"><small id="info">@@ -146,7 +180,7 @@
</small></pre><pre class="diff" id="context"> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('product_global')">
</pre><pre class="diff" id="removed">- <td class="main" width="30"><?php echo osc_draw_checkbox_field('product_global', '1', $<span id="removedchars">global['global_product_notifications']</span>, 'onclick="checkBox(\'product_global\')"'); ?></td>
</pre><pre class="diff" id="added">+ <td class="main" width="30"><?php echo osc_draw_checkbox_field('product_global', '1', $<span id="addedchars">Qglobal->valueInt('global_product_notifications')</span>, 'onclick="checkBox(\'product_global\')"'); ?></td>
</pre><pre class="diff" id="context"> <td class="main"><b><?php echo GLOBAL_NOTIFICATIONS_TITLE; ?></b></td>
</tr>
<tr>
</pre><pre class="diff"><small id="info">@@ -164,7 +198,7 @@
</small></pre><pre class="diff" id="context"> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
</pre><pre class="diff" id="removed">- if ($global['global_product_notifications'] != '1') {
</pre><pre class="diff" id="added">+ if ($Qglobal->valueInt('global_product_notifications') != '1') {
</pre><pre class="diff" id="context"> ?>
<tr>
<td class="main"><b><?php echo NOTIFICATIONS_TITLE; ?></b></td>
</pre><pre class="diff"><small id="info">@@ -177,21 +211,31 @@
</small></pre><pre class="diff" id="context"> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
</pre><pre class="diff" id="removed">- $products_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$osC_Customer->id . "'");
- $products_check = tep_db_fetch_array($products_check_query);
- if ($products_check['total'] > 0) {
</pre><pre class="diff" id="added">+ $Qcheck = $osC_Database->query('select count(*) as total from :table_products_notifications where customers_id = :customers_id');
+ $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
+ $Qcheck->bindInt(':customers_id', $osC_Customer->id);
+ $Qcheck->execute();
+
+ if ($Qcheck->valueInt('total') > 0) {
</pre><pre class="diff" id="context"> ?>
<tr>
<td class="main" colspan="2"><?php echo NOTIFICATIONS_DESCRIPTION; ?></td>
</tr>
<?php
$counter = 0;
</pre><pre class="diff" id="removed">- $products_query = tep_db_query("select pd.products_id, pd.products_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where pn.customers_id = '" . (int)$osC_Customer->id . "' and pn.products_id = pd.products_id and pd.language_id = '" . (int)$osC_Session->value('languages_id') . "' order by pd.products_name");
- while ($products = tep_db_fetch_array($products_query)) {
</pre><pre class="diff" id="added">+
+ $Qproducts = $osC_Database->query('select pd.products_id, pd.products_name from :table_products_description pd, :table_products_notifications pn where pn.customers_id = :customers_id and pn.products_id = pd.products_id and pd.language_id = :language_id order by pd.products_name');
+ $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
+ $Qproducts->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
+ $Qproducts->bindInt(':customers_id', $osC_Customer->id);
+ $Qproducts->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qproducts->execute();
+
+ while ($Qproducts->next()) {
</pre><pre class="diff" id="context"> ?>
<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('products[<?php echo $counter; ?>]')">
</pre><pre class="diff" id="removed">- <td class="main" width="30"><?php echo osc_draw_checkbox_field('products[' . $counter . ']', $products['products_id'], true, 'onclick="checkBox(\'products[' . $counter . ']\')"'); ?></td>
- <td class="main"><b><?php echo $products['products_name']; ?></b></td>
</pre><pre class="diff" id="added">+ <td class="main" width="30"><?php echo osc_draw_checkbox_field('products[' . $counter . ']', $Qproducts->valueInt('products_id'), true, 'onclick="checkBox(\'products[' . $counter . ']\')"'); ?></td>
+ <td class="main"><b><?php echo $Qproducts->value('products_name'); ?></b></td>
</pre><pre class="diff" id="context"> </tr>
<?php
$counter++;
</pre></div>
<hr /><a name="file6" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a><br /></span>
<div class="fileheader"><big><b>address_book.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book.php?rev=1.60&content-type=text/vnd.viewcvs-markup">1.60</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book.php.diff?r1=1.60&r2=1.61">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book.php?rev=1.61&content-type=text/vnd.viewcvs-markup">1.61</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.60 -r1.61
--- address_book.php 2004/07/22 21:39:03 1.60
+++ address_book.php 2005/02/23 15:24:25 1.61
@@ -5,7 +5,7 @@
</small></pre><pre class="diff" id="context"> osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
</pre><pre class="diff" id="removed">- Copyright (c) 200<span id="removedchars">4</span> osCommerce
</pre><pre class="diff" id="added">+ Copyright (c) 200<span id="addedchars">5</span> osCommerce
</pre><pre class="diff" id="context">
Released under the GNU General Public License
*/
</pre><pre class="diff"><small id="info">@@ -118,22 +118,26 @@
</small></pre><pre class="diff" id="context"> <tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
</pre><pre class="diff" id="removed">- $addresses_query = tep_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$osC_Customer->id . "' order by firstname, lastname");
- while ($addresses = tep_db_fetch_array($addresses_query)) {
- $format_id = tep_get_address_format_id($addresses['country_id']);
</pre><pre class="diff" id="added">+ $Qaddresses = $osC_Database->query('select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from :table_address_book where customers_id = :customers_id order by firstname, lastname');
+ $Qaddresses->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+ $Qaddresses->bindInt(':customers_id', $osC_Customer->id);
+ $Qaddresses->execute();
+
+ while ($Qaddresses->next()) {
+ $format_id = tep_get_address_format_id($Qaddresses->valueInt('country_id'));
</pre><pre class="diff" id="context"> ?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
</pre><pre class="diff" id="removed">- <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onClick="document.location.href='<?php echo tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL'); ?>'">
- <td class="main"><b><?php echo tep_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']); ?></b><?php if ($addresses['address_book_id'] == $osC_Customer->default_address_id) echo '&nbsp;<small><i>' . PRIMARY_ADDRESS . '</i></small>'; ?></td>
- <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL') . '">' . tep_image_button('small_edit.gif', SMALL_IMAGE_BUTTON_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $addresses['address_book_id'], 'SSL') . '">' . tep_image_button('small_delete.gif', SMALL_IMAGE_BUTTON_DELETE) . '</a>'; ?></td>
</pre><pre class="diff" id="added">+ <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onClick="document.location.href='<?php echo tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $Qaddresses->valueInt('address_book_id'), 'SSL'); ?>'">
+ <td class="main"><b><?php echo $Qaddresses->valueProtected('firstname') . ' ' . $Qaddresses->valueProtected('lastname'); ?></b><?php if ($Qaddresses->valueInt('address_book_id') == $osC_Customer->default_address_id) echo '&nbsp;<small><i>' . PRIMARY_ADDRESS . '</i></small>'; ?></td>
+ <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $Qaddresses->valueInt('address_book_id'), 'SSL') . '">' . tep_image_button('small_edit.gif', SMALL_IMAGE_BUTTON_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $Qaddresses->valueInt('address_book_id'), 'SSL') . '">' . tep_image_button('small_delete.gif', SMALL_IMAGE_BUTTON_DELETE) . '</a>'; ?></td>
</pre><pre class="diff" id="context"> </tr>
<tr>
<td colspan="2"><table border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</pre><pre class="diff" id="removed">- <td class="main"><?php echo tep_address_format($format_id, $<span id="removedchars">addresses</span>, true, ' ', '<br>'); ?></td>
</pre><pre class="diff" id="added">+ <td class="main"><?php echo tep_address_format($format_id, $<span id="addedchars">Qaddresses->toArray()</span>, true, ' ', '<br>'); ?></td>
</pre><pre class="diff" id="context"> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table></td>
</pre></div>
<hr /><a name="file7" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a><br /></span>
<div class="fileheader"><big><b>address_book_process.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book_process.php?rev=1.83&content-type=text/vnd.viewcvs-markup">1.83</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book_process.php.diff?r1=1.83&r2=1.84">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book_process.php?rev=1.84&content-type=text/vnd.viewcvs-markup">1.84</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.83 -r1.84
--- address_book_process.php 2004/07/22 21:42:15 1.83
+++ address_book_process.php 2005/02/23 15:24:25 1.84
@@ -5,7 +5,7 @@
</small></pre><pre class="diff" id="context"> osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
</pre><pre class="diff" id="removed">- Copyright (c) 200<span id="removedchars">4</span> osCommerce
</pre><pre class="diff" id="added">+ Copyright (c) 200<span id="addedchars">5</span> osCommerce
</pre><pre class="diff" id="context">
Released under the GNU General Public License
*/
</pre><pre class="diff"><small id="info">@@ -22,9 +22,15 @@
</small></pre><pre class="diff" id="context"> require(DIR_WS_LANGUAGES . $osC_Session->value('language') . '/' . FILENAME_ADDRESS_BOOK_PROCESS);
if (isset($_GET['action']) && ($_GET['action'] == 'deleteconfirm') && isset($_GET['delete']) && is_numeric($_GET['delete'])) {
</pre><pre class="diff" id="removed">- tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$_GET['delete'] . "' and customers_id = '" . (int)$osC_Customer->id . "'");
</pre><pre class="diff" id="added">+ $Qdelete = $osC_Database->query('delete from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id');
+ $Qdelete->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+ $Qdelete->bindInt(':address_book_id', $_GET['delete']);
+ $Qdelete->bindInt(':customers_id', $osC_Customer->id);
+ $Qdelete->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- $messageStack->add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_DELETED, 'success');
</pre><pre class="diff" id="added">+ if ($Qdelete->affectedRows() === 1) {
+ $messageStack->add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_DELETED, 'success');
+ }
</pre><pre class="diff" id="context">
tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
}
</pre><pre class="diff"><small id="info">@@ -180,25 +186,32 @@
</small></pre><pre class="diff" id="context"> }
if (isset($_GET['edit']) && is_numeric($_GET['edit'])) {
</pre><pre class="diff" id="removed">- $entry_query = tep_db_query("select entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id, entry_telephone, entry_fax from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$osC_Customer->id . "' and address_book_id = '" . (int)$_GET['edit'] . "'");
</pre><pre class="diff" id="added">+ $Qentry = $osC_Database->query('select entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id, entry_telephone, entry_fax from :table_address_book where customers_id = :customers_id and address_book_id = :address_book_id');
+ $Qentry->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+ $Qentry->bindInt(':customers_id', $osC_Customer->id);
+ $Qentry->bindInt(':address_book_id', $_GET['edit']);
+ $Qentry->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if (!tep_db_num_rows($entry_query)) {
</pre><pre class="diff" id="added">+ if ($Qentry->numberOfRows() < 1) {
</pre><pre class="diff" id="context"> $messageStack->add_session('addressbook', ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY);
tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
}
</pre><pre class="diff" id="removed">- $entry = tep_db_fetch_array($entry_query);
</pre><pre class="diff" id="added">+ $entry = $Qentry->toArray();
</pre><pre class="diff" id="context"> } elseif (isset($_GET['delete']) && is_numeric($_GET['delete'])) {
if ($_GET['delete'] == $osC_Customer->default_address_id) {
$messageStack->add_session('addressbook', WARNING_PRIMARY_ADDRESS_DELETION, 'warning');
tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
} else {
</pre><pre class="diff" id="removed">- $check_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$_GET['delete'] . "' and customers_id = '" . (int)$osC_Customer->id . "'");
- $check = tep_db_fetch_array($check_query);
</pre><pre class="diff" id="added">+ $Qcheck = $osC_Database->query('select count(*) as total from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id');
+ $Qcheck->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+ $Qcheck->bindInt(':address_book_id', $_GET['delete']);
+ $Qcheck->bindInt(':customers_id', $osC_Customer->id);
+ $Qcheck->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if ($check['total'] < 1) {
</pre><pre class="diff" id="added">+ if ($Qcheck->valueInt('total') < 1) {
</pre><pre class="diff" id="context"> $messageStack->add_session('addressbook', ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY);
tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', '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