Last change
on this file since 148 was 148, checked in by george, 16 years ago |
- Upraveno: Přepracován systém generování zobrazení výstupu. Pro nový systím přepsáno mnoho stránek.
|
-
Property svn:executable
set to
*
|
File size:
1.2 KB
|
Line | |
---|
1 | <?php
|
---|
2 | include_once('global.php');
|
---|
3 |
|
---|
4 | class HostListPage extends Page
|
---|
5 | {
|
---|
6 | var $FullTitle = 'Seznam registrovaných počítačů';
|
---|
7 | var $ShortTitle = 'Seznam počítačů';
|
---|
8 |
|
---|
9 | function Show()
|
---|
10 | {
|
---|
11 | $Output = '<div align="center" style="font-size: small;"><table class="WideTable"><tr><th>Jméno počítače</th><th>IP adresa</th><th>Naposledy</th><th>Správce</th></tr>';
|
---|
12 | $DbResult = $this->Database->select('hosts', '*', 'type=0 ORDER BY name');
|
---|
13 | while($Host = $DbResult->fetch_array())
|
---|
14 | {
|
---|
15 | $DbResult2 = $this->Database->select('users','*, CONCAT(second_name," ",first_name) as fullname','id='.$Host['user']);
|
---|
16 | $User = $DbResult2->fetch_array();
|
---|
17 | if($Host['online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = '';
|
---|
18 | if($Host['IP'] == '') $Host['IP'] = ' ';
|
---|
19 | $Output .= '<tr><td style="text-align: left; '.$Style.'">'.$Host['name'].'</td><td>'.$Host['IP'].'</td><td style="text-align: right;">'.HumanDate($Host['last_online']).'</td><td style="text-align: right;">'.$User['fullname'].'</td></tr>';
|
---|
20 | }
|
---|
21 | $Output .= '</table></div>';
|
---|
22 | return($Output);
|
---|
23 | }
|
---|
24 | }
|
---|
25 |
|
---|
26 | $System->AddModule(new HostListPage());
|
---|
27 | $System->Modules['HostListPage']->GetOutput();
|
---|
28 |
|
---|
29 | ?>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.