Quick Search:

View

Revision:

Diff

Diff from 1475 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/branches/hpdl/oscommerce/admin/templates/pages/index/main.php

Annotated File View

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