[ 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/includes/boxes/ -> order_history.php (source)

   1  <?php
   2  /*
   3    $Id: order_history.php,v 1.5 2003/06/09 22:18:30 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    if (tep_session_is_registered('customer_id')) {
  14  // retreive the last x products purchased
  15      $orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
  16      if (tep_db_num_rows($orders_query)) {
  17  ?>
  18  <!-- customer_orders //-->
  19            <tr>
  20              <td>
  21  <?php
  22        $info_box_contents = array();
  23        $info_box_contents[] = array('text' => BOX_HEADING_CUSTOMER_ORDERS);
  24  
  25        new infoBoxHeading($info_box_contents, false, false);
  26  
  27        $product_ids = '';
  28        while ($orders = tep_db_fetch_array($orders_query)) {
  29          $product_ids .= (int)$orders['products_id'] . ',';
  30        }
  31        $product_ids = substr($product_ids, 0, -1);
  32  
  33        $customer_orders_string = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
  34        $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int)$languages_id . "' order by products_name");
  35        while ($products = tep_db_fetch_array($products_query)) {
  36          $customer_orders_string .= '  <tr>' .
  37                                     '    <td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></td>' .
  38                                     '    <td class="infoBoxContents" align="right" valign="top"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '</a></td>' .
  39                                     '  </tr>';
  40        }
  41        $customer_orders_string .= '</table>';
  42  
  43        $info_box_contents = array();
  44        $info_box_contents[] = array('text' => $customer_orders_string);
  45  
  46        new infoBox($info_box_contents);
  47  ?>
  48              </td>
  49            </tr>
  50  <!-- customer_orders_eof //-->
  51  <?php
  52      }
  53    }
  54  ?>


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