hpdl
|
1
|
1
|
<?php
|
|
2
|
/*
|
hpdl
|
121
|
3
|
$Id: orders.php 1763 2007-12-27 21:27:48Z frank $
|
hpdl
|
1
|
4
|
|
|
5
|
osCommerce, Open Source E-Commerce Solutions
|
|
6
|
http://www.oscommerce.com
|
|
7
|
|
hpdl
|
1371
|
8
|
Copyright (c) 2007 osCommerce
|
hpdl
|
1
|
9
|
|
hpdl
|
1498
|
10
|
This program is free software; you can redistribute it and/or modify
|
|
11
|
it under the terms of the GNU General Public License v2 (1991)
|
|
12
|
as published by the Free Software Foundation.
|
hpdl
|
1
|
13
|
*/
|
|
14
|
|
hpdl
|
1371
|
15
|
if ( !class_exists('osC_Summary') ) {
|
hpdl
|
1
|
16
|
include('includes/classes/summary.php');
|
|
17
|
}
|
|
18
|
|
|
19
|
class osC_Summary_orders extends osC_Summary {
|
|
20
|
|
|
21
|
/* Class constructor */
|
|
22
|
|
|
23
|
function osC_Summary_orders() {
|
hpdl
|
1492
|
24
|
global $osC_Language;
|
|
25
|
|
|
26
|
$osC_Language->loadIniFile('modules/summary/orders.php');
|
|
27
|
|
|
28
|
$this->_title = $osC_Language->get('summary_orders_title');
|
hpdl
|
1076
|
29
|
$this->_title_link = osc_href_link_admin(FILENAME_DEFAULT, 'orders');
|
hpdl
|
1
|
30
|
|
hpdl
|
1371
|
31
|
if ( osC_Access::hasAccess('orders') ) {
|
hpdl
|
1078
|
32
|
$this->_setData();
|
|
33
|
}
|
hpdl
|
1
|
34
|
}
|
|
35
|
|
|
36
|
/* Private methods */
|
|
37
|
|
|
38
|
function _setData() {
|
hpdl
|
755
|
39
|
global $osC_Database, $osC_Language;
|
hpdl
|
1
|
40
|
|
|
41
|
$this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' .
|
|
42
|
' <thead>' .
|
|
43
|
' <tr>' .
|
hpdl
|
1492
|
44
|
' <th>' . $osC_Language->get('summary_orders_table_heading_orders') . '</th>' .
|
|
45
|
' <th>' . $osC_Language->get('summary_orders_table_heading_total') . '</th>' .
|
|
46
|
' <th>' . $osC_Language->get('summary_orders_table_heading_date') . '</th>' .
|
|
47
|
' <th>' . $osC_Language->get('summary_orders_table_heading_status') . '</th>' .
|
hpdl
|
1
|
48
|
' </tr>' .
|
|
49
|
' </thead>' .
|
|
50
|
' <tbody>';
|
|
51
|
|
hpdl
|
930
|
52
|
$Qorders = $osC_Database->query('select o.orders_id, o.customers_name, greatest(o.date_purchased, ifnull(o.last_modified, 0)) as date_last_modified, s.orders_status_name, ot.text as order_total from :table_orders o, :table_orders_total ot, :table_orders_status s where o.orders_id = ot.orders_id and ot.class = "total" and o.orders_status = s.orders_status_id and s.language_id = :language_id order by date_last_modified desc limit 6');
|
hpdl
|
1
|
53
|
$Qorders->bindTable(':table_orders', TABLE_ORDERS);
|
|
54
|
$Qorders->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);
|
|
55
|
$Qorders->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
|
hpdl
|
121
|
56
|
$Qorders->bindInt(':language_id', $osC_Language->getID());
|
hpdl
|
1
|
57
|
$Qorders->execute();
|
|
58
|
|
hpdl
|
1371
|
59
|
while ( $Qorders->next() ) {
|
hpdl
|
365
|
60
|
$this->_data .= ' <tr onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' .
|
hpdl
|
1492
|
61
|
' <td>' . osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, 'orders&oID=' . $Qorders->valueInt('orders_id') . '&action=save'), osc_icon('orders.png') . ' ' . $Qorders->valueProtected('customers_name')) . '</td>' .
|
hpdl
|
1
|
62
|
' <td>' . strip_tags($Qorders->value('order_total')) . '</td>' .
|
frank
|
1763
|
63
|
' <td>' . osC_DateTime::getShort($Qorders->value('date_last_modified')) . '</td>' .
|
hpdl
|
1
|
64
|
' <td>' . $Qorders->value('orders_status_name') . '</td>' .
|
|
65
|
' </tr>';
|
|
66
|
}
|
|
67
|
|
|
68
|
$this->_data .= ' </tbody>' .
|
|
69
|
'</table>';
|
hpdl
|
1371
|
70
|
|
|
71
|
$Qorders->freeResult();
|
hpdl
|
1
|
72
|
}
|
|
73
|
}
|
|
74
|
?>
|