hpdl
|
1
|
1
|
<?php
|
|
2
|
/*
|
hpdl
|
121
|
3
|
$Id: customers.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_customers extends osC_Summary {
|
|
20
|
|
|
21
|
/* Class constructor */
|
|
22
|
|
|
23
|
function osC_Summary_customers() {
|
hpdl
|
1492
|
24
|
global $osC_Language;
|
|
25
|
|
|
26
|
$osC_Language->loadIniFile('modules/summary/customers.php');
|
|
27
|
|
|
28
|
$this->_title = $osC_Language->get('summary_customers_title');
|
hpdl
|
1407
|
29
|
$this->_title_link = osc_href_link_admin(FILENAME_DEFAULT, 'customers');
|
hpdl
|
1
|
30
|
|
hpdl
|
1371
|
31
|
if ( osC_Access::hasAccess('customers') ) {
|
hpdl
|
1078
|
32
|
$this->_setData();
|
|
33
|
}
|
hpdl
|
1
|
34
|
}
|
|
35
|
|
|
36
|
/* Private methods */
|
|
37
|
|
|
38
|
function _setData() {
|
hpdl
|
1492
|
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_customers_table_heading_customers') . '</th>' .
|
|
45
|
' <th>' . $osC_Language->get('summary_customers_table_heading_date') . '</th>' .
|
|
46
|
' <th>' . $osC_Language->get('summary_customers_table_heading_status') . '</th>' .
|
hpdl
|
1
|
47
|
' </tr>' .
|
|
48
|
' </thead>' .
|
|
49
|
' <tbody>';
|
|
50
|
|
hpdl
|
1439
|
51
|
$Qcustomers = $osC_Database->query('select customers_id, customers_gender, customers_lastname, customers_firstname, customers_status, date_account_created from :table_customers order by date_account_created desc limit 6');
|
hpdl
|
1
|
52
|
$Qcustomers->bindTable(':table_customers', TABLE_CUSTOMERS);
|
|
53
|
$Qcustomers->execute();
|
|
54
|
|
hpdl
|
1371
|
55
|
while ( $Qcustomers->next() ) {
|
hpdl
|
1439
|
56
|
$customer_icon = osc_icon('people.png');
|
|
57
|
|
|
58
|
if ( ACCOUNT_GENDER > -1 ) {
|
|
59
|
switch ( $Qcustomers->value('customers_gender') ) {
|
|
60
|
case 'm':
|
hpdl
|
1492
|
61
|
$customer_icon = osc_icon('user_male.png');
|
hpdl
|
1439
|
62
|
|
|
63
|
break;
|
|
64
|
|
|
65
|
case 'f':
|
hpdl
|
1492
|
66
|
$customer_icon = osc_icon('user_female.png');
|
hpdl
|
1439
|
67
|
|
|
68
|
break;
|
|
69
|
}
|
|
70
|
}
|
|
71
|
|
hpdl
|
365
|
72
|
$this->_data .= ' <tr onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' .
|
hpdl
|
1439
|
73
|
' <td>' . osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, 'customers&cID=' . $Qcustomers->valueInt('customers_id') . '&action=save'), $customer_icon . ' ' . $Qcustomers->valueProtected('customers_firstname') . ' ' . $Qcustomers->valueProtected('customers_lastname')) . '</td>' .
|
frank
|
1763
|
74
|
' <td>' . osC_DateTime::getShort($Qcustomers->value('date_account_created')) . '</td>' .
|
hpdl
|
755
|
75
|
' <td align="center">' . osc_icon(($Qcustomers->valueInt('customers_status') === 1) ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif', null, null) . '</td>' .
|
hpdl
|
1
|
76
|
' </tr>';
|
|
77
|
}
|
|
78
|
|
|
79
|
$this->_data .= ' </tbody>' .
|
|
80
|
'</table>';
|
hpdl
|
1371
|
81
|
|
|
82
|
$Qcustomers->freeResult();
|
hpdl
|
1
|
83
|
}
|
|
84
|
}
|
|
85
|
?>
|