[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/includes/modules/pages/account/ -> header_php.php (source)

   1  <?php
   2  /**

   3   * Header code file for the customer's Account page

   4   *

   5   * @package page

   6   * @copyright Copyright 2003-2006 Zen Cart Development Team

   7   * @copyright Portions Copyright 2003 osCommerce

   8   * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0

   9   * @version $Id: header_php.php 4824 2006-10-23 21:01:28Z drbyte $

  10   */
  11  // This should be first line of the script:

  12  $zco_notifier->notify('NOTIFY_HEADER_START_ACCOUNT');
  13  $customer_has_gv_balance = false;
  14  $customer_gv_balance = false;
  15  
  16  if (!$_SESSION['customer_id']) {
  17    $_SESSION['navigation']->set_snapshot();
  18    zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
  19  }
  20  $gv_query = "SELECT amount
  21               FROM " . TABLE_COUPON_GV_CUSTOMER . "
  22               WHERE customer_id = :customersID";
  23  
  24  $gv_query = $db->bindVars($gv_query, ':customersID', $_SESSION['customer_id'], 'integer');
  25  $gv_result = $db->Execute($gv_query);
  26  
  27  if ($gv_result->RecordCount() && $gv_result->fields['amount'] > 0 ) {
  28    $customer_has_gv_balance = true;
  29    $customer_gv_balance = $currencies->format($gv_result->fields['amount']);
  30  }
  31  
  32  require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
  33  
  34  $breadcrumb->add(NAVBAR_TITLE);
  35  $orders_query = "SELECT o.orders_id, o.date_purchased, o.delivery_name,
  36                          o.delivery_country, o.billing_name, o.billing_country,
  37                          ot.text as order_total, s.orders_status_name
  38                   FROM   " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . "  ot, " . TABLE_ORDERS_STATUS . " s
  39                   WHERE  o.customers_id = :customersID
  40                   AND    o.orders_id = ot.orders_id
  41                   AND    ot.class = 'ot_total'
  42                   AND    o.orders_status = s.orders_status_id
  43                   AND   s.language_id = :languagesID
  44                   ORDER BY orders_id DESC LIMIT 3";
  45  
  46  $orders_query = $db->bindVars($orders_query, ':customersID', $_SESSION['customer_id'], 'integer');
  47  $orders_query = $db->bindVars($orders_query, ':languagesID', $_SESSION['languages_id'], 'integer');
  48  $orders = $db->Execute($orders_query);
  49  
  50  $ordersArray = array();
  51  while (!$orders->EOF) {
  52    if (zen_not_null($orders->fields['delivery_name'])) {
  53      $order_name = $orders->fields['delivery_name'];
  54      $order_country = $orders->fields['delivery_country'];
  55    } else {
  56      $order_name = $orders->fields['billing_name'];
  57      $order_country = $orders->fields['billing_country'];
  58    }
  59  
  60    $ordersArray[] = array('orders_id'=>$orders->fields['orders_id'],
  61    'date_purchased'=>$orders->fields['date_purchased'],
  62    'order_name'=>$order_name,
  63    'order_country'=>$order_country,
  64    'orders_status_name'=>$orders->fields['orders_status_name'],
  65    'order_total'=>$orders->fields['order_total']
  66    );
  67  
  68    $orders->MoveNext();
  69  }
  70  
  71  // This should be last line of the script:

  72  $zco_notifier->notify('NOTIFY_HEADER_END_ACCOUNT');
  73  ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics