Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

521
 
531
 
531
 
order.php
_> 11 <?php
  22 /*
<> 3 -  $Id: order.php 521 2006-04-25 14:33:00Z hpdl $
   3+  $Id: order.php 531 2006-04-25 15:42:48Z hpdl $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
     
 !
9393         $Qdel->bindInt(':orders_id', $id);
  9494         $Qdel->execute();
  9595       }
<>  96+
   97+      if (isset($_SESSION['prepOrderID'])) {
   98+        unset($_SESSION['prepOrderID']);
   99+      }
96100     }
  97101 
  98102     function insert() {
  99103       global $osC_Database, $osC_Customer, $osC_Language, $osC_Currencies, $osC_ShoppingCart;
  100104 
<>  105+      if (isset($_SESSION['prepOrderID'])) {
   106+        $_prep = explode('-', $_SESSION['prepOrderID']);
   107+
   108+        if ($_prep[0] == $osC_ShoppingCart->getCartID()) {
   109+          return $_prep[1]; // order_id
   110+        } else {
   111+          if (osC_Order::getStatusID($_prep[1]) === 4) {
   112+            osC_Order::remove($_prep[1]);
   113+          }
   114+        }
   115+      }
   116+
101117       $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, payment_module, 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, :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, :payment_module, :cc_type, :cc_owner, :cc_number, :cc_expires, now(), :orders_status, :currency, :currency_value)');
  102118       $Qorder->bindTable(':table_orders', TABLE_ORDERS);
  103119       $Qorder->bindInt(':customers_id', $osC_Customer->getID());
     
 !
229245         }
  230246       }
  231247 
<>  248+      $_SESSION['prepOrderID'] = $osC_ShoppingCart->getCartID() . '-' . $insert_id;
   249+
232250       return $insert_id;
  233251     }
  234252 
     
 !
317335         $Qupdate->bindInt(':products_id', $Qproducts->valueInt('products_id'));
  318336         $Qupdate->execute();
  319337       }
<>  338+
   339+      unset($_SESSION['prepOrderID']);
320340     }
  321341 
<> 322 -
  323 -
<_ 324342     function &getListing($limit = null, $page_keyword = 'page') {
  325343       global $osC_Database, $osC_Customer, $osC_Language;
  326344