Last change
on this file since 195 was 195, checked in by george, 16 years ago |
- Upraveno: Kódování tabulek a sloupců sjednoceno na utf8_czech_ci.
- Opraveno: Zobrazení seznamu počítačů uživatele.
|
File size:
1.5 KB
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | include_once('../global.php');
|
---|
4 |
|
---|
5 | class NetworkHostList extends Page
|
---|
6 | {
|
---|
7 | var $FullTitle = 'Registrované počítače';
|
---|
8 | var $ShortTitle = 'Registrované počítače';
|
---|
9 |
|
---|
10 | function Show()
|
---|
11 | {
|
---|
12 |
|
---|
13 | $Output = '<br /><table class="WideTable">
|
---|
14 | <tr><th>Jméno počítače</th><th>Typ</th></th><th>Místní IP adresa</th><th>Veřejná IP adresa</th><th>CZFree IP adresa</th><th>Naposledy online</th><th>Fyzická adresa</th></tr>';
|
---|
15 |
|
---|
16 | $DbResult = $this->Database->query('SELECT hosts.*, HostType.Name AS HostType FROM hosts LEFT JOIN HostType ON HostType.Id = hosts.type WHERE (hosts.used = 1) AND (hosts.user = '.$this->System->Modules['User']->User['Member'].') ORDER BY hosts.name');
|
---|
17 | while($Host = $DbResult->fetch_array())
|
---|
18 | {
|
---|
19 | if($Host['online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = '';
|
---|
20 | if($Host['IP'] == '') $Host['IP'] = ' ';
|
---|
21 | if($Host['name'] == '') $Host['name'] = ' ';
|
---|
22 | if($Host['czfree_ip'] == '') $Host['czfree_ip'] = ' ';
|
---|
23 | if($Host['external_ip'] == '') $Host['external_ip'] = ' ';
|
---|
24 | if($Host['MAC'] == '') $Host['MAC'] = ' ';
|
---|
25 | $Output .= '<tr><td style="text-align: left; '.$Style.'">'.$Host['name'].'</td><td>'.$Host['HostType'].'</td><td>'.$Host['IP'].'</td><td>'.$Host['external_ip'].'</td><td>'.$Host['czfree_ip'].'</td><td >'.HumanDate($Host['last_online']).'</td><td>'.$Host['MAC'].'</td></tr>';
|
---|
26 | }
|
---|
27 | $Output .= '</table><br />';
|
---|
28 | return($Output);
|
---|
29 | }
|
---|
30 | }
|
---|
31 |
|
---|
32 | $System->AddModule(new NetworkHostList());
|
---|
33 | $System->Modules['NetworkHostList']->GetOutput();
|
---|
34 |
|
---|
35 | ?>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.