[TEP-COMMIT] [CVS catalog] use the new database class
hpdl-OfajU3CKLf1/[email protected] 23 Feb 2005 15:28:32 -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">checkout_payment.php</a></tt></td><td align="right" id="added">+7</td><td align="right" id="removed">-4</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_payment.php?rev=1.119&content-type=text/vnd.viewcvs-markup">1.119</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_payment.php.diff?r1=1.119&r2=1.120">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_payment.php?rev=1.120&content-type=text/vnd.viewcvs-markup">1.120</a></td></tr>
<tr class="alt"><td><tt><a href="#file2">checkout_payment_address.php</a></tt></td><td align="right" id="added">+18</td><td align="right" id="removed">-11</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_payment_address.php?rev=1.17&content-type=text/vnd.viewcvs-markup">1.17</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_payment_address.php.diff?r1=1.17&r2=1.18">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_payment_address.php?rev=1.18&content-type=text/vnd.viewcvs-markup">1.18</a></td></tr>
<tr><td><tt><a href="#file3">checkout_process.php</a></tt></td><td align="right" id="added">+159</td><td align="right" id="removed">-124</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_process.php?rev=1.131&content-type=text/vnd.viewcvs-markup">1.131</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_process.php.diff?r1=1.131&r2=1.132">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_process.php?rev=1.132&content-type=text/vnd.viewcvs-markup">1.132</a></td></tr>
<tr class="alt"><td><tt><a href="#file4">checkout_shipping.php</a></tt></td><td align="right" id="added">+7</td><td align="right" id="removed">-4</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_shipping.php?rev=1.23&content-type=text/vnd.viewcvs-markup">1.23</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_shipping.php.diff?r1=1.23&r2=1.24">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_shipping.php?rev=1.24&content-type=text/vnd.viewcvs-markup">1.24</a></td></tr>
<tr><td><tt><a href="#file5">checkout_shipping_address.php</a></tt></td><td align="right" id="added">+18</td><td align="right" id="removed">-11</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_shipping_address.php?rev=1.19&content-type=text/vnd.viewcvs-markup">1.19</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_shipping_address.php.diff?r1=1.19&r2=1.20">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_shipping_address.php?rev=1.20&content-type=text/vnd.viewcvs-markup">1.20</a></td></tr>
<tr class="alt"><td><tt><a href="#file6">checkout_success.php</a></tt></td><td align="right" id="added">+19</td><td align="right" id="removed">-11</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_success.php?rev=1.51&content-type=text/vnd.viewcvs-markup">1.51</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_success.php.diff?r1=1.51&r2=1.52">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_success.php?rev=1.52&content-type=text/vnd.viewcvs-markup">1.52</a></td></tr>
<tr><td></td><td align="right" id="added">+228</td><td align="right" id="removed">-165</td><td></td></tr>
</table>
<small id="info">6 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>checkout_payment.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_payment.php?rev=1.119&content-type=text/vnd.viewcvs-markup">1.119</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_payment.php.diff?r1=1.119&r2=1.120">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_payment.php?rev=1.120&content-type=text/vnd.viewcvs-markup">1.120</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.119 -r1.120
--- checkout_payment.php 2004/07/22 21:45:38 1.119
+++ checkout_payment.php 2005/02/23 15:28:26 1.120
@@ -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">@@ -57,10 +57,13 @@
</small></pre><pre class="diff" id="context"> $osC_Session->set('billto', $osC_Customer->default_address_id);
} else {
// verify the selected billing address
</pre><pre class="diff" id="removed">- $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$osC_Customer->id . "' and address_book_id = '" . (int)$osC_Session->value('billto') . "'");
- $check_address = tep_db_fetch_array($check_address_query);
</pre><pre class="diff" id="added">+ $Qcheck = $osC_Database->query('select count(*) as total from :table_address_book where customers_id = :customers_id and address_book_id = :address_book_id');
+ $Qcheck->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+ $Qcheck->bindInt(':customers_id', $osC_Customer->id);
+ $Qcheck->bindInt(':address_book_id', $osC_Session->value('billto'));
+ $Qcheck->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if ($check_address['total'] != '1') {
</pre><pre class="diff" id="added">+ if ($Qcheck->valueInt('total') != 1) {
</pre><pre class="diff" id="context"> $osC_Session->set('billto', $osC_Customer->default_address_id);
$osC_Session->remove('payment');
</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>checkout_payment_address.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_payment_address.php?rev=1.17&content-type=text/vnd.viewcvs-markup">1.17</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_payment_address.php.diff?r1=1.17&r2=1.18">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_payment_address.php?rev=1.18&content-type=text/vnd.viewcvs-markup">1.18</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.17 -r1.18
--- checkout_payment_address.php 2004/07/22 21:46:24 1.17
+++ checkout_payment_address.php 2005/02/23 15:28:26 1.18
@@ -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">@@ -182,10 +182,13 @@
</small></pre><pre class="diff" id="context">
$osC_Session->set('billto', $_POST['address']);
</pre><pre class="diff" id="removed">- $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$osC_Customer->id . "' and address_book_id = '" . (int)$osC_Session->value('billto') . "'");
- $check_address = tep_db_fetch_array($check_address_query);
</pre><pre class="diff" id="added">+ $Qcheck = $osC_Database->query('select count(*) as total from :table_address_book where customers_id = :customers_id and address_book_id = :address_book_id');
+ $Qcheck->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+ $Qcheck->bindInt(':customers_id', $osC_Customer->id);
+ $Qcheck->bindInt(':address_book_id', $osC_Session->value('billto'));
+ $Qcheck->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if ($check_address['total'] == '1') {
</pre><pre class="diff" id="added">+ if ($Qcheck->valueInt('total') == 1) {
</pre><pre class="diff" id="context"> if ($reset_payment == true) {
$osC_Session->remove('payment');
}
</pre><pre class="diff"><small id="info">@@ -363,23 +366,27 @@
</small></pre><pre class="diff" id="context"> <?php
$radio_buttons = 0;
</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 . "'");
- 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');
+ $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 colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
</pre><pre class="diff" id="removed">- if ($addresses['address_book_id'] == $osC_Session->value('billto')) {
</pre><pre class="diff" id="added">+ if ($Qaddresses->valueInt('address_book_id') == $osC_Session->value('billto')) {
</pre><pre class="diff" id="context"> echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
} else {
echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
}
?>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</pre><pre class="diff" id="removed">- <td class="main" colspan="2"><b><?php echo $addresses['firstname'] . ' ' . $addresses['lastname']; ?></b></td>
- <td class="main" align="right"><?php echo osc_draw_radio_field('address', $addresses['address_book_id'], $osC_Session->value('billto')); ?></td>
</pre><pre class="diff" id="added">+ <td class="main" colspan="2"><b><?php echo $Qaddresses->valueProtected('firstname') . ' ' . $Qaddresses->valueProtected('lastname'); ?></b></td>
+ <td class="main" align="right"><?php echo osc_draw_radio_field('address', $Qaddresses->valueInt('address_book_id'), $osC_Session->value('billto')); ?></td>
</pre><pre class="diff" id="context"> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
<tr>
</pre><pre class="diff"><small id="info">@@ -387,7 +394,7 @@
</small></pre><pre class="diff" id="context"> <td colspan="3"><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, ' ', ', '); ?></td>
</pre><pre class="diff" id="added">+ <td class="main"><?php echo tep_address_format($format_id, $<span id="addedchars">Qaddresses->toArray()</span>, true, ' ', ', '); ?></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="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>checkout_process.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_process.php?rev=1.131&content-type=text/vnd.viewcvs-markup">1.131</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_process.php.diff?r1=1.131&r2=1.132">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_process.php?rev=1.132&content-type=text/vnd.viewcvs-markup">1.132</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.131 -r1.132
--- checkout_process.php 2004/04/03 10:27:42 1.131
+++ checkout_process.php 2005/02/23 15:28:27 1.132
@@ -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">@@ -53,71 +53,72 @@
</small></pre><pre class="diff" id="context">
$order_totals = $order_total_modules->process();
</pre><pre class="diff" id="removed">- $sql_data_array = array('customers_id' => $osC_Customer->id,
- 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
- 'customers_company' => $order->customer['company'],
- 'customers_street_address' => $order->customer['street_address'],
- 'customers_suburb' => $order->customer['suburb'],
- 'customers_city' => $order->customer['city'],
- 'customers_postcode' => $order->customer['postcode'],
- 'customers_state' => $order->customer['state'],
- 'customers_country' => $order->customer['country']['title'],
- 'customers_telephone' => $order->customer['telephone'],
- 'customers_email_address' => $order->customer['email_address'],
- 'customers_address_format_id' => $order->customer['format_id'],
- 'customers_ip_address' => tep_get_ip_address(),
- 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],
- 'delivery_company' => $order->delivery['company'],
- 'delivery_street_address' => $order->delivery['street_address'],
- 'delivery_suburb' => $order->delivery['suburb'],
- 'delivery_city' => $order->delivery['city'],
- 'delivery_postcode' => $order->delivery['postcode'],
- 'delivery_state' => $order->delivery['state'],
- 'delivery_country' => $order->delivery['country']['title'],
- 'delivery_address_format_id' => $order->delivery['format_id'],
- 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],
- 'billing_company' => $order->billing['company'],
- 'billing_street_address' => $order->billing['street_address'],
- 'billing_suburb' => $order->billing['suburb'],
- 'billing_city' => $order->billing['city'],
- 'billing_postcode' => $order->billing['postcode'],
- 'billing_state' => $order->billing['state'],
- 'billing_country' => $order->billing['country']['title'],
- 'billing_address_format_id' => $order->billing['format_id'],
- 'payment_method' => $order->info['payment_method'],
- 'cc_type' => $order->info['cc_type'],
- 'cc_owner' => $order->info['cc_owner'],
- 'cc_number' => $order->info['cc_number'],
- 'cc_expires' => $order->info['cc_expires'],
- 'date_purchased' => 'now()',
- 'orders_status' => $order->info['order_status'],
- 'currency' => $order->info['currency'],
- 'currency_value' => $order->info['currency_value']);
</pre><pre class="diff" id="added">+ $Qorder = $osC_Database->query('insert into :table_orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, customers_ip_address, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, currency, currency_value) values (:customers_id, :customers_name, :customers_company, :customers_street_address, :cu
stomers_suburb, :customers_city, :customers_postcode, :customers_state, :customers_country
, :customers_telephone, :customers_email_address,<strong class="error">[...]</strong>
+ $Qorder->bindTable(':table_orders', TABLE_ORDERS);
+ $Qorder->bindInt(':customers_id', $osC_Customer->id);
+ $Qorder->bindValue(':customers_name', $order->customer['firstname'] . ' ' . $order->customer['lastname']);
+ $Qorder->bindValue(':customers_company', $order->customer['company']);
+ $Qorder->bindValue(':customers_street_address', $order->customer['street_address']);
+ $Qorder->bindValue(':customers_suburb', $order->customer['suburb']);
+ $Qorder->bindValue(':customers_city', $order->customer['city']);
+ $Qorder->bindValue(':customers_postcode', $order->customer['postcode']);
+ $Qorder->bindValue(':customers_state', $order->customer['state']);
+ $Qorder->bindValue(':customers_country', $order->customer['country']['title']);
+ $Qorder->bindValue(':customers_telephone', $order->customer['telephone']);
+ $Qorder->bindValue(':customers_email_address', $order->customer['email_address']);
+ $Qorder->bindInt(':customers_address_format_id', $order->customer['format_id']);
+ $Qorder->bindValue(':customers_ip_address', tep_get_ip_address());
+ $Qorder->bindValue(':delivery_name', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']);
+ $Qorder->bindValue(':delivery_company', $order->delivery['company']);
+ $Qorder->bindValue(':delivery_street_address', $order->delivery['street_address']);
+ $Qorder->bindValue(':delivery_suburb', $order->delivery['suburb']);
+ $Qorder->bindValue(':delivery_city', $order->delivery['city']);
+ $Qorder->bindValue(':delivery_postcode', $order->delivery['postcode']);
+ $Qorder->bindValue(':delivery_state', $order->delivery['state']);
+ $Qorder->bindValue(':delivery_country', $order->delivery['country']['title']);
+ $Qorder->bindInt(':delivery_address_format_id', $order->delivery['format_id']);
+ $Qorder->bindValue(':billing_name', $order->billing['firstname'] . ' ' . $order->billing['lastname']);
+ $Qorder->bindValue(':billing_company', $order->billing['company']);
+ $Qorder->bindValue(':billing_street_address', $order->billing['street_address']);
+ $Qorder->bindValue(':billing_suburb', $order->billing['suburb']);
+ $Qorder->bindValue(':billing_city', $order->billing['city']);
+ $Qorder->bindValue(':billing_postcode', $order->billing['postcode']);
+ $Qorder->bindValue(':billing_state', $order->billing['state']);
+ $Qorder->bindValue(':billing_country', $order->billing['country']['title']);
+ $Qorder->bindInt(':billing_address_format_id', $order->billing['format_id']);
+ $Qorder->bindValue(':payment_method', $order->info['payment_method']);
+ $Qorder->bindValue(':cc_type', $order->info['cc_type']);
+ $Qorder->bindValue(':cc_owner', $order->info['cc_owner']);
+ $Qorder->bindValue(':cc_number', $order->info['cc_number']);
+ $Qorder->bindValue(':cc_expires', $order->info['cc_expires']);
+ $Qorder->bindRaw(':date_purchased', 'now()');
+ $Qorder->bindValue(':orders_status', $order->info['order_status']);
+ $Qorder->bindValue(':currency', $order->info['currency']);
+ $Qorder->bindValue(':currency_value', $order->info['currency_value']);
+ $Qorder->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- tep_db_perform(TABLE_ORDERS, $sql_data_array);
</pre><pre class="diff" id="added">+ $insert_id = $osC_Database->nextID();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- $insert_id = tep_db_insert_id();
-
</pre><pre class="diff" id="context"> for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
</pre><pre class="diff" id="removed">- $sql_data_array = array('orders_id' => $insert_id,
- 'title' => $order_totals[$i]['title'],
- 'text' => $order_totals[$i]['text'],
- 'value' => $order_totals[$i]['value'],
- 'class' => $order_totals[$i]['code'],
- 'sort_order' => $order_totals[$i]['sort_order']);
-
- tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
</pre><pre class="diff" id="added">+ $Qtotals = $osC_Database->query('insert into :table_orders_total (orders_id, title, text, value, class, sort_order) values (:orders_id, :title, :text, :value, :class, :sort_order)');
+ $Qtotals->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);
+ $Qtotals->bindInt(':orders_id', $insert_id);
+ $Qtotals->bindValue(':title', $order_totals[$i]['title']);
+ $Qtotals->bindValue(':text', $order_totals[$i]['text']);
+ $Qtotals->bindValue(':value', $order_totals[$i]['value']);
+ $Qtotals->bindValue(':class', $order_totals[$i]['code']);
+ $Qtotals->bindInt(':sort_order', $order_totals[$i]['sort_order']);
+ $Qtotals->execute();
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">-
- $customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
-
- $sql_data_array = array('orders_id' => $insert_id,
- 'orders_status_id' => $order->info['order_status'],
- 'date_added' => 'now()',
- 'customer_notified' => $customer_notification,
- 'comments' => $order->info['comments']);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
</pre><pre class="diff" id="added">+ $Qstatus = $osC_Database->query('insert into :table_orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values (:orders_id, :orders_status_id, :date_added, :customer_notified, :comments)');
+ $Qstatus->bindTable(':table_orders_status_history', TABLE_ORDERS_STATUS_HISTORY);
+ $Qstatus->bindInt(':orders_id', $insert_id);
+ $Qstatus->bindInt(':orders_status_id', $order->info['order_status']);
+ $Qstatus->bindRaw(':date_added', 'now()');
+ $Qstatus->bindInt(':customer_notified', (SEND_EMAILS == 'true') ? '1' : '0');
+ $Qstatus->bindValue(':comments', $order->info['comments']);
+ $Qstatus->execute();
</pre><pre class="diff" id="context">
// initialized for the email confirmation
$products_ordered = '';
</pre><pre class="diff"><small id="info">@@ -130,93 +131,127 @@
</small></pre><pre class="diff" id="context"> // Stock Update - Joao Correia
if (STOCK_LIMITED == 'true') {
if (DOWNLOAD_ENABLED == 'true') {
</pre><pre class="diff" id="removed">- $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename
- FROM " . TABLE_PRODUCTS . " p
- LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa
- ON p.products_id=pa.products_id
- LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
- ON pa.products_attributes_id=pad.products_attributes_id
- WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
-// Will work with only one option for downloadable products
-// otherwise, we have to build the query dynamically with a loop
</pre><pre class="diff" id="added">+ $Qstock = $osC_Database->query('select products_quantity, pad.products_attributes_filename from :table_products p left join :table_products_attributes pa on (p.products_id = pa.products_id) left join :table_products_attributes_download pad on (pa.products_attributes_id = pad.products_attributes_id) where p.products_id = :products_id');
+ $Qstock->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qstock->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
+ $Qstock->bindTable(':table_products_attributes_download', TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD);
+ $Qstock->bindInt(':products_id', tep_get_prid($order->products[$i]['id']));
+
+// Will work with only one option for downloadable products otherwise, we have to build the query dynamically with a loop
</pre><pre class="diff" id="context"> $products_attributes = $order->products[$i]['attributes'];
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context"> if (is_array($products_attributes)) {
</pre><pre class="diff" id="removed">- $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
</pre><pre class="diff" id="added">+ $Qstock->appendQuery('and pa.options_id = :options_id and pa.options_values_id = :options_values_id');
+ $Qstock->bindInt(':options_id', $products_attributes[0]['option_id']);
+ $Qstock->bindInt(':options_values_id', $products_attributes[0]['value_id']);
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">- $stock_query = tep_db_query($stock_query_raw);
</pre><pre class="diff" id="context"> } else {
</pre><pre class="diff" id="removed">- $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
</pre><pre class="diff" id="added">+ $Qstock = $osC_Database->query('select products_quantity from :table_products where products_id = :products_id');
+ $Qstock->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qstock->bindInt(':products_id', tep_get_prid($order->products[$i]['id']));
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">- if (tep_db_num_rows($stock_query) > 0) {
- $stock_values = tep_db_fetch_array($stock_query);
</pre><pre class="diff" id="added">+
+ $Qstock->execute();
+
+ if ($Qstock->numberOfRows() > 0) {
+ $stock_left = $Qstock->valueInt('products_quantity');
+
</pre><pre class="diff" id="context"> // do not decrement quantities if products_attributes_filename exists
</pre><pre class="diff" id="removed">- if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {
- $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
- } else {
- $stock_left = $stock_values['products_quantity'];
</pre><pre class="diff" id="added">+ if ((DOWNLOAD_ENABLED != 'true') || ((DOWNLOAD_ENABLED == 'true') && (strlen($Qstock->value('products_attributes_filename')) < 1))) {
+ $stock_left = $stock_left - $order->products[$i]['qty'];
+
+ $Qupdate = $osC_Database->query('update :table_products set products_quantity = :products_quantity where products_id = :products_id');
+ $Qupdate->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qupdate->bindInt(':products_quantity', $stock_left);
+ $Qupdate->bindInt(':products_id', tep_get_prid($order->products[$i]['id']));
+ $Qupdate->execute();
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">- tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
- if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
- tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
</pre><pre class="diff" id="added">+
+ if ((STOCK_ALLOW_CHECKOUT == 'false') && ($stock_left < 1)) {
+ $Qupdate = $osC_Database->query('update :table_products set products_status = :products_status where products_id = :products_id');
+ $Qupdate->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qupdate->bindInt(':products_status', 0);
+ $Qupdate->bindInt(':products_id', tep_get_prid($order->products[$i]['id']));
+ $Qupdate->execute();
</pre><pre class="diff" id="context"> }
}
}
// Update products_ordered (for bestsellers list)
</pre><pre class="diff" id="removed">- tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
</pre><pre class="diff" id="added">+ $Qupdate = $osC_Database->query('update :table_products set products_ordered = products_ordered + :products_ordered where products_id = :products_id');
+ $Qupdate->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qupdate->bindInt(':products_ordered', $order->products[$i]['qty']);
+ $Qupdate->bindInt(':products_id', tep_get_prid($order->products[$i]['id']));
+ $Qupdate->execute();
+
+ $Qproducts = $osC_Database->query('insert into :table_orders_products (orders_id, products_id, products_model, products_name, products_price, final_price, products_tax, products_quantity) values (:orders_id, :products_id, :products_model, :products_name, :products_price, :final_price, :products_tax, :products_quantity)');
+ $Qproducts->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
+ $Qproducts->bindInt(':orders_id', $insert_id);
+ $Qproducts->bindInt(':products_id', tep_get_prid($order->products[$i]['id']));
+ $Qproducts->bindValue(':products_model', $order->products[$i]['model']);
+ $Qproducts->bindValue(':products_name', $order->products[$i]['name']);
+ $Qproducts->bindValue(':products_price', $order->products[$i]['price']);
+ $Qproducts->bindValue(':final_price', $order->products[$i]['final_price']);
+ $Qproducts->bindValue(':products_tax', $order->products[$i]['tax']);
+ $Qproducts->bindInt(':products_quantity', $order->products[$i]['qty']);
+ $Qproducts->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- $sql_data_array = array('orders_id' => $insert_id,
- 'products_id' => tep_get_prid($order->products[$i]['id']),
- 'products_model' => $order->products[$i]['model'],
- 'products_name' => $order->products[$i]['name'],
- 'products_price' => $order->products[$i]['price'],
- 'final_price' => $order->products[$i]['final_price'],
- 'products_tax' => $order->products[$i]['tax'],
- 'products_quantity' => $order->products[$i]['qty']);
- tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
- $order_products_id = tep_db_insert_id();
</pre><pre class="diff" id="added">+ $order_products_id = $osC_Database->nextID();
</pre><pre class="diff" id="context">
//------insert customer choosen option to order--------
$attributes_exist = '0';
$products_ordered_attributes = '';
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context"> if (isset($order->products[$i]['attributes'])) {
$attributes_exist = '1';
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context"> for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
if (DOWNLOAD_ENABLED == 'true') {
</pre><pre class="diff" id="removed">- $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename
- from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
- left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
- on pa.products_attributes_id=pad.products_attributes_id
- where pa.products_id = '" . $order->products[$i]['id'] . "'
- and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'
- and pa.options_id = popt.products_options_id
- and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'
- and pa.options_values_id = poval.products_options_values_id
- and popt.language_id = '" . $osC_Session->value('languages_id') . "'
- and poval.language_id = '" . $osC_Session->value('languages_id') . "'";
- $attributes = tep_db_query($attributes_query);
</pre><pre class="diff" id="added">+ $Qattributes = $osC_Database->query('select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount, pad.products_attributes_filename from :table_products_options popt, :table_products_options_values poval, :table_products_attributes pa left join :table_products_attributes_download pad on (pa.products_attributes_id = pad.products_attributes_id) where pa.products_id = :products_id and pa.options_id = :options_id and pa.options_id = popt.products_options_id and pa.options_values_id = :options_values_id and pa.options_values_id = poval.products_options_values_id and popt.language_id = :popt_language_id and poval.language_id = :poval_language_id');
+ $Qattributes->bindTable(':table_products_options', TABLE_PRODUCTS_OPTIONS);
+ $Qattributes->bindTable(':table_products_options_values', TABLE_PRODUCTS_OPTIONS_VALUES);
+ $Qattributes->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
+ $Qattributes->bindTable(':table_products_attributes_download', TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD);
+ $Qattributes->bindInt(':products_id', $order->products[$i]['id']);
+ $Qattributes->bindInt(':options_id', $order->products[$i]['attributes'][$j]['option_id']);
+ $Qattributes->bindInt(':options_values_id', $order->products[$i]['attributes'][$j]['value_id']);
+ $Qattributes->bindInt(':popt_language_id', $osC_Session->value('languages_id'));
+ $Qattributes->bindInt(':poval_language_id', $osC_Session->value('languages_id'));
</pre><pre class="diff" id="context"> } else {
</pre><pre class="diff" id="removed">- $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $osC_Session->value('languages_id') . "' and poval.language_id = '" . $osC_Session->value('languages_id') . "'");
</pre><pre class="diff" id="added">+ $Qattributes = $osC_Database->query('select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from :table_products_options popt, :table_products_options_values poval, :table_products_attributes pa where pa.products_id = :products_id and pa.options_id = :options_id and pa.options_id = popt.products_options_id and pa.options_values_id = :options_values_id and pa.options_values_id = poval.products_options_values_id and popt.language_id = :popt_language_id and poval.language_id = :poval_language_id');
+ $Qattributes->bindTable(':table_products_options', TABLE_PRODUCTS_OPTIONS);
+ $Qattributes->bindTable(':table_products_options_values', TABLE_PRODUCTS_OPTIONS_VALUES);
+ $Qattributes->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
+ $Qattributes->bindInt(':products_id', $order->products[$i]['id']);
+ $Qattributes->bindInt(':options_id', $order->products[$i]['attributes'][$j]['option_id']);
+ $Qattributes->bindInt(':options_values_id', $order->products[$i]['attributes'][$j]['value_id']);
+ $Qattributes->bindInt(':popt_language_id', $osC_Session->value('languages_id'));
+ $Qattributes->bindInt(':poval_language_id', $osC_Session->value('languages_id'));
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">- $attributes_values = tep_db_fetch_array($attributes);
</pre><pre class="diff" id="added">+ $Qattributes->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- $sql_data_array = array('orders_id' => $insert_id,
- 'orders_products_id' => $order_products_id,
- 'products_options' => $attributes_values['products_options_name'],
- 'products_options_values' => $attributes_values['products_options_values_name'],
- 'options_values_price' => $attributes_values['options_values_price'],
- 'price_prefix' => $attributes_values['price_prefix']);
- tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
-
- if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {
- $sql_data_array = array('orders_id' => $insert_id,
- 'orders_products_id' => $order_products_id,
- 'orders_products_filename' => $attributes_values['products_attributes_filename'],
- 'download_maxdays' => $attributes_values['products_attributes_maxdays'],
- 'download_count' => $attributes_values['products_attributes_maxcount']);
- tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
</pre><pre class="diff" id="added">+ $Qopa = $osC_Database->query('insert into :table_orders_products_attributes (orders_id, orders_products_id, products_options, products_options_values, options_values_price, price_prefix) values (:orders_id, :orders_products_id, :products_options, :products_options_values, :options_values_price, :price_prefix)');
+ $Qopa->bindTable(':table_orders_products_attributes', TABLE_ORDERS_PRODUCTS_ATTRIBUTES);
+ $Qopa->bindInt(':orders_id', $insert_id);
+ $Qopa->bindInt(':orders_products_id', $order_products_id);
+ $Qopa->bindValue(':products_options', $attributes_values['products_options_name']);
+ $Qopa->bindValue(':products_options_values', $attributes_values['products_options_values_name']);
+ $Qopa->bindValue(':options_values_price', $attributes_values['options_values_price']);
+ $Qopa->bindValue(':price_prefix', $attributes_values['price_prefix']);
+ $Qopa->execute();
+
+ if ((DOWNLOAD_ENABLED == 'true') && (strlen($Qattributes->value('products_attributes_filename')) > 0)) {
+ $Qopd = $osC_Database->query('insert into :table_orders_products_download (orders_id, orders_products_id, orders_products_filename, download_maxdays, download_count) values (:orders_id, :orders_products_id, :orders_products_filename, :download_maxdays, :download_count)');
+ $Qopd->bindTable(':table_orders_products_download', TABLE_ORDERS_PRODUCTS_DOWNLOAD);
+ $Qopd->bindInt(':orders_id', $insert_id);
+ $Qopd->bindInt(':orders_products_id', $order_products_id);
+ $Qopd->bindValue(':orders_products_filename', $Qattributes->value('products_attributes_filename'));
+ $Qopd->bindValue(':download_maxdays', $Qattributes->value('products_attributes_maxdays'));
+ $Qopd->bindValue(':download_count', $Qattributes->value('products_attributes_maxcount'));
+ $Qopd->execute();
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">- $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
</pre><pre class="diff" id="added">+
+ $products_ordered_attributes .= "\n\t" . $Qattributes->value('products_options_name') . ' ' . $Qattributes->value('products_options_values_name');
</pre><pre class="diff" id="context"> }
}
//------insert customer choosen option eof ----
</pre><pre class="diff"><small id="info">@@ -234,7 +269,7 @@
</small></pre><pre class="diff" id="context"> EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
if ($order->info['comments']) {
</pre><pre class="diff" id="removed">- $email_order .= tep_<span id="removedchars">db_output</span>($order->info['comments']) . "\n\n";
</pre><pre class="diff" id="added">+ $email_order .= tep_<span id="addedchars">output_string_protected</span>($order->info['comments']) . "\n\n";
</pre><pre class="diff" id="context"> }
$email_order .= EMAIL_TEXT_PRODUCTS . "\n" .
EMAIL_SEPARATOR . "\n" .
</pre><strong class="error" title="1 lines truncated at column 1000">[Note: Some over-long lines of diff output only partialy shown]</strong>
</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>checkout_shipping.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_shipping.php?rev=1.23&content-type=text/vnd.viewcvs-markup">1.23</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_shipping.php.diff?r1=1.23&r2=1.24">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_shipping.php?rev=1.24&content-type=text/vnd.viewcvs-markup">1.24</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.23 -r1.24
--- checkout_shipping.php 2004/07/22 21:43:16 1.23
+++ checkout_shipping.php 2005/02/23 15:28:27 1.24
@@ -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">@@ -35,10 +35,13 @@
</small></pre><pre class="diff" id="context"> $osC_Session->set('sendto', $osC_Customer->default_address_id);
} else {
// verify the selected shipping address
</pre><pre class="diff" id="removed">- $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$osC_Customer->id . "' and address_book_id = '" . (int)$osC_Session->value('sendto') . "'");
- $check_address = tep_db_fetch_array($check_address_query);
</pre><pre class="diff" id="added">+ $Qcheck = $osC_Database->query('select count(*) as total from :table_address_book where customers_id = :customers_id and address_book_id = :address_book_id');
+ $Qcheck->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+ $Qcheck->bindInt(':customers_id', $osC_Customer->id);
+ $Qcheck->bindInt(':address_book_id', $osC_Session->value('sendto'));
+ $Qcheck->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if ($check_address['total'] != '1') {
</pre><pre class="diff" id="added">+ if ($Qcheck->valueInt('total') != 1) {
</pre><pre class="diff" id="context"> $osC_Session->set('sendto', $osC_Customer->default_address_id);
$osC_Session->remove('shipping');
</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>checkout_shipping_address.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_shipping_address.php?rev=1.19&content-type=text/vnd.viewcvs-markup">1.19</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_shipping_address.php.diff?r1=1.19&r2=1.20">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_shipping_address.php?rev=1.20&content-type=text/vnd.viewcvs-markup">1.20</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.19 -r1.20
--- checkout_shipping_address.php 2004/07/22 21:44:58 1.19
+++ checkout_shipping_address.php 2005/02/23 15:28:27 1.20
@@ -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">@@ -194,10 +194,13 @@
</small></pre><pre class="diff" id="context">
$osC_Session->set('sendto', $_POST['address']);
</pre><pre class="diff" id="removed">- $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$osC_Customer->id . "' and address_book_id = '" . (int)$osC_Session->value('sendto') . "'");
- $check_address = tep_db_fetch_array($check_address_query);
</pre><pre class="diff" id="added">+ $Qcheck = $osC_Database->query('select count(*) as total from :table_address_book where customers_id = :customers_id and address_book_id = :address_book_id');
+ $Qcheck->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+ $Qcheck->bindInt(':customers_id', $osC_Customer->id);
+ $Qcheck->bindInt(':address_book_id', $osC_Session->value('sendto'));
+ $Qcheck->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if ($check_address['total'] == '1') {
</pre><pre class="diff" id="added">+ if ($Qcheck->valueInt('total') == 1) {
</pre><pre class="diff" id="context"> if ($reset_shipping == true) {
$osC_Session->remove('shipping');
}
</pre><pre class="diff"><small id="info">@@ -374,23 +377,27 @@
</small></pre><pre class="diff" id="context"> <?php
$radio_buttons = 0;
</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 . "'");
- 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');
+ $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 colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
</pre><pre class="diff" id="removed">- if ($addresses['address_book_id'] == $osC_Session->value('sendto')) {
</pre><pre class="diff" id="added">+ if ($Qaddresses->valueInt('address_book_id') == $osC_Session->value('sendto')) {
</pre><pre class="diff" id="context"> echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
} else {
echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
}
?>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</pre><pre class="diff" id="removed">- <td class="main" colspan="2"><b><?php echo tep_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']); ?></b></td>
- <td class="main" align="right"><?php echo osc_draw_radio_field('address', $addresses['address_book_id'], $osC_Session->value('sendto')); ?></td>
</pre><pre class="diff" id="added">+ <td class="main" colspan="2"><b><?php echo $Qaddresses->valueProtected('firstname') . ' ' . $Qaddresses->valueProtected('lastname'); ?></b></td>
+ <td class="main" align="right"><?php echo osc_draw_radio_field('address', $Qaddresses->valueInt('address_book_id'), $osC_Session->value('sendto')); ?></td>
</pre><pre class="diff" id="context"> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
<tr>
</pre><pre class="diff"><small id="info">@@ -398,7 +405,7 @@
</small></pre><pre class="diff" id="context"> <td colspan="3"><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, ' ', ', '); ?></td>
</pre><pre class="diff" id="added">+ <td class="main"><?php echo tep_address_format($format_id, $<span id="addedchars">Qaddresses->toArray()</span>, true, ' ', ', '); ?></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="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>checkout_success.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_success.php?rev=1.51&content-type=text/vnd.viewcvs-markup">1.51</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_success.php.diff?r1=1.51&r2=1.52">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/checkout_success.php?rev=1.52&content-type=text/vnd.viewcvs-markup">1.52</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.51 -r1.52
--- checkout_success.php 2004/07/22 17:23:53 1.51
+++ checkout_success.php 2005/02/23 15:28:27 1.52
@@ -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">@@ -34,18 +34,26 @@
</small></pre><pre class="diff" id="context"> $breadcrumb->add(NAVBAR_TITLE_1);
$breadcrumb->add(NAVBAR_TITLE_2);
</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();
+
+ if ($Qglobal->valueInt('global_product_notifications') !== 1) {
+ $Qorder = $osC_Database->query('select orders_id from :table_orders where customers_id = :customers_id order by date_purchased desc limit 1');
+ $Qorder->bindTable(':table_orders', TABLE_ORDERS);
+ $Qorder->bindInt(':customers_id', $osC_Customer->id);
+ $Qorder->execute();
+
+ $Qproducts = $osC_Database->query('select products_id, products_name from :table_orders_products where orders_id = :orders_id order by products_name');
+ $Qproducts->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
+ $Qproducts->bindInt(':orders_id', $Qorder->valueInt('orders_id'));
+ $Qproducts->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if ($global['global_product_notifications'] != '1') {
- $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$osC_Customer->id . "' order by date_purchased desc limit 1");
- $orders = tep_db_fetch_array($orders_query);
-
</pre><pre class="diff" id="context"> $products_array = array();
</pre><pre class="diff" id="removed">- $products_query = tep_db_query("select products_id, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$orders['orders_id'] . "' order by products_name");
- while ($products = tep_db_fetch_array($products_query)) {
- $products_array[] = array('id' => $products['products_id'],
- 'text' => $products['products_name']);
</pre><pre class="diff" id="added">+ while ($Qproducts->next()) {
+ $products_array[] = array('id' => $Qproducts->valueInt('products_id'),
+ 'text' => $Qproducts->value('products_name'));
</pre><pre class="diff" id="context"> }
}
?>
</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