[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&amp;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&amp;r2=1.63">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account.php?rev=1.63&amp;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&amp;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&amp;r2=1.65">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history.php?rev=1.65&amp;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&amp;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&amp;r2=1.103">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history_info.php?rev=1.103&amp;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&amp;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&amp;r2=1.6">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_newsletters.php?rev=1.6&amp;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&amp;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&amp;r2=1.5">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_notifications.php?rev=1.5&amp;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&amp;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&amp;r2=1.61">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book.php?rev=1.61&amp;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&amp;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&amp;r2=1.84">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book_process.php?rev=1.84&amp;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&amp;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&amp;r2=1.63">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account.php?rev=1.63&amp;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">                 &lt;td class="main" align="center" valign="top" width="130"&gt;&lt;?php echo '&lt;b&gt;' . OVERVIEW_PREVIOUS_ORDERS . '&lt;/b&gt;&lt;br&gt;' . tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?&gt;&lt;/td&gt;
                 &lt;td&gt;&lt;table border="0" width="100%" cellspacing="0" cellpadding="2"&gt;
 &lt;?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-&gt;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-&gt;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-&gt;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-&gt;bindTable(':table_orders', TABLE_ORDERS);
+    $Qorders-&gt;bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);
+    $Qorders-&gt;bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
+    $Qorders-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+    $Qorders-&gt;bindValue(':class', 'ot_total');
+    $Qorders-&gt;bindInt(':language_id', $osC_Session-&gt;value('languages_id'));
+    $Qorders-&gt;execute();
+
+    while ($Qorders-&gt;next()) {
+      if (tep_not_null($Qorders-&gt;value('delivery_name'))) {
+        $order_name = $Qorders-&gt;value('delivery_name');
+        $order_country = $Qorders-&gt;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-&gt;value('billing_name');
+        $order_country = $Qorders-&gt;value('billing_country');
</pre><pre class="diff" id="context">       }
 ?&gt;
</pre><pre class="diff" id="removed">-                  &lt;tr class="moduleRow" onMouseOver="rowOverEffect(this)" onMouseOut="rowOutEffect(this)" onClick="document.location.href='&lt;?php echo tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL'); ?&gt;'"&gt;
-                    &lt;td class="main" width="80"&gt;&lt;?php echo tep_date_short($orders['date_purchased']); ?&gt;&lt;/td&gt;
-                    &lt;td class="main"&gt;&lt;?php echo '#' . $orders['orders_id']; ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="added">+                  &lt;tr class="moduleRow" onMouseOver="rowOverEffect(this)" onMouseOut="rowOutEffect(this)" onClick="document.location.href='&lt;?php echo tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $Qorders-&gt;valueInt('orders_id'), 'SSL'); ?&gt;'"&gt;
+                    &lt;td class="main" width="80"&gt;&lt;?php echo tep_date_short($Qorders-&gt;value('date_purchased')); ?&gt;&lt;/td&gt;
+                    &lt;td class="main"&gt;&lt;?php echo '#' . $Qorders-&gt;valueInt('orders_id'); ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="context">                     &lt;td class="main"&gt;&lt;?php echo tep_output_string_protected($order_name) . ', ' . $order_country; ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="removed">-                    &lt;td class="main"&gt;&lt;?php echo $orders['orders_status_name']; ?&gt;&lt;/td&gt;
-                    &lt;td class="main" align="right"&gt;&lt;?php echo $orders['order_total']; ?&gt;&lt;/td&gt;
-                    &lt;td class="main" align="right"&gt;&lt;?php echo '&lt;a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL') . '"&gt;' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '&lt;/a&gt;'; ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="added">+                    &lt;td class="main"&gt;&lt;?php echo $Qorders-&gt;value('orders_status_name'); ?&gt;&lt;/td&gt;
+                    &lt;td class="main" align="right"&gt;&lt;?php echo $Qorders-&gt;value('order_total'); ?&gt;&lt;/td&gt;
+                    &lt;td class="main" align="right"&gt;&lt;?php echo '&lt;a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $Qorders-&gt;valueInt('orders_id'), 'SSL') . '"&gt;' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '&lt;/a&gt;'; ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="context">                   &lt;/tr&gt;
 &lt;?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&amp;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&amp;r2=1.65">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history.php?rev=1.65&amp;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']) &amp;&amp; !is_numeric($_GET['page']))) {
+    $_GET['page'] = 1;
+  }
+
</pre><pre class="diff" id="context">   require(DIR_WS_LANGUAGES . $osC_Session-&gt;value('language') . '/' . FILENAME_ACCOUNT_HISTORY);
 
   $breadcrumb-&gt;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 &gt; 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-&gt;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-&gt;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-&gt;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-&gt;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-&gt;bindTable(':table_orders', TABLE_ORDERS);
+    $Qhistory-&gt;bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);
+    $Qhistory-&gt;bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
+    $Qhistory-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+    $Qhistory-&gt;bindValue(':class', 'ot_total');
+    $Qhistory-&gt;bindInt(':language_id', $osC_Session-&gt;value('languages_id'));
+    $Qhistory-&gt;setBatchLimit($_GET['page'], MAX_DISPLAY_ORDER_HISTORY);
+    $Qhistory-&gt;execute();
+
+    while ($Qhistory-&gt;next()) {
+      $Qproducts = $osC_Database-&gt;query('select count(*) as count from :table_orders_products where orders_id = :orders_id');
+      $Qproducts-&gt;bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
+      $Qproducts-&gt;bindInt(':orders_id', $Qhistory-&gt;valueInt('orders_id'));
+      $Qproducts-&gt;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-&gt;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-&gt;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-&gt;value('billing_name');
</pre><pre class="diff" id="context">       }
 ?&gt;
           &lt;table border="0" width="100%" cellspacing="0" cellpadding="2"&gt;
             &lt;tr&gt;
</pre><pre class="diff" id="removed">-              &lt;td class="main"&gt;&lt;?php echo '&lt;b&gt;' . TEXT_ORDER_NUMBER . '&lt;/b&gt; ' . $history['orders_id']; ?&gt;&lt;/td&gt;
-              &lt;td class="main" align="right"&gt;&lt;?php echo '&lt;b&gt;' . TEXT_ORDER_STATUS . '&lt;/b&gt; ' . $history['orders_status_name']; ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="added">+              &lt;td class="main"&gt;&lt;?php echo '&lt;b&gt;' . TEXT_ORDER_NUMBER . '&lt;/b&gt; ' . $Qhistory-&gt;valueInt('orders_id'); ?&gt;&lt;/td&gt;
+              &lt;td class="main" align="right"&gt;&lt;?php echo '&lt;b&gt;' . TEXT_ORDER_STATUS . '&lt;/b&gt; ' . $Qhistory-&gt;value('orders_status_name'); ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="context">             &lt;/tr&gt;
           &lt;/table&gt;
           &lt;table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"&gt;
             &lt;tr class="infoBoxContents"&gt;
               &lt;td&gt;&lt;table border="0" width="100%" cellspacing="2" cellpadding="4"&gt;
                 &lt;tr&gt;
</pre><pre class="diff" id="removed">-                  &lt;td class="main" width="50%" valign="top"&gt;&lt;?php echo '&lt;b&gt;' . TEXT_ORDER_DATE . '&lt;/b&gt; ' . tep_date_long($history['date_purchased']) . '&lt;br&gt;&lt;b&gt;' . $order_type . '&lt;/b&gt; ' . tep_output_string_protected($order_name); ?&gt;&lt;/td&gt;
-                  &lt;td class="main" width="30%" valign="top"&gt;&lt;?php echo '&lt;b&gt;' . TEXT_ORDER_PRODUCTS . '&lt;/b&gt; ' . $products['count'] . '&lt;br&gt;&lt;b&gt;' . TEXT_ORDER_COST . '&lt;/b&gt; ' . strip_tags($history['order_total']); ?&gt;&lt;/td&gt;
-                  &lt;td class="main" width="20%"&gt;&lt;?php echo '&lt;a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&amp;' : '') . 'order_id=' . $history['orders_id'], 'SSL') . '"&gt;' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '&lt;/a&gt;'; ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="added">+                  &lt;td class="main" width="50%" valign="top"&gt;&lt;?php echo '&lt;b&gt;' . TEXT_ORDER_DATE . '&lt;/b&gt; ' . tep_date_long($Qhistory-&gt;value('date_purchased')) . '&lt;br&gt;&lt;b&gt;' . $order_type . '&lt;/b&gt; ' . tep_output_string_protected($order_name); ?&gt;&lt;/td&gt;
+                  &lt;td class="main" width="30%" valign="top"&gt;&lt;?php echo '&lt;b&gt;' . TEXT_ORDER_PRODUCTS . '&lt;/b&gt; ' . $Qproducts-&gt;valueInt('count') . '&lt;br&gt;&lt;b&gt;' . TEXT_ORDER_COST . '&lt;/b&gt; ' . strip_tags($Qhistory-&gt;value('order_total')); ?&gt;&lt;/td&gt;
+                  &lt;td class="main" width="20%"&gt;&lt;?php echo '&lt;a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&amp;' : '') . 'order_id=' . $Qhistory-&gt;valueInt('orders_id'), 'SSL') . '"&gt;' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '&lt;/a&gt;'; ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="context">                 &lt;/tr&gt;
               &lt;/table&gt;&lt;/td&gt;
             &lt;/tr&gt;
</pre><pre class="diff"><small id="info">@@ -125,8 +137,8 @@
</small></pre><pre class="diff" id="context">       &lt;tr&gt;
         &lt;td&gt;&lt;table border="0" width="100%" cellspacing="0" cellpadding="2"&gt;
           &lt;tr&gt;
</pre><pre class="diff" id="removed">-            &lt;td class="smallText" valign="top"&gt;&lt;?php echo $history_split-&gt;display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS); ?&gt;&lt;/td&gt;
-            &lt;td class="smallText" align="right"&gt;&lt;?php echo TEXT_RESULT_PAGE . ' ' . $history_split-&gt;display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="added">+            &lt;td class="smallText" valign="top"&gt;&lt;?php echo $Qhistory-&gt;displayBatchLinksTotal(TEXT_DISPLAY_NUMBER_OF_ORDERS); ?&gt;&lt;/td&gt;
+            &lt;td class="smallText" align="right"&gt;&lt;?php echo $Qhistory-&gt;displayBatchLinksPullDown(); ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="context">           &lt;/tr&gt;
         &lt;/table&gt;&lt;/td&gt;
       &lt;/tr&gt;
</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&amp;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&amp;r2=1.103">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_history_info.php?rev=1.103&amp;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-&gt;query('select customers_id from :table_orders where orders_id = :orders_id');
+  $Qcheck-&gt;bindTable(':table_orders', TABLE_ORDERS);
+  $Qcheck-&gt;bindInt(':orders_id', $_GET['order_id']);
+  $Qcheck-&gt;execute();
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">-  if ($customer_info['customers_id'] != $osC_Customer-&gt;id) {
</pre><pre class="diff" id="added">+  if ($Qcheck-&gt;valueInt('customers_id') != $osC_Customer-&gt;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">           &lt;tr class="infoBoxContents"&gt;
             &lt;td valign="top"&gt;&lt;table border="0" width="100%" cellspacing="0" cellpadding="2"&gt;
 &lt;?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-&gt;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-&gt;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-&gt;bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
+  $Qstatus-&gt;bindTable(':table_orders_status_history', TABLE_ORDERS_STATUS_HISTORY);
+  $Qstatus-&gt;bindInt(':orders_id', $_GET['order_id']);
+  $Qstatus-&gt;bindInt(':language_id', $osC_Session-&gt;value('languages_id'));
+  $Qstatus-&gt;execute();
+
+  while ($Qstatus-&gt;next()) {
</pre><pre class="diff" id="context">     echo '              &lt;tr&gt;' . "\n" .
</pre><pre class="diff" id="removed">-         '                &lt;td class="main" valign="top" width="70"&gt;' . tep_date_short($statuses['date_added']) . '&lt;/td&gt;' . "\n" .
-         '                &lt;td class="main" valign="top" width="70"&gt;' . $statuses['orders_status_name'] . '&lt;/td&gt;' . "\n" .
-         '                &lt;td class="main" valign="top"&gt;' . (empty($statuses['comments']) ? '&amp;nbsp;' : nl2br(tep_output_string_protected($statuses['comments']))) . '&lt;/td&gt;' . "\n" .
</pre><pre class="diff" id="added">+         '                &lt;td class="main" valign="top" width="70"&gt;' . tep_date_short($Qstatus-&gt;value('date_added')) . '&lt;/td&gt;' . "\n" .
+         '                &lt;td class="main" valign="top" width="70"&gt;' . $Qstatus-&gt;value('orders_status_name') . '&lt;/td&gt;' . "\n" .
+         '                &lt;td class="main" valign="top"&gt;' . (tep_not_null($Qstatus-&gt;valueProtected('comments')) ? nl2br($Qstatus-&gt;valueProtected('comments')) : '&amp;nbsp;') . '&lt;/td&gt;' . "\n" .
</pre><pre class="diff" id="context">          '              &lt;/tr&gt;' . "\n";
   }
 ?&gt;
</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&amp;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&amp;r2=1.6">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_newsletters.php?rev=1.6&amp;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-&gt;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-&gt;id . "'");
-  $newsletter = tep_db_fetch_array($newsletter_query);
</pre><pre class="diff" id="added">+  $Qnewsletter = $osC_Database-&gt;query('select customers_newsletter from :table_customers where customers_id = :customers_id');
+  $Qnewsletter-&gt;bindTable(':table_customers', TABLE_CUSTOMERS);
+  $Qnewsletter-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+  $Qnewsletter-&gt;execute();
</pre><pre class="diff" id="context"> 
   if (isset($_POST['action']) &amp;&amp; ($_POST['action'] == 'process')) {
     if (isset($_POST['newsletter_general']) &amp;&amp; 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-&gt;value('customers_newsletter')) {
+      $newsletter_general = (($Qnewsletter-&gt;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-&gt;id . "'");
</pre><pre class="diff" id="added">+      $Qupdate = $osC_Database-&gt;query('update :table_customers set customers_newsletter = :customers_newsletter where customers_id = :customers_id');
+      $Qupdate-&gt;bindTable(':table_customers', TABLE_CUSTOMERS);
+      $Qupdate-&gt;bindInt(':customers_newsletter', $newsletter_general);
+      $Qupdate-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+      $Qupdate-&gt;execute();
+
+      if ($Qupdate-&gt;affectedRows() === 1) {
+        $messageStack-&gt;add_session('account', SUCCESS_NEWSLETTER_UPDATED, 'success');
+      }
</pre><pre class="diff" id="context">     }
 
     $messageStack-&gt;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">                 &lt;td&gt;&lt;?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?&gt;&lt;/td&gt;
                 &lt;td&gt;&lt;table border="0" width="100%" cellspacing="0" cellpadding="2"&gt;
                   &lt;tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('newsletter_general')"&gt;
</pre><pre class="diff" id="removed">-                    &lt;td class="main"&gt;&lt;?php echo osc_draw_checkbox_field('newsletter_general', '1', $<span id="removedchars">newsletter['customers_newsletter']</span>, 'onclick="checkBox(\'newsletter_general\')"'); ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="added">+                    &lt;td class="main"&gt;&lt;?php echo osc_draw_checkbox_field('newsletter_general', '1', $<span id="addedchars">Qnewsletter-&gt;value('customers_newsletter')</span>, 'onclick="checkBox(\'newsletter_general\')"'); ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="context">                     &lt;td class="main"&gt;&lt;b&gt;&lt;?php echo MY_NEWSLETTERS_GENERAL_NEWSLETTER; ?&gt;&lt;/b&gt;&lt;/td&gt;
                   &lt;/tr&gt;
                   &lt;tr&gt;
</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&amp;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&amp;r2=1.5">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/account_notifications.php?rev=1.5&amp;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-&gt;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-&gt;id . "'");
-  $global = tep_db_fetch_array($global_query);
</pre><pre class="diff" id="added">+  $Qglobal = $osC_Database-&gt;query('select global_product_notifications from :table_customers_info where customers_info_id = :customers_info_id');
+  $Qglobal-&gt;bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
+  $Qglobal-&gt;bindInt(':customers_info_id', $osC_Customer-&gt;id);
+  $Qglobal-&gt;execute();
</pre><pre class="diff" id="context"> 
   if (isset($_POST['action']) &amp;&amp; ($_POST['action'] == 'process')) {
</pre><pre class="diff" id="added">+    $updated = false;
+
</pre><pre class="diff" id="context">     if (isset($_POST['product_global']) &amp;&amp; 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-&gt;valueInt('global_product_notifications')) {
+      $product_global = (($Qglobal-&gt;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-&gt;query('update :table_customers_info set global_product_notifications = :global_product_notifications where customers_info_id = :customers_info_id');
+      $Qupdate-&gt;bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
+      $Qupdate-&gt;bindInt(':global_product_notifications', $product_global);
+      $Qupdate-&gt;bindInt(':customers_info_id', $osC_Customer-&gt;id);
+      $Qupdate-&gt;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-&gt;id . "'");
</pre><pre class="diff" id="added">+      if ($Qupdate-&gt;affectedRows() == 1) {
+        $updated = true;
+      }
</pre><pre class="diff" id="context">     } elseif (sizeof($products) &gt; 0) {
       $products_parsed = tep_array_filter($products, 'is_numeric');
 
       if (sizeof($products_parsed) &gt; 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-&gt;id . "' and products_id not in (" . implode(',', $products_parsed) . ")");
-        $check = tep_db_fetch_array($check_query);
-
-        if ($check['total'] &gt; 0) {
-          tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$osC_Customer-&gt;id . "' and products_id not in (" . implode(',', $products_parsed) . ")");
</pre><pre class="diff" id="added">+        $Qcheck = $osC_Database-&gt;query('select count(*) as total from :table_products_notifications where customers_id = :customers_id and products_id not in :products_id');
+        $Qcheck-&gt;bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
+        $Qcheck-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+        $Qcheck-&gt;bindRaw(':products_id', '(' . implode(',', $products_parsed) . ')');
+        $Qcheck-&gt;execute();
+
+        if ($Qcheck-&gt;valueInt('total') &gt; 0) {
+          $Qdelete = $osC_Database-&gt;query('delete from :table_products_notifications where customers_id = :customers_id and products_id not in :products_id');
+          $Qdelete-&gt;bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
+          $Qdelete-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+          $Qdelete-&gt;bindRaw(':products_id', '(' . implode(',', $products_parsed) . ')');
+          $Qdelete-&gt;execute();
+
+          if ($Qdelete-&gt;affectedRows() &gt; 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-&gt;id . "'");
-      $check = tep_db_fetch_array($check_query);
</pre><pre class="diff" id="added">+      $Qcheck = $osC_Database-&gt;query('select count(*) as total from :table_products_notifications where customers_id = :customers_id');
+      $Qcheck-&gt;bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
+      $Qcheck-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+      $Qcheck-&gt;execute();
+
+      if ($Qcheck-&gt;valueInt('total') &gt; 0) {
+        $Qdelete = $osC_Database-&gt;query('delete from :table_products_notifications where customers_id = :customers_id');
+        $Qdelete-&gt;bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
+        $Qdelete-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+        $Qdelete-&gt;execute();
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">-      if ($check['total'] &gt; 0) {
-        tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$osC_Customer-&gt;id . "'");
</pre><pre class="diff" id="added">+        if ($Qdelete-&gt;affectedRows() &gt; 0) {
+          $updated = true;
+        }
</pre><pre class="diff" id="context">       }
     }
 
</pre><pre class="diff" id="removed">-    $messageStack-&gt;add_session('account', SUCCESS_NOTIFICATIONS_UPDATED, 'success');
</pre><pre class="diff" id="added">+    if ($updated === true) {
+      $messageStack-&gt;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">                 &lt;td width="10"&gt;&lt;?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?&gt;&lt;/td&gt;
                 &lt;td&gt;&lt;table border="0" width="100%" cellspacing="0" cellpadding="2"&gt;
                   &lt;tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('product_global')"&gt;
</pre><pre class="diff" id="removed">-                    &lt;td class="main" width="30"&gt;&lt;?php echo osc_draw_checkbox_field('product_global', '1', $<span id="removedchars">global['global_product_notifications']</span>, 'onclick="checkBox(\'product_global\')"'); ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="added">+                    &lt;td class="main" width="30"&gt;&lt;?php echo osc_draw_checkbox_field('product_global', '1', $<span id="addedchars">Qglobal-&gt;valueInt('global_product_notifications')</span>, 'onclick="checkBox(\'product_global\')"'); ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="context">                     &lt;td class="main"&gt;&lt;b&gt;&lt;?php echo GLOBAL_NOTIFICATIONS_TITLE; ?&gt;&lt;/b&gt;&lt;/td&gt;
                   &lt;/tr&gt;
                   &lt;tr&gt;
</pre><pre class="diff"><small id="info">@@ -164,7 +198,7 @@
</small></pre><pre class="diff" id="context">         &lt;td&gt;&lt;?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?&gt;&lt;/td&gt;
       &lt;/tr&gt;
 &lt;?php
</pre><pre class="diff" id="removed">-  if ($global['global_product_notifications'] != '1') {
</pre><pre class="diff" id="added">+  if ($Qglobal-&gt;valueInt('global_product_notifications') != '1') {
</pre><pre class="diff" id="context"> ?&gt;
       &lt;tr&gt;
         &lt;td class="main"&gt;&lt;b&gt;&lt;?php echo NOTIFICATIONS_TITLE; ?&gt;&lt;/b&gt;&lt;/td&gt;
</pre><pre class="diff"><small id="info">@@ -177,21 +211,31 @@
</small></pre><pre class="diff" id="context">                 &lt;td width="10"&gt;&lt;?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?&gt;&lt;/td&gt;
                 &lt;td&gt;&lt;table border="0" width="100%" cellspacing="0" cellpadding="2"&gt;
 &lt;?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-&gt;id . "'");
-    $products_check = tep_db_fetch_array($products_check_query);
-    if ($products_check['total'] &gt; 0) {
</pre><pre class="diff" id="added">+    $Qcheck = $osC_Database-&gt;query('select count(*) as total from :table_products_notifications where customers_id = :customers_id');
+    $Qcheck-&gt;bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
+    $Qcheck-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+    $Qcheck-&gt;execute();
+
+    if ($Qcheck-&gt;valueInt('total') &gt; 0) {
</pre><pre class="diff" id="context"> ?&gt;
                   &lt;tr&gt;
                     &lt;td class="main" colspan="2"&gt;&lt;?php echo NOTIFICATIONS_DESCRIPTION; ?&gt;&lt;/td&gt;
                   &lt;/tr&gt;
 &lt;?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-&gt;id . "' and pn.products_id = pd.products_id and pd.language_id = '" . (int)$osC_Session-&gt;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-&gt;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-&gt;bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
+      $Qproducts-&gt;bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
+      $Qproducts-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+      $Qproducts-&gt;bindInt(':language_id', $osC_Session-&gt;value('languages_id'));
+      $Qproducts-&gt;execute();
+
+      while ($Qproducts-&gt;next()) {
</pre><pre class="diff" id="context"> ?&gt;
                   &lt;tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('products[&lt;?php echo $counter; ?&gt;]')"&gt;
</pre><pre class="diff" id="removed">-                    &lt;td class="main" width="30"&gt;&lt;?php echo osc_draw_checkbox_field('products[' . $counter . ']', $products['products_id'], true, 'onclick="checkBox(\'products[' . $counter . ']\')"'); ?&gt;&lt;/td&gt;
-                    &lt;td class="main"&gt;&lt;b&gt;&lt;?php echo $products['products_name']; ?&gt;&lt;/b&gt;&lt;/td&gt;
</pre><pre class="diff" id="added">+                    &lt;td class="main" width="30"&gt;&lt;?php echo osc_draw_checkbox_field('products[' . $counter . ']', $Qproducts-&gt;valueInt('products_id'), true, 'onclick="checkBox(\'products[' . $counter . ']\')"'); ?&gt;&lt;/td&gt;
+                    &lt;td class="main"&gt;&lt;b&gt;&lt;?php echo $Qproducts-&gt;value('products_name'); ?&gt;&lt;/b&gt;&lt;/td&gt;
</pre><pre class="diff" id="context">                   &lt;/tr&gt;
 &lt;?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&amp;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&amp;r2=1.61">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book.php?rev=1.61&amp;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">           &lt;tr class="infoBoxContents"&gt;
             &lt;td&gt;&lt;table border="0" width="100%" cellspacing="0" cellpadding="2"&gt;
 &lt;?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-&gt;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-&gt;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-&gt;bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+  $Qaddresses-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+  $Qaddresses-&gt;execute();
+
+  while ($Qaddresses-&gt;next()) {
+    $format_id = tep_get_address_format_id($Qaddresses-&gt;valueInt('country_id'));
</pre><pre class="diff" id="context"> ?&gt;
               &lt;tr&gt;
                 &lt;td&gt;&lt;?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?&gt;&lt;/td&gt;
                 &lt;td&gt;&lt;table border="0" width="100%" cellspacing="0" cellpadding="2"&gt;
</pre><pre class="diff" id="removed">-                  &lt;tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onClick="document.location.href='&lt;?php echo tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL'); ?&gt;'"&gt;
-                    &lt;td class="main"&gt;&lt;b&gt;&lt;?php echo tep_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']); ?&gt;&lt;/b&gt;&lt;?php if ($addresses['address_book_id'] == $osC_Customer-&gt;default_address_id) echo '&amp;nbsp;&lt;small&gt;&lt;i&gt;' . PRIMARY_ADDRESS . '&lt;/i&gt;&lt;/small&gt;'; ?&gt;&lt;/td&gt;
-                    &lt;td class="main" align="right"&gt;&lt;?php echo '&lt;a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL') . '"&gt;' . tep_image_button('small_edit.gif', SMALL_IMAGE_BUTTON_EDIT) . '&lt;/a&gt; &lt;a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $addresses['address_book_id'], 'SSL') . '"&gt;' . tep_image_button('small_delete.gif', SMALL_IMAGE_BUTTON_DELETE) . '&lt;/a&gt;'; ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="added">+                  &lt;tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onClick="document.location.href='&lt;?php echo tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $Qaddresses-&gt;valueInt('address_book_id'), 'SSL'); ?&gt;'"&gt;
+                    &lt;td class="main"&gt;&lt;b&gt;&lt;?php echo $Qaddresses-&gt;valueProtected('firstname') . ' ' . $Qaddresses-&gt;valueProtected('lastname'); ?&gt;&lt;/b&gt;&lt;?php if ($Qaddresses-&gt;valueInt('address_book_id') == $osC_Customer-&gt;default_address_id) echo '&amp;nbsp;&lt;small&gt;&lt;i&gt;' . PRIMARY_ADDRESS . '&lt;/i&gt;&lt;/small&gt;'; ?&gt;&lt;/td&gt;
+                    &lt;td class="main" align="right"&gt;&lt;?php echo '&lt;a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $Qaddresses-&gt;valueInt('address_book_id'), 'SSL') . '"&gt;' . tep_image_button('small_edit.gif', SMALL_IMAGE_BUTTON_EDIT) . '&lt;/a&gt; &lt;a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $Qaddresses-&gt;valueInt('address_book_id'), 'SSL') . '"&gt;' . tep_image_button('small_delete.gif', SMALL_IMAGE_BUTTON_DELETE) . '&lt;/a&gt;'; ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="context">                   &lt;/tr&gt;
                   &lt;tr&gt;
                     &lt;td colspan="2"&gt;&lt;table border="0" cellspacing="0" cellpadding="2"&gt;
                       &lt;tr&gt;
                         &lt;td width="10"&gt;&lt;?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="removed">-                        &lt;td class="main"&gt;&lt;?php echo tep_address_format($format_id, $<span id="removedchars">addresses</span>, true, ' ', '&lt;br&gt;'); ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="added">+                        &lt;td class="main"&gt;&lt;?php echo tep_address_format($format_id, $<span id="addedchars">Qaddresses-&gt;toArray()</span>, true, ' ', '&lt;br&gt;'); ?&gt;&lt;/td&gt;
</pre><pre class="diff" id="context">                         &lt;td width="10"&gt;&lt;?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?&gt;&lt;/td&gt;
                       &lt;/tr&gt;
                     &lt;/table&gt;&lt;/td&gt;
</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&amp;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&amp;r2=1.84">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/address_book_process.php?rev=1.84&amp;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-&gt;value('language') . '/' . FILENAME_ADDRESS_BOOK_PROCESS);
 
   if (isset($_GET['action']) &amp;&amp; ($_GET['action'] == 'deleteconfirm') &amp;&amp; isset($_GET['delete']) &amp;&amp; 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-&gt;id . "'");
</pre><pre class="diff" id="added">+    $Qdelete = $osC_Database-&gt;query('delete from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id');
+    $Qdelete-&gt;bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+    $Qdelete-&gt;bindInt(':address_book_id', $_GET['delete']);
+    $Qdelete-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+    $Qdelete-&gt;execute();
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">-    $messageStack-&gt;add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_DELETED, 'success');
</pre><pre class="diff" id="added">+    if ($Qdelete-&gt;affectedRows() === 1) {
+      $messageStack-&gt;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']) &amp;&amp; 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-&gt;id . "' and address_book_id = '" . (int)$_GET['edit'] . "'");
</pre><pre class="diff" id="added">+    $Qentry = $osC_Database-&gt;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-&gt;bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+    $Qentry-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+    $Qentry-&gt;bindInt(':address_book_id', $_GET['edit']);
+    $Qentry-&gt;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-&gt;numberOfRows() &lt; 1) {
</pre><pre class="diff" id="context">       $messageStack-&gt;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-&gt;toArray();
</pre><pre class="diff" id="context">   } elseif (isset($_GET['delete']) &amp;&amp; is_numeric($_GET['delete'])) {
     if ($_GET['delete'] == $osC_Customer-&gt;default_address_id) {
       $messageStack-&gt;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-&gt;id . "'");
-      $check = tep_db_fetch_array($check_query);
</pre><pre class="diff" id="added">+      $Qcheck = $osC_Database-&gt;query('select count(*) as total from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id');
+      $Qcheck-&gt;bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+      $Qcheck-&gt;bindInt(':address_book_id', $_GET['delete']);
+      $Qcheck-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+      $Qcheck-&gt;execute();
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">-      if ($check['total'] &lt; 1) {
</pre><pre class="diff" id="added">+      if ($Qcheck-&gt;valueInt('total') &lt; 1) {
</pre><pre class="diff" id="context">         $messageStack-&gt;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 -&gt; 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