  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: order.php 368 2005-12-22 16:27:23Z hpdl $ |
| |
| 3 | + | $Id: order.php 383 2006-01-09 16:35:46Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
40 | 40 | | /* Public methods */ |
| |
41 | 41 | | |
| |
42 | 42 | | function &getListing($limit = null, $page_keyword = 'page') { |
  |
43 | | - | global $osC_Database, $osC_Customer; |
| |
| 43 | + | global $osC_Database, $osC_Customer, $osC_Language; |
|
44 | 44 | | |
| |
45 | 45 | | $Qorders = $osC_Database->query('select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, ot.text as order_total, s.orders_status_name from :table_orders o, :table_orders_total ot, :table_orders_status s where o.customers_id = :customers_id and o.orders_id = ot.orders_id and ot.class = "ot_total" and o.orders_status = s.orders_status_id and s.language_id = :language_id order by orders_id desc'); |
| |
46 | 46 | | $Qorders->bindTable(':table_orders', TABLE_ORDERS); |
| |
47 | 47 | | $Qorders->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL); |
| |
48 | 48 | | $Qorders->bindTable(':table_orders_status', TABLE_ORDERS_STATUS); |
| |
49 | 49 | | $Qorders->bindInt(':customers_id', $osC_Customer->getID()); |
  |
50 | | - | $Qorders->bindInt(':language_id', $_SESSION['languages_id']); |
| |
| 50 | + | $Qorders->bindInt(':language_id', $osC_Language->getID()); |
|
51 | 51 | | |
| |
52 | 52 | | if (is_numeric($limit)) { |
| |
53 | 53 | | $Qorders->setBatchLimit(isset($_GET[$page_keyword]) && is_numeric($_GET[$page_keyword]) ? $_GET[$page_keyword] : 1, $limit); |
| |
|
|
 |
… |
|
59 | 59 | | } |
| |
60 | 60 | | |
| |
61 | 61 | | function &getStatusListing($id = null) { |
  |
62 | | - | global $osC_Database; |
| |
| 62 | + | global $osC_Database, $osC_Language; |
|
63 | 63 | | |
| |
64 | 64 | | if ( ($id === null) && isset($this) ) { |
| |
65 | 65 | | $id = $this->_id; |
| |
|
|
 |
… |
|
69 | 69 | | $Qstatus->bindTable(':table_orders_status', TABLE_ORDERS_STATUS); |
| |
70 | 70 | | $Qstatus->bindTable(':table_orders_status_history', TABLE_ORDERS_STATUS_HISTORY); |
| |
71 | 71 | | $Qstatus->bindInt(':orders_id', $id); |
  |
72 | | - | $Qstatus->bindInt(':language_id', $_SESSION['languages_id']); |
| |
| 72 | + | $Qstatus->bindInt(':language_id', $osC_Language->getID()); |
|
73 | 73 | | |
| |
74 | 74 | | return $Qstatus; |
| |
75 | 75 | | } |
| |
|
|
 |
… |
|
127 | 127 | | |
| |
128 | 128 | | |
| |
129 | 129 | | function query($order_id) { |
  |
130 | | - | global $osC_Database; |
| |
| 130 | + | global $osC_Database, $osC_Language; |
|
131 | 131 | | |
| |
132 | 132 | | $Qorder = $osC_Database->query('select 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, 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, currency, currency_value, date_purchased, orders_status, last_modified from :table_orders where orders_id = :orders_id'); |
| |
133 | 133 | | $Qorder->bindTable(':table_orders', TABLE_ORDERS); |
| |
|
|
 |
… |
|
162 | 162 | | $Qstatus = $osC_Database->query('select orders_status_name from :table_orders_status where orders_status_id = :orders_status_id and language_id = :language_id'); |
| |
163 | 163 | | $Qstatus->bindTable(':table_orders_status', TABLE_ORDERS_STATUS); |
| |
164 | 164 | | $Qstatus->bindInt(':orders_status_id', $Qorder->valueInt('orders_status')); |
  |
165 | | - | $Qstatus->bindInt(':language_id', $_SESSION['languages_id']); |
| |
| 165 | + | $Qstatus->bindInt(':language_id', $osC_Language->getID()); |
|
166 | 166 | | $Qstatus->execute(); |
| |
167 | 167 | | |
| |
168 | 168 | | $this->info = array('currency' => $Qorder->value('currency'), |
| |
|
|
 |
… |
|
257 | 257 | | } |
| |
258 | 258 | | |
| |
259 | 259 | | function cart() { |
  |
260 | | - | global $osC_Database, $osC_Customer, $osC_Tax, $osC_Currencies; |
| |
| 260 | + | global $osC_Database, $osC_Customer, $osC_Tax, $osC_Currencies, $osC_Language; |
|
261 | 261 | | |
| |
262 | 262 | | $this->content_type = $_SESSION['cart']->get_content_type(); |
| |
263 | 263 | | |
| |
|
|
 |
… |
|
384 | 384 | | $Qattributes->bindInt(':products_id', $products[$i]['id']); |
| |
385 | 385 | | $Qattributes->bindInt(':options_id', $option); |
| |
386 | 386 | | $Qattributes->bindInt(':options_values_id', $value); |
  |
387 | | - | $Qattributes->bindInt(':language_id', $_SESSION['languages_id']); |
| |
388 | | - | $Qattributes->bindInt(':language_id', $_SESSION['languages_id']); |
| |
| 387 | + | $Qattributes->bindInt(':language_id', $osC_Language->getID()); |
| |
| 388 | + | $Qattributes->bindInt(':language_id', $osC_Language->getID()); |
  |
389 | 389 | | $Qattributes->execute(); |
| |
390 | 390 | | |
| |
391 | 391 | | $this->products[$index]['attributes'][$subindex] = array('option' => $Qattributes->value('products_options_name'), |