hpdl
|
1
|
1
|
<?php
|
|
2
|
/*
|
hpdl
|
153
|
3
|
$Id: main.php 1497 2007-03-29 13:40:05Z hpdl $
|
hpdl
|
1
|
4
|
|
|
5
|
osCommerce, Open Source E-Commerce Solutions
|
|
6
|
http://www.oscommerce.com
|
|
7
|
|
hpdl
|
1446
|
8
|
Copyright (c) 2007 osCommerce
|
hpdl
|
1
|
9
|
|
hpdl
|
1497
|
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
|
|
|
15
|
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/summary');
|
|
16
|
$osC_DirectoryListing->setIncludeDirectories(false);
|
|
17
|
$files = $osC_DirectoryListing->getFiles();
|
|
18
|
|
|
19
|
$Qonline = $osC_Database->query('select count(*) as total from :table_whos_online where time_last_click >= :time_last_click');
|
|
20
|
$Qonline->bindTable(':table_whos_online', TABLE_WHOS_ONLINE);
|
|
21
|
$Qonline->bindInt(':time_last_click', (time() - 900));
|
|
22
|
$Qonline->execute();
|
|
23
|
?>
|
|
24
|
|
hpdl
|
1475
|
25
|
<p><?php echo osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, 'whos_online'), osc_icon('people.png') . ' ' . sprintf($osC_Language->get('total_customers_online'), $Qonline->valueInt('total'))); ?></p>
|
hpdl
|
1
|
26
|
|
|
27
|
<table border="0" width="100%" cellspacing="0" cellpadding="2">
|
|
28
|
|
|
29
|
<?php
|
|
30
|
$col = 0;
|
|
31
|
|
|
32
|
foreach ($files as $file) {
|
|
33
|
include('includes/modules/summary/' . $file['name']);
|
|
34
|
|
hpdl
|
1070
|
35
|
$module = substr($file['name'], 0, strrpos($file['name'], '.'));
|
|
36
|
$module_class = 'osC_Summary_' . $module;
|
hpdl
|
1
|
37
|
|
hpdl
|
1070
|
38
|
$osC_Summary = new $module_class();
|
hpdl
|
1
|
39
|
|
hpdl
|
1070
|
40
|
if ($osC_Summary->hasData()) {
|
hpdl
|
1
|
41
|
if ($col === 0) {
|
|
42
|
echo ' <tr>' . "\n";
|
|
43
|
}
|
|
44
|
|
|
45
|
$col++;
|
|
46
|
|
|
47
|
if ($col <= 2) {
|
|
48
|
echo ' <td width="50%" valign="top">' . "\n";
|
|
49
|
}
|
|
50
|
|
hpdl
|
1070
|
51
|
if ($osC_Summary->hasTitleLink()) {
|
|
52
|
echo '<a href="' . $osC_Summary->getTitleLink() . '">';
|
hpdl
|
1
|
53
|
}
|
|
54
|
|
hpdl
|
1070
|
55
|
echo '<h1>' . $osC_Summary->getTitle() . '</h1>';
|
hpdl
|
1
|
56
|
|
hpdl
|
1070
|
57
|
if ($osC_Summary->hasTitleLink()) {
|
hpdl
|
1
|
58
|
echo '</a>';
|
|
59
|
}
|
|
60
|
|
hpdl
|
1070
|
61
|
echo $osC_Summary->getData();
|
hpdl
|
1
|
62
|
|
|
63
|
if ($col <= 2) {
|
|
64
|
echo ' </td>' . "\n";
|
|
65
|
}
|
|
66
|
|
|
67
|
if ( (next($files) === false) || ($col === 2) ) {
|
|
68
|
$col = 0;
|
|
69
|
|
|
70
|
echo ' </tr>' . "\n";
|
|
71
|
}
|
|
72
|
}
|
|
73
|
|
hpdl
|
1070
|
74
|
unset($osC_Summary);
|
hpdl
|
1
|
75
|
}
|
|
76
|
?>
|
|
77
|
|
|
78
|
</table>
|