Quick Search:

View

Revision:

Diff

Diff from 724 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/tags/oscommerce-2.2ms2-20060817/catalog/account_history.php

Annotated File View

hpdl
477
1 <?php
2 /*
3   $Id: account_history.php,v 1.63 2003/06/09 23:03:52 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   require('includes/application_top.php');
14
15   if (!tep_session_is_registered('customer_id')) {
16     $navigation->set_snapshot();
17     tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
18   }
19
20   require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY);
21
22   $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
23   $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
24 ?>
25 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
26 <html <?php echo HTML_PARAMS; ?>>
27 <head>
28 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
29 <title><?php echo TITLE; ?></title>
30 <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
31 <link rel="stylesheet" type="text/css" href="stylesheet.css">
32 </head>
33 <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
34 <!-- header //-->
35 <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
36 <!-- header_eof //-->
37
38 <!-- body //-->
39 <table border="0" width="100%" cellspacing="3" cellpadding="3">
40   <tr>
41     <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
42 <!-- left_navigation //-->
43 <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
44 <!-- left_navigation_eof //-->
45     </table></td>
46 <!-- body_text //-->
47     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
48       <tr>
49         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
50           <tr>
51             <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
52             <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
53           </tr>
54         </table></td>
55       </tr>
56       <tr>
57         <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
58       </tr>
59       <tr>
60         <td>
61 <?php
62   $orders_total = tep_count_customer_orders();
63
64   if ($orders_total > 0) {
65     $history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, 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 = '" . (int)$customer_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 = '" . (int)$languages_id . "' order by orders_id DESC";
66     $history_split = new splitPageResults($history_query_raw, MAX_DISPLAY_ORDER_HISTORY);
67     $history_query = tep_db_query($history_split->sql_query);
68
69     while ($history = tep_db_fetch_array($history_query)) {
70       $products_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$history['orders_id'] . "'");
71       $products = tep_db_fetch_array($products_query);
72
73       if (tep_not_null($history['delivery_name'])) {
74         $order_type = TEXT_ORDER_SHIPPED_TO;
75         $order_name = $history['delivery_name'];
76       } else {
77         $order_type = TEXT_ORDER_BILLED_TO;
78         $order_name = $history['billing_name'];
79       }
80 ?>
81           <table border="0" width="100%" cellspacing="0" cellpadding="2">
82             <tr>
83               <td class="main"><?php echo '<b>' . TEXT_ORDER_NUMBER . '</b> ' . $history['orders_id']; ?></td>
84               <td class="main" align="right"><?php echo '<b>' . TEXT_ORDER_STATUS . '</b> ' . $history['orders_status_name']; ?></td>
85             </tr>
86           </table>
87           <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
88             <tr class="infoBoxContents">
89               <td><table border="0" width="100%" cellspacing="2" cellpadding="4">
90                 <tr>
91                   <td class="main" width="50%" valign="top"><?php echo '<b>' . TEXT_ORDER_DATE . '</b> ' . tep_date_long($history['date_purchased']) . '<br><b>' . $order_type . '</b> ' . tep_output_string_protected($order_name); ?></td>
92                   <td class="main" width="30%" valign="top"><?php echo '<b>' . TEXT_ORDER_PRODUCTS . '</b> ' . $products['count'] . '<br><b>' . TEXT_ORDER_COST . '</b> ' . strip_tags($history['order_total']); ?></td>
93                   <td class="main" width="20%"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'order_id=' . $history['orders_id'], 'SSL') . '">' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
94                 </tr>
95               </table></td>
96             </tr>
97           </table>
98           <table border="0" width="100%" cellspacing="0" cellpadding="2">
99             <tr>
100               <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
101             </tr>
102           </table>
103 <?php
104     }
105   } else {
106 ?>
107           <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
108             <tr class="infoBoxContents">
109               <td><table border="0" width="100%" cellspacing="2" cellpadding="4">
110                 <tr>
111                   <td class="main"><?php echo TEXT_NO_PURCHASES; ?></td>
112                 </tr>
113               </table></td>
114             </tr>
115           </table>
116 <?php
117   }
118 ?>
119         </td>
120       </tr>
121 <?php
122   if ($orders_total > 0) {
123 ?>
124       <tr>
125         <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
126           <tr>
127             <td class="smallText" valign="top"><?php echo $history_split->display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
128             <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $history_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
129           </tr>
130         </table></td>
131       </tr>
132 <?php
133   }
134 ?>
135       <tr>
136         <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
137       </tr>
138       <tr>
139         <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
140           <tr class="infoBoxContents">
141             <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
142               <tr>
143                 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
144                 <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
145                 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
146               </tr>
147             </table></td>
148           </tr>
149         </table></td>
150       </tr>
151     </table></td>
152 <!-- body_text_eof //-->
153     <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
154 <!-- right_navigation //-->
155 <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
156 <!-- right_navigation_eof //-->
157     </table></td>
158   </tr>
159 </table>
160 <!-- body_eof //-->
161
162 <!-- footer //-->
163 <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
164 <!-- footer_eof //-->
165 <br>
166 </body>
167 </html>
168 <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>