[TEP-COMMIT] [CVS catalog] use the new database class

hpdl-OfajU3CKLf1/[email protected] 24 Feb 2005 00:38:09 -0000
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
<html>
<head>
<style><!--
  body {background-color:#ffffff;}
  .file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
  .pathname {font-family:monospace; float:right;}
  .fileheader {margin-bottom:.5em;}
  .diff {margin:0;}
  .tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
  .tasklist ul {margin-top:0;margin-bottom:0;}
  tr.alt {background-color:#eeeeee}
  #added {background-color:#ddffdd;}
  #addedchars {background-color:#99ff99;font-weight:bolder;}
  tr.alt #added {background-color:#ccf7cc;}
  #removed {background-color:#ffdddd;}
  #removedchars {background-color:#ff9999;font-weight:bolder;}
  tr.alt #removed {background-color:#f7cccc;}
  #info {color:#888888;}
  #context {background-color:#eeeeee;}
  td {padding-left:.3em;padding-right:.3em;}
  tr.head {border-bottom-width:1px;border-bottom-style:solid;}
  tr.head td {padding:0;padding-top:.2em;}
  .task {background-color:#ffff00;}
  .comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
  .error {color:red;}
  hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>catalog/catalog/includes/modules/shipping</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">flat.php</a></tt></td><td align="right" id="added">+27</td><td align="right" id="removed">-14</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/flat.php?rev=1.41&amp;content-type=text/vnd.viewcvs-markup">1.41</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/flat.php.diff?r1=1.41&amp;r2=1.42">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/flat.php?rev=1.42&amp;content-type=text/vnd.viewcvs-markup">1.42</a></td></tr>
<tr class="alt"><td><tt><a href="#file2">item.php</a></tt></td><td align="right" id="added">+28</td><td align="right" id="removed">-15</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/item.php?rev=1.40&amp;content-type=text/vnd.viewcvs-markup">1.40</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/item.php.diff?r1=1.40&amp;r2=1.41">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/item.php?rev=1.41&amp;content-type=text/vnd.viewcvs-markup">1.41</a></td></tr>
<tr><td><tt><a href="#file3">table.php</a></tt></td><td align="right" id="added">+30</td><td align="right" id="removed">-17</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/table.php?rev=1.29&amp;content-type=text/vnd.viewcvs-markup">1.29</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/table.php.diff?r1=1.29&amp;r2=1.30">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/table.php?rev=1.30&amp;content-type=text/vnd.viewcvs-markup">1.30</a></td></tr>
<tr class="alt"><td><tt><a href="#file4">ups.php</a></tt></td><td align="right" id="added">+31</td><td align="right" id="removed">-18</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/ups.php?rev=1.56&amp;content-type=text/vnd.viewcvs-markup">1.56</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/ups.php.diff?r1=1.56&amp;r2=1.57">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/ups.php?rev=1.57&amp;content-type=text/vnd.viewcvs-markup">1.57</a></td></tr>
<tr><td><tt><a href="#file5">usps.php</a></tt></td><td align="right" id="added">+30</td><td align="right" id="removed">-17</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/usps.php?rev=1.49&amp;content-type=text/vnd.viewcvs-markup">1.49</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/usps.php.diff?r1=1.49&amp;r2=1.50">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/usps.php?rev=1.50&amp;content-type=text/vnd.viewcvs-markup">1.50</a></td></tr>
<tr class="alt"><td><tt><a href="#file6">zones.php</a></tt></td><td align="right" id="added">+36</td><td align="right" id="removed">-26</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/zones.php?rev=1.22&amp;content-type=text/vnd.viewcvs-markup">1.22</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/zones.php.diff?r1=1.22&amp;r2=1.23">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/zones.php?rev=1.23&amp;content-type=text/vnd.viewcvs-markup">1.23</a></td></tr>
<tr><td></td><td align="right" id="added">+182</td><td align="right" id="removed">-107</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>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules">modules</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping">shipping</a><br /></span>
<div class="fileheader"><big><b>flat.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/flat.php?rev=1.41&amp;content-type=text/vnd.viewcvs-markup">1.41</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/flat.php.diff?r1=1.41&amp;r2=1.42">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/flat.php?rev=1.42&amp;content-type=text/vnd.viewcvs-markup">1.42</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.41 -r1.42
--- flat.php	2003/11/17 20:36:50	1.41
+++ flat.php	2005/02/24 00:38:03	1.42
@@ -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">@@ -15,7 +15,7 @@
</small></pre><pre class="diff" id="context"> 
 // class constructor
     function flat() {
</pre><pre class="diff" id="removed">-      global $order;
</pre><pre class="diff" id="added">+      global $osC_Database, $order;
</pre><pre class="diff" id="context"> 
       $this-&gt;code = 'flat';
       $this-&gt;title = MODULE_SHIPPING_FLAT_TEXT_TITLE;
</pre><pre class="diff"><small id="info">@@ -27,12 +27,18 @@
</small></pre><pre class="diff" id="context"> 
       if ( ($this-&gt;enabled == true) &amp;&amp; ((int)MODULE_SHIPPING_FLAT_ZONE &gt; 0) ) {
         $check_flag = false;
</pre><pre class="diff" id="removed">-        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_ZONE . "' and zone_country_id = '" . $order-&gt;delivery['country']['id'] . "' order by zone_id");
-        while ($check = tep_db_fetch_array($check_query)) {
-          if ($check['zone_id'] &lt; 1) {
</pre><pre class="diff" id="added">+
+        $Qcheck = $osC_Database-&gt;query('select zone_id from :table_zones_to_geo_zones where geo_zone_id = :geo_zone_id and zone_country_id = :zone_country_id order by zone_id');
+        $Qcheck-&gt;bindTable(':table_zones_to_geo_zones', TABLE_ZONES_TO_GEO_ZONES);
+        $Qcheck-&gt;bindInt(':geo_zone_id', MODULE_SHIPPING_FLAT_ZONE);
+        $Qcheck-&gt;bindInt(':zone_country_id', $order-&gt;delivery['country']['id']);
+        $Qcheck-&gt;execute();
+
+        while ($Qcheck-&gt;next()) {
+          if ($Qcheck-&gt;valueInt('zone_id') &lt; 1) {
</pre><pre class="diff" id="context">             $check_flag = true;
             break;
</pre><pre class="diff" id="removed">-          } elseif ($<span id="removedchars">check['zone_id']</span> == $order-&gt;delivery['zone_id']) {
</pre><pre class="diff" id="added">+          } elseif ($<span id="addedchars">Qcheck-&gt;valueInt('zone_id')</span> == $order-&gt;delivery['zone_id']) {
</pre><pre class="diff" id="context">             $check_flag = true;
             break;
           }
</pre><pre class="diff"><small id="info">@@ -66,22 +72,29 @@
</small></pre><pre class="diff" id="context"> 
     function check() {
       if (!isset($this-&gt;_check)) {
</pre><pre class="diff" id="removed">-        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FLAT_STATUS'");
-        $this-&gt;_check = tep_db_num_rows($check_query);
</pre><pre class="diff" id="added">+        $this-&gt;_check = defined('MODULE_SHIPPING_FLAT_STATUS');
</pre><pre class="diff" id="context">       }
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context">       return $this-&gt;_check;
     }
 
     function install() {
</pre><pre class="diff" id="removed">-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Flat Shipping', 'MODULE_SHIPPING_FLAT_STATUS', 'True', 'Do you want to offer flat rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_FLAT_COST', '5.00', 'The shipping cost for all orders using this shipping method.', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_FLAT_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_FLAT_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_FLAT_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
</pre><pre class="diff" id="added">+      global $osC_Database;
+
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Flat Shipping', 'MODULE_SHIPPING_FLAT_STATUS', 'True', 'Do you want to offer flat rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_FLAT_COST', '5.00', 'The shipping cost for all orders using this shipping method.', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_FLAT_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_FLAT_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_FLAT_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
</pre><pre class="diff" id="context">     }
 
     function remove() {
</pre><pre class="diff" id="removed">-      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this-&gt;keys()) . "')");
</pre><pre class="diff" id="added">+      global $osC_Database;
+
+      $Qdel = $osC_Database-&gt;query('delete from :table_configuration where configuration_key in (":configuration_key")');
+      $Qdel-&gt;bindTable(':table_configuration', TABLE_CONFIGURATION);
+      $Qdel-&gt;bindRaw(':configuration_key', implode('", "', $this-&gt;keys()));
+      $Qdel-&gt;execute();
</pre><pre class="diff" id="context">     }
 
     function keys() {
</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>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules">modules</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping">shipping</a><br /></span>
<div class="fileheader"><big><b>item.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/item.php?rev=1.40&amp;content-type=text/vnd.viewcvs-markup">1.40</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/item.php.diff?r1=1.40&amp;r2=1.41">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/item.php?rev=1.41&amp;content-type=text/vnd.viewcvs-markup">1.41</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.40 -r1.41
--- item.php	2003/11/17 20:36:50	1.40
+++ item.php	2005/02/24 00:38:03	1.41
@@ -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">@@ -15,7 +15,7 @@
</small></pre><pre class="diff" id="context"> 
 // class constructor
     function item() {
</pre><pre class="diff" id="removed">-      global $order;
</pre><pre class="diff" id="added">+      global $osC_Database, $order;
</pre><pre class="diff" id="context"> 
       $this-&gt;code = 'item';
       $this-&gt;title = MODULE_SHIPPING_ITEM_TEXT_TITLE;
</pre><pre class="diff"><small id="info">@@ -27,12 +27,18 @@
</small></pre><pre class="diff" id="context"> 
       if ( ($this-&gt;enabled == true) &amp;&amp; ((int)MODULE_SHIPPING_ITEM_ZONE &gt; 0) ) {
         $check_flag = false;
</pre><pre class="diff" id="removed">-        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ITEM_ZONE . "' and zone_country_id = '" . $order-&gt;delivery['country']['id'] . "' order by zone_id");
-        while ($check = tep_db_fetch_array($check_query)) {
-          if ($check['zone_id'] &lt; 1) {
</pre><pre class="diff" id="added">+
+        $Qcheck = $osC_Database-&gt;query('select zone_id from :table_zones_to_geo_zones where geo_zone_id = :geo_zone_id and zone_country_id = :zone_country_id order by zone_id');
+        $Qcheck-&gt;bindTable(':table_zones_to_geo_zones', TABLE_ZONES_TO_GEO_ZONES);
+        $Qcheck-&gt;bindInt(':geo_zone_id', MODULE_SHIPPING_ITEM_ZONE);
+        $Qcheck-&gt;bindInt(':zone_country_id', $order-&gt;delivery['country']['id']);
+        $Qcheck-&gt;execute();
+
+        while ($Qcheck-&gt;next()) {
+          if ($Qcheck-&gt;valueInt('zone_id') &lt; 1) {
</pre><pre class="diff" id="context">             $check_flag = true;
             break;
</pre><pre class="diff" id="removed">-          } elseif ($<span id="removedchars">check['zone_id']</span> == $order-&gt;delivery['zone_id']) {
</pre><pre class="diff" id="added">+          } elseif ($<span id="addedchars">Qcheck-&gt;valueInt('zone_id')</span> == $order-&gt;delivery['zone_id']) {
</pre><pre class="diff" id="context">             $check_flag = true;
             break;
           }
</pre><pre class="diff"><small id="info">@@ -66,23 +72,30 @@
</small></pre><pre class="diff" id="context"> 
     function check() {
       if (!isset($this-&gt;_check)) {
</pre><pre class="diff" id="removed">-        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ITEM_STATUS'");
-        $this-&gt;_check = tep_db_num_rows($check_query);
</pre><pre class="diff" id="added">+        $this-&gt;_check = defined('MODULE_SHIPPING_ITEM_STATUS');
</pre><pre class="diff" id="context">       }
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context">       return $this-&gt;_check;
     }
 
     function install() {
</pre><pre class="diff" id="removed">-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Item Shipping', 'MODULE_SHIPPING_ITEM_STATUS', 'True', 'Do you want to offer per item rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_ITEM_COST', '2.50', 'The shipping cost will be multiplied by the number of items in an order that uses this shipping method.', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_ITEM_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ITEM_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_ITEM_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ITEM_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
</pre><pre class="diff" id="added">+      global $osC_Database;
+
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Item Shipping', 'MODULE_SHIPPING_ITEM_STATUS', 'True', 'Do you want to offer per item rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_ITEM_COST', '2.50', 'The shipping cost will be multiplied by the number of items in an order that uses this shipping method.', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_ITEM_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ITEM_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_ITEM_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ITEM_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
</pre><pre class="diff" id="context">     }
 
     function remove() {
</pre><pre class="diff" id="removed">-      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this-&gt;keys()) . "')");
</pre><pre class="diff" id="added">+      global $osC_Database;
+
+      $Qdel = $osC_Database-&gt;query('delete from :table_configuration where configuration_key in (":configuration_key")');
+      $Qdel-&gt;bindTable(':table_configuration', TABLE_CONFIGURATION);
+      $Qdel-&gt;bindRaw(':configuration_key', implode('", "', $this-&gt;keys()));
+      $Qdel-&gt;execute();
</pre><pre class="diff" id="context">     }
 
     function keys() {
</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>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules">modules</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping">shipping</a><br /></span>
<div class="fileheader"><big><b>table.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/table.php?rev=1.29&amp;content-type=text/vnd.viewcvs-markup">1.29</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/table.php.diff?r1=1.29&amp;r2=1.30">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/table.php?rev=1.30&amp;content-type=text/vnd.viewcvs-markup">1.30</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.29 -r1.30
--- table.php	2004/04/15 16:05:40	1.29
+++ table.php	2005/02/24 00:38:03	1.30
@@ -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">@@ -15,7 +15,7 @@
</small></pre><pre class="diff" id="context"> 
 // class constructor
     function table() {
</pre><pre class="diff" id="removed">-      global $order;
</pre><pre class="diff" id="added">+      global $osC_Database, $order;
</pre><pre class="diff" id="context"> 
       $this-&gt;code = 'table';
       $this-&gt;title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
</pre><pre class="diff"><small id="info">@@ -27,12 +27,18 @@
</small></pre><pre class="diff" id="context"> 
       if ( ($this-&gt;enabled == true) &amp;&amp; ((int)MODULE_SHIPPING_TABLE_ZONE &gt; 0) ) {
         $check_flag = false;
</pre><pre class="diff" id="removed">-        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE_ZONE . "' and zone_country_id = '" . $order-&gt;delivery['country']['id'] . "' order by zone_id");
-        while ($check = tep_db_fetch_array($check_query)) {
-          if ($check['zone_id'] &lt; 1) {
</pre><pre class="diff" id="added">+
+        $Qcheck = $osC_Database-&gt;query('select zone_id from :table_zones_to_geo_zones where geo_zone_id = :geo_zone_id and zone_country_id = :zone_country_id order by zone_id');
+        $Qcheck-&gt;bindTable(':table_zones_to_geo_zones', TABLE_ZONES_TO_GEO_ZONES);
+        $Qcheck-&gt;bindInt(':geo_zone_id', MODULE_SHIPPING_TABLE_ZONE);
+        $Qcheck-&gt;bindInt(':zone_country_id', $order-&gt;delivery['country']['id']);
+        $Qcheck-&gt;execute();
+
+        while ($Qcheck-&gt;next()) {
+          if ($Qcheck-&gt;valueInt('zone_id') &lt; 1) {
</pre><pre class="diff" id="context">             $check_flag = true;
             break;
</pre><pre class="diff" id="removed">-          } elseif ($<span id="removedchars">check['zone_id']</span> == $order-&gt;delivery['zone_id']) {
</pre><pre class="diff" id="added">+          } elseif ($<span id="addedchars">Qcheck-&gt;valueInt('zone_id')</span> == $order-&gt;delivery['zone_id']) {
</pre><pre class="diff" id="context">             $check_flag = true;
             break;
           }
</pre><pre class="diff"><small id="info">@@ -85,25 +91,32 @@
</small></pre><pre class="diff" id="context"> 
     function check() {
       if (!isset($this-&gt;_check)) {
</pre><pre class="diff" id="removed">-        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_TABLE_STATUS'");
-        $this-&gt;_check = tep_db_num_rows($check_query);
</pre><pre class="diff" id="added">+        $this-&gt;_check = defined('MODULE_SHIPPING_TABLE_STATUS');
</pre><pre class="diff" id="context">       }
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context">       return $this-&gt;_check;
     }
 
     function install() {
</pre><pre class="diff" id="removed">-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Table Method', 'MODULE_SHIPPING_TABLE_STATUS', 'True', 'Do you want to offer table rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Table', 'MODULE_SHIPPING_TABLE_COST', '25:8.50,50:5.50,10000:0.00', 'The shipping cost is based on the total cost or weight of items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Table Method', 'MODULE_SHIPPING_TABLE_MODE', 'weight', 'The shipping cost is based on the order total or the total weight of the items ordered.', '6', '0', 'tep_cfg_select_option(array(\'weight\', \'price\'), ', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_TABLE_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_TABLE_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_TABLE_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_TABLE_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Module weight Unit', 'MODULE_SHIPPING_TABLE_WEIGHT_UNIT', '2', 'What unit of weight does this shipping module use?.', '6', '0', 'tep_get_weight_class_title', 'tep_cfg_pull_down_weight_classes(', now())");
</pre><pre class="diff" id="added">+      global $osC_Database;
+
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Table Method', 'MODULE_SHIPPING_TABLE_STATUS', 'True', 'Do you want to offer table rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Table', 'MODULE_SHIPPING_TABLE_COST', '25:8.50,50:5.50,10000:0.00', 'The shipping cost is based on the total cost or weight of items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Table Method', 'MODULE_SHIPPING_TABLE_MODE', 'weight', 'The shipping cost is based on the order total or the total weight of the items ordered.', '6', '0', 'tep_cfg_select_option(array(\'weight\', \'price\'), ', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_TABLE_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_TABLE_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_TABLE_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_TABLE_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Module weight Unit', 'MODULE_SHIPPING_TABLE_WEIGHT_UNIT', '2', 'What unit of weight does this shipping module use?.', '6', '0', 'tep_get_weight_class_title', 'tep_cfg_pull_down_weight_classes(', now())");
</pre><pre class="diff" id="context">     }
 
     function remove() {
</pre><pre class="diff" id="removed">-      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this-&gt;keys()) . "')");
</pre><pre class="diff" id="added">+      global $osC_Database;
+
+      $Qdel = $osC_Database-&gt;query('delete from :table_configuration where configuration_key in (":configuration_key")');
+      $Qdel-&gt;bindTable(':table_configuration', TABLE_CONFIGURATION);
+      $Qdel-&gt;bindRaw(':configuration_key', implode('", "', $this-&gt;keys()));
+      $Qdel-&gt;execute();
</pre><pre class="diff" id="context">     }
 
     function keys() {
</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>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules">modules</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping">shipping</a><br /></span>
<div class="fileheader"><big><b>ups.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/ups.php?rev=1.56&amp;content-type=text/vnd.viewcvs-markup">1.56</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/ups.php.diff?r1=1.56&amp;r2=1.57">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/ups.php?rev=1.57&amp;content-type=text/vnd.viewcvs-markup">1.57</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.56 -r1.57
--- ups.php	2004/04/15 16:05:40	1.56
+++ ups.php	2005/02/24 00:38:03	1.57
@@ -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">@@ -15,7 +15,7 @@
</small></pre><pre class="diff" id="context"> 
 // class constructor
     function ups() {
</pre><pre class="diff" id="removed">-      global $order;
</pre><pre class="diff" id="added">+      global $osC_Database, $order;
</pre><pre class="diff" id="context"> 
       $this-&gt;code = 'ups';
       $this-&gt;title = MODULE_SHIPPING_UPS_TEXT_TITLE;
</pre><pre class="diff"><small id="info">@@ -27,12 +27,18 @@
</small></pre><pre class="diff" id="context"> 
       if ( ($this-&gt;enabled == true) &amp;&amp; ((int)MODULE_SHIPPING_UPS_ZONE &gt; 0) ) {
         $check_flag = false;
</pre><pre class="diff" id="removed">-        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_UPS_ZONE . "' and zone_country_id = '" . $order-&gt;delivery['country']['id'] . "' order by zone_id");
-        while ($check = tep_db_fetch_array($check_query)) {
-          if ($check['zone_id'] &lt; 1) {
</pre><pre class="diff" id="added">+
+        $Qcheck = $osC_Database-&gt;query('select zone_id from :table_zones_to_geo_zones where geo_zone_id = :geo_zone_id and zone_country_id = :zone_country_id order by zone_id');
+        $Qcheck-&gt;bindTable(':table_zones_to_geo_zones', TABLE_ZONES_TO_GEO_ZONES);
+        $Qcheck-&gt;bindInt(':geo_zone_id', MODULE_SHIPPING_UPS_ZONE);
+        $Qcheck-&gt;bindInt(':zone_country_id', $order-&gt;delivery['country']['id']);
+        $Qcheck-&gt;execute();
+
+        while ($Qcheck-&gt;next()) {
+          if ($Qcheck-&gt;valueInt('zone_id') &lt; 1) {
</pre><pre class="diff" id="context">             $check_flag = true;
             break;
</pre><pre class="diff" id="removed">-          } elseif ($<span id="removedchars">check['zone_id']</span> == $order-&gt;delivery['zone_id']) {
</pre><pre class="diff" id="added">+          } elseif ($<span id="addedchars">Qcheck-&gt;valueInt('zone_id')</span> == $order-&gt;delivery['zone_id']) {
</pre><pre class="diff" id="context">             $check_flag = true;
             break;
           }
</pre><pre class="diff"><small id="info">@@ -122,26 +128,33 @@
</small></pre><pre class="diff" id="context"> 
     function check() {
       if (!isset($this-&gt;_check)) {
</pre><pre class="diff" id="removed">-        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_UPS_STATUS'");
-        $this-&gt;_check = tep_db_num_rows($check_query);
</pre><pre class="diff" id="added">+        $this-&gt;_check = defined('MODULE_SHIPPING_UPS_STATUS');
</pre><pre class="diff" id="context">       }
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context">       return $this-&gt;_check;
     }
 
     function install() {
</pre><pre class="diff" id="removed">-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable UPS Shipping', 'MODULE_SHIPPING_UPS_STATUS', 'True', 'Do you want to offer UPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Pickup Method', 'MODULE_SHIPPING_UPS_PICKUP', 'CC', 'How do you give packages to UPS? CC - Customer Counter, RDP - Daily Pickup, OTP - One Time Pickup, LC - Letter Center, OCA - On Call Air', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Packaging?', 'MODULE_SHIPPING_UPS_PACKAGE', 'CP', 'CP - Your Packaging, ULE - UPS Letter, UT - UPS Tube, UBE - UPS Express Box', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Residential Delivery?', 'MODULE_SHIPPING_UPS_RES', 'RES', 'Quote for Residential (RES) or Commercial Delivery (COM)', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_UPS_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_UPS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_UPS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_UPS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Module weight Unit', 'MODULE_SHIPPING_UPS_WEIGHT_UNIT', '2', 'What unit of weight does this shipping module use?.', '6', '0', 'tep_get_weight_class_title', 'tep_cfg_pull_down_weight_classes(', now())");
</pre><pre class="diff" id="added">+      global $osC_Database;
+
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable UPS Shipping', 'MODULE_SHIPPING_UPS_STATUS', 'True', 'Do you want to offer UPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Pickup Method', 'MODULE_SHIPPING_UPS_PICKUP', 'CC', 'How do you give packages to UPS? CC - Customer Counter, RDP - Daily Pickup, OTP - One Time Pickup, LC - Letter Center, OCA - On Call Air', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Packaging?', 'MODULE_SHIPPING_UPS_PACKAGE', 'CP', 'CP - Your Packaging, ULE - UPS Letter, UT - UPS Tube, UBE - UPS Express Box', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Residential Delivery?', 'MODULE_SHIPPING_UPS_RES', 'RES', 'Quote for Residential (RES) or Commercial Delivery (COM)', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_UPS_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_UPS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_UPS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_UPS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Module weight Unit', 'MODULE_SHIPPING_UPS_WEIGHT_UNIT', '2', 'What unit of weight does this shipping module use?.', '6', '0', 'tep_get_weight_class_title', 'tep_cfg_pull_down_weight_classes(', now())");
</pre><pre class="diff" id="context">     }
 
     function remove() {
</pre><pre class="diff" id="removed">-      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this-&gt;keys()) . "')");
</pre><pre class="diff" id="added">+      global $osC_Database;
+
+      $Qdel = $osC_Database-&gt;query('delete from :table_configuration where configuration_key in (":configuration_key")');
+      $Qdel-&gt;bindTable(':table_configuration', TABLE_CONFIGURATION);
+      $Qdel-&gt;bindRaw(':configuration_key', implode('", "', $this-&gt;keys()));
+      $Qdel-&gt;execute();
</pre><pre class="diff" id="context">     }
 
     function keys() {
</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>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules">modules</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping">shipping</a><br /></span>
<div class="fileheader"><big><b>usps.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/usps.php?rev=1.49&amp;content-type=text/vnd.viewcvs-markup">1.49</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/usps.php.diff?r1=1.49&amp;r2=1.50">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/usps.php?rev=1.50&amp;content-type=text/vnd.viewcvs-markup">1.50</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.49 -r1.50
--- usps.php	2004/02/14 19:40:45	1.49
+++ usps.php	2005/02/24 00:38:03	1.50
@@ -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">@@ -15,7 +15,7 @@
</small></pre><pre class="diff" id="context"> 
 // class constructor
     function usps() {
</pre><pre class="diff" id="removed">-      global $order;
</pre><pre class="diff" id="added">+      global $osC_Database, $order;
</pre><pre class="diff" id="context"> 
       $this-&gt;code = 'usps';
       $this-&gt;title = MODULE_SHIPPING_USPS_TEXT_TITLE;
</pre><pre class="diff"><small id="info">@@ -27,12 +27,18 @@
</small></pre><pre class="diff" id="context"> 
       if ( ($this-&gt;enabled == true) &amp;&amp; ((int)MODULE_SHIPPING_USPS_ZONE &gt; 0) ) {
         $check_flag = false;
</pre><pre class="diff" id="removed">-        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_USPS_ZONE . "' and zone_country_id = '" . $order-&gt;delivery['country']['id'] . "' order by zone_id");
-        while ($check = tep_db_fetch_array($check_query)) {
-          if ($check['zone_id'] &lt; 1) {
</pre><pre class="diff" id="added">+
+        $Qcheck = $osC_Database-&gt;query('select zone_id from :table_zones_to_geo_zones where geo_zone_id = :geo_zone_id and zone_country_id = :zone_country_id order by zone_id');
+        $Qcheck-&gt;bindTable(':table_zones_to_geo_zones', TABLE_ZONES_TO_GEO_ZONES);
+        $Qcheck-&gt;bindInt(':geo_zone_id', MODULE_SHIPPING_USPS_ZONE);
+        $Qcheck-&gt;bindInt(':zone_country_id', $order-&gt;delivery['country']['id']);
+        $Qcheck-&gt;execute();
+
+        while ($Qcheck-&gt;next()) {
+          if ($Qcheck-&gt;valueInt('zone_id') &lt; 1) {
</pre><pre class="diff" id="context">             $check_flag = true;
             break;
</pre><pre class="diff" id="removed">-          } elseif ($<span id="removedchars">check['zone_id']</span> == $order-&gt;delivery['zone_id']) {
</pre><pre class="diff" id="added">+          } elseif ($<span id="addedchars">Qcheck-&gt;valueInt('zone_id')</span> == $order-&gt;delivery['zone_id']) {
</pre><pre class="diff" id="context">             $check_flag = true;
             break;
           }
</pre><pre class="diff"><small id="info">@@ -119,25 +125,32 @@
</small></pre><pre class="diff" id="context"> 
     function check() {
       if (!isset($this-&gt;_check)) {
</pre><pre class="diff" id="removed">-        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_USPS_STATUS'");
-        $this-&gt;_check = tep_db_num_rows($check_query);
</pre><pre class="diff" id="added">+        $this-&gt;_check = defined('MODULE_SHIPPING_USPS_STATUS');
</pre><pre class="diff" id="context">       }
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context">       return $this-&gt;_check;
     }
 
     function install() {
</pre><pre class="diff" id="removed">-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable USPS Shipping', 'MODULE_SHIPPING_USPS_STATUS', 'True', 'Do you want to offer USPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the USPS User ID', 'MODULE_SHIPPING_USPS_USERID', 'NONE', 'Enter the USPS USERID assigned to you.', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the USPS Password', 'MODULE_SHIPPING_USPS_PASSWORD', 'NONE', 'See USERID, above.', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Which server to use', 'MODULE_SHIPPING_USPS_SERVER', 'production', 'An account at USPS is needed to use the Production server', '6', '0', 'tep_cfg_select_option(array(\'test\', \'production\'), ', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_USPS_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_USPS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_USPS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_USPS_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
</pre><pre class="diff" id="added">+      global $osC_Database;
+
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable USPS Shipping', 'MODULE_SHIPPING_USPS_STATUS', 'True', 'Do you want to offer USPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the USPS User ID', 'MODULE_SHIPPING_USPS_USERID', 'NONE', 'Enter the USPS USERID assigned to you.', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the USPS Password', 'MODULE_SHIPPING_USPS_PASSWORD', 'NONE', 'See USERID, above.', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Which server to use', 'MODULE_SHIPPING_USPS_SERVER', 'production', 'An account at USPS is needed to use the Production server', '6', '0', 'tep_cfg_select_option(array(\'test\', \'production\'), ', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_USPS_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_USPS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_USPS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_USPS_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
</pre><pre class="diff" id="context">     }
 
     function remove() {
</pre><pre class="diff" id="removed">-      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this-&gt;keys()) . "')");
</pre><pre class="diff" id="added">+      global $osC_Database;
+
+      $Qdel = $osC_Database-&gt;query('delete from :table_configuration where configuration_key in (":configuration_key")');
+      $Qdel-&gt;bindTable(':table_configuration', TABLE_CONFIGURATION);
+      $Qdel-&gt;bindRaw(':configuration_key', implode('", "', $this-&gt;keys()));
+      $Qdel-&gt;execute();
</pre><pre class="diff" id="context">     }
 
     function keys() {
</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>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules">modules</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping">shipping</a><br /></span>
<div class="fileheader"><big><b>zones.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/zones.php?rev=1.22&amp;content-type=text/vnd.viewcvs-markup">1.22</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/zones.php.diff?r1=1.22&amp;r2=1.23">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/shipping/zones.php?rev=1.23&amp;content-type=text/vnd.viewcvs-markup">1.23</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.22 -r1.23
--- zones.php	2004/04/15 16:05:40	1.22
+++ zones.php	2005/02/24 00:38:04	1.23
@@ -6,23 +6,23 @@
</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
 
   USAGE
   By default, the module comes with support for 1 zone.  This can be
</pre><pre class="diff" id="removed">-  easily changed by editing the line below in the zones constructor<span id="removedchars">&nbsp;</span>
</pre><pre class="diff" id="added">+  easily changed by editing the line below in the zones constructor
</pre><pre class="diff" id="context">   that defines $this-&gt;num_zones.
 
   Next, you will want to activate the module by going to the Admin screen,
   clicking on Modules, then clicking on Shipping.  A list of all shipping
</pre><pre class="diff" id="removed">-  modules should appear.  Click on the green dot next to the one labeled<span id="removedchars">&nbsp;</span>
</pre><pre class="diff" id="added">+  modules should appear.  Click on the green dot next to the one labeled
</pre><pre class="diff" id="context">   zones.php.  A list of settings will appear to the right.  Click on the
</pre><pre class="diff" id="removed">-  Edit button.<span id="removedchars">&nbsp;</span>
</pre><pre class="diff" id="added">+  Edit button.
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">-  PLEASE NOTE THAT YOU WILL LOSE YOUR CURRENT SHIPPING RATES AND OTHER 
-  SETTINGS IF YOU TURN OFF THIS SHIPPING METHOD.  Make sure you keep a 
</pre><pre class="diff" id="added">+  PLEASE NOTE THAT YOU WILL LOSE YOUR CURRENT SHIPPING RATES AND OTHER
+  SETTINGS IF YOU TURN OFF THIS SHIPPING METHOD.  Make sure you keep a
</pre><pre class="diff" id="context">   backup of your shipping settings somewhere at all times.
 
   If you want an additional handling charge applied to orders that use this
</pre><pre class="diff"><small id="info">@@ -31,7 +31,7 @@
</small></pre><pre class="diff" id="context">   Next, you will need to define which countries are in each zone.  Determining
   this might take some time and effort.  You should group a set of countries
   that has similar shipping charges for the same weight.  For instance, when
</pre><pre class="diff" id="removed">-  shipping from the US, the countries of Japan, Australia, New Zealand, and<span id="removedchars">&nbsp;</span>
</pre><pre class="diff" id="added">+  shipping from the US, the countries of Japan, Australia, New Zealand, and
</pre><pre class="diff" id="context">   Singapore have similar shipping rates.  As an example, one of my customers
   is using this set of zones:
     1: USA
</pre><pre class="diff"><small id="info">@@ -56,11 +56,11 @@
</small></pre><pre class="diff" id="context">   some time and effort will go into setting the appropriate rates.  You
   will define a set of weight ranges and the shipping price for each
   range.  For instance, you might want an order than weighs more than 0
</pre><pre class="diff" id="removed">-  and less than or equal to 3 to cost 5.50 to ship to a certain zone.<span id="removedchars">&nbsp;&nbsp;</span>
</pre><pre class="diff" id="added">+  and less than or equal to 3 to cost 5.50 to ship to a certain zone.
</pre><pre class="diff" id="context">   This would be defined by this:  3:5.5
 
   You should combine a bunch of these rates together in a comma delimited
</pre><pre class="diff" id="removed">-  list and enter them into the "Zone X Shipping Table" fields where "X"<span id="removedchars">&nbsp;</span>
</pre><pre class="diff" id="added">+  list and enter them into the "Zone X Shipping Table" fields where "X"
</pre><pre class="diff" id="context">   is the zone number.  For example, this might be used for Zone 1:
     1:3.5,2:3.95,3:5.2,4:6.45,5:7.7,6:10.4,7:11.85, 8:13.3,9:14.75,10:16.2,11:17.65,
     12:19.1,13:20.55,14:22,15:23.45
</pre><pre class="diff"><small id="info">@@ -73,24 +73,24 @@
</small></pre><pre class="diff" id="context">   At this time, it does not deal with weights that are above the highest amount
   defined.  This will probably be the next area to be improved with the
   module.  For now, you could have one last very high range with a very
</pre><pre class="diff" id="removed">-  high shipping rate to discourage orders of that magnitude.  For<span id="removedchars">&nbsp;</span>
</pre><pre class="diff" id="added">+  high shipping rate to discourage orders of that magnitude.  For
</pre><pre class="diff" id="context">   instance:  999:1000
 
</pre><pre class="diff" id="removed">-  If you want to be able to ship to any country in the world, you will<span id="removedchars">&nbsp;</span>
</pre><pre class="diff" id="added">+  If you want to be able to ship to any country in the world, you will
</pre><pre class="diff" id="context">   need to enter every country code into the Country fields. For most
</pre><pre class="diff" id="removed">-  shops, you will not want to enter every country.  This is often<span id="removedchars">&nbsp;</span>
</pre><pre class="diff" id="added">+  shops, you will not want to enter every country.  This is often
</pre><pre class="diff" id="context">   because of too much fraud from certain places. If a country is not
   listed, then the module will add a $0.00 shipping charge and will
</pre><pre class="diff" id="removed">-  indicate that shipping is not available to that destination.<span id="removedchars">&nbsp;&nbsp;</span>
</pre><pre class="diff" id="added">+  indicate that shipping is not available to that destination.
</pre><pre class="diff" id="context">   PLEASE NOTE THAT THE ORDER CAN STILL BE COMPLETED AND PROCESSED!
 
</pre><pre class="diff" id="removed">-  It appears that the osC shipping system automatically rounds the<span id="removedchars">&nbsp;</span>
</pre><pre class="diff" id="added">+  It appears that the osC shipping system automatically rounds the
</pre><pre class="diff" id="context">   shipping weight up to the nearest whole unit.  This makes it more
</pre><pre class="diff" id="removed">-  difficult to design precise shipping tables.  If you want to, you<span id="removedchars">&nbsp;</span>
</pre><pre class="diff" id="added">+  difficult to design precise shipping tables.  If you want to, you
</pre><pre class="diff" id="context">   can hack the shipping.php file to get rid of the rounding.
 
   Lastly, there is a limit of 255 characters on each of the Zone
</pre><pre class="diff" id="removed">-  Shipping Tables and Zone Countries.<span id="removedchars">&nbsp;</span>
</pre><pre class="diff" id="added">+  Shipping Tables and Zone Countries.
</pre><pre class="diff" id="context"> 
 */
 
</pre><pre class="diff"><small id="info">@@ -174,30 +174,40 @@
</small></pre><pre class="diff" id="context"> 
     function check() {
       if (!isset($this-&gt;_check)) {
</pre><pre class="diff" id="removed">-        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_STATUS'");
-        $this-&gt;_check = tep_db_num_rows($check_query);
</pre><pre class="diff" id="added">+        $this-&gt;_check = defined('MODULE_SHIPPING_ZONES_STATUS');
</pre><pre class="diff" id="context">       }
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context">       return $this-&gt;_check;
     }
 
     function install() {
</pre><pre class="diff" id="removed">-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Zones Method', 'MODULE_SHIPPING_ZONES_STATUS', 'True', 'Do you want to offer zone rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ZONES_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
-      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ZONES_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
</pre><pre class="diff" id="added">+      global $osC_Database;
+
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Zones Method', 'MODULE_SHIPPING_ZONES_STATUS', 'True', 'Do you want to offer zone rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ZONES_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ZONES_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+
</pre><pre class="diff" id="context">       for ($i = 1; $i &lt;= $this-&gt;num_zones; $i++) {
         $default_countries = '';
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context">         if ($i == 1) {
           $default_countries = 'US,CA';
         }
</pre><pre class="diff" id="removed">-        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_ZONES_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '6', '0', now())");
-        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_ZONES_COST_" . $i ."', '3:8.50,7:10.50,99:20.00', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())");
-        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Handling Fee', 'MODULE_SHIPPING_ZONES_HANDLING_" . $i."', '0', 'Handling Fee for this shipping zone', '6', '0', now())");
-        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Module weight Unit', 'MODULE_SHIPPING_ZONES_WEIGHT_UNIT', '2', 'What unit of weight does this shipping module use?.', '6', '0', 'tep_get_weight_class_title', 'tep_cfg_pull_down_weight_classes(', now())");
</pre><pre class="diff" id="added">+
+        $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_ZONES_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '6', '0', now())");
+        $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_ZONES_COST_" . $i ."', '3:8.50,7:10.50,99:20.00', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())");
+        $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Handling Fee', 'MODULE_SHIPPING_ZONES_HANDLING_" . $i."', '0', 'Handling Fee for this shipping zone', '6', '0', now())");
+        $osC_Database-&gt;simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Module weight Unit', 'MODULE_SHIPPING_ZONES_WEIGHT_UNIT', '2', 'What unit of weight does this shipping module use?.', '6', '0', 'tep_get_weight_class_title', 'tep_cfg_pull_down_weight_classes(', now())");
</pre><pre class="diff" id="context">       }
     }
 
     function remove() {
</pre><pre class="diff" id="removed">-      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this-&gt;keys()) . "')");
</pre><pre class="diff" id="added">+      global $osC_Database;
+
+      $Qdel = $osC_Database-&gt;query('delete from :table_configuration where configuration_key in (":configuration_key")');
+      $Qdel-&gt;bindTable(':table_configuration', TABLE_CONFIGURATION);
+      $Qdel-&gt;bindRaw(':configuration_key', implode('", "', $this-&gt;keys()));
+      $Qdel-&gt;execute();
</pre><pre class="diff" id="context">     }
 
     function keys() {
</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