[ Index ]
 

Code source de osCommerce 2.2ms2-060817

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/catalog/admin/includes/classes/ -> order.php (source)

   1  <?php
   2  /*
   3    $Id: order.php,v 1.7 2003/06/20 16:23:08 hpdl Exp $
   4  
   5    osCommerce, Open Source E-Commerce Solutions
   6    http://www.oscommerce.com
   7  
   8    Copyright (c) 2003 osCommerce
   9  
  10    Released under the GNU General Public License
  11  */
  12  
  13    class order {
  14      var $info, $totals, $products, $customer, $delivery;
  15  
  16      function order($order_id) {
  17        $this->info = array();
  18        $this->totals = array();
  19        $this->products = array();
  20        $this->customer = array();
  21        $this->delivery = array();
  22  
  23        $this->query($order_id);
  24      }
  25  
  26      function query($order_id) {
  27        $order_query = tep_db_query("select 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 = '" . (int)$order_id . "'");
  28        $order = tep_db_fetch_array($order_query);
  29  
  30        $totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
  31        while ($totals = tep_db_fetch_array($totals_query)) {
  32          $this->totals[] = array('title' => $totals['title'],
  33                                  'text' => $totals['text']);
  34        }
  35  
  36        $this->info = array('currency' => $order['currency'],
  37                            'currency_value' => $order['currency_value'],
  38                            'payment_method' => $order['payment_method'],
  39                            'cc_type' => $order['cc_type'],
  40                            'cc_owner' => $order['cc_owner'],
  41                            'cc_number' => $order['cc_number'],
  42                            'cc_expires' => $order['cc_expires'],
  43                            'date_purchased' => $order['date_purchased'],
  44                            'orders_status' => $order['orders_status'],
  45                            'last_modified' => $order['last_modified']);
  46  
  47        $this->customer = array('name' => $order['customers_name'],
  48                                'company' => $order['customers_company'],
  49                                'street_address' => $order['customers_street_address'],
  50                                'suburb' => $order['customers_suburb'],
  51                                'city' => $order['customers_city'],
  52                                'postcode' => $order['customers_postcode'],
  53                                'state' => $order['customers_state'],
  54                                'country' => $order['customers_country'],
  55                                'format_id' => $order['customers_address_format_id'],
  56                                'telephone' => $order['customers_telephone'],
  57                                'email_address' => $order['customers_email_address']);
  58  
  59        $this->delivery = array('name' => $order['delivery_name'],
  60                                'company' => $order['delivery_company'],
  61                                'street_address' => $order['delivery_street_address'],
  62                                'suburb' => $order['delivery_suburb'],
  63                                'city' => $order['delivery_city'],
  64                                'postcode' => $order['delivery_postcode'],
  65                                'state' => $order['delivery_state'],
  66                                'country' => $order['delivery_country'],
  67                                'format_id' => $order['delivery_address_format_id']);
  68  
  69        $this->billing = array('name' => $order['billing_name'],
  70                               'company' => $order['billing_company'],
  71                               'street_address' => $order['billing_street_address'],
  72                               'suburb' => $order['billing_suburb'],
  73                               'city' => $order['billing_city'],
  74                               'postcode' => $order['billing_postcode'],
  75                               'state' => $order['billing_state'],
  76                               'country' => $order['billing_country'],
  77                               'format_id' => $order['billing_address_format_id']);
  78  
  79        $index = 0;
  80        $orders_products_query = tep_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
  81        while ($orders_products = tep_db_fetch_array($orders_products_query)) {
  82          $this->products[$index] = array('qty' => $orders_products['products_quantity'],
  83                                          'name' => $orders_products['products_name'],
  84                                          'model' => $orders_products['products_model'],
  85                                          'tax' => $orders_products['products_tax'],
  86                                          'price' => $orders_products['products_price'],
  87                                          'final_price' => $orders_products['final_price']);
  88  
  89          $subindex = 0;
  90          $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
  91          if (tep_db_num_rows($attributes_query)) {
  92            while ($attributes = tep_db_fetch_array($attributes_query)) {
  93              $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'],
  94                                                                       'value' => $attributes['products_options_values'],
  95                                                                       'prefix' => $attributes['price_prefix'],
  96                                                                       'price' => $attributes['options_values_price']);
  97  
  98              $subindex++;
  99            }
 100          }
 101          $index++;
 102        }
 103      }
 104    }
 105  ?>


Généré le : Mon Nov 26 19:48:25 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics