Last change
on this file since 245 was 245, checked in by george, 16 years ago |
- Oprveno: Nastavení konfigurace DNS serverů.
|
File size:
2.0 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 | global $Config;
|
---|
13 |
|
---|
14 | $Output = '<div align="center" style="font-size: small;"><table class="WideTable">';
|
---|
15 | $Output .= '<tr><th>Jméno počítače</th><th>Místní adresa</th><th>Veřejná adresa</th><th>CZFree adresa</th><th>Fyzická adresa</th><th>Typ</th><th>Naposledy online</th></tr>';
|
---|
16 | $DbResult = $this->Database->query('SELECT NetworkDevice.*, NetworkDeviceType.Name AS HostType FROM NetworkDevice LEFT JOIN NetworkDeviceType ON NetworkDeviceType.Id = NetworkDevice.Type WHERE NetworkDevice.Used = 1 AND NetworkDevice.Member = '.$this->System->Modules['User']->User['Member'].' ORDER BY NetworkDevice.Name');
|
---|
17 | while($Device = $DbResult->fetch_assoc())
|
---|
18 | {
|
---|
19 | if($Device['Online'] == 1) $Style = 'color: blue;'; else $Style = '';
|
---|
20 | $Output .= '<tr><td colspan="5" style="text-align: left; font-weight: bold; '.$Style.'">'.$Device['Name'].'</td><td>'.$Device['HostType'].'</td><td style="text-align: right;">'.HumanDate($Device['LastOnline']).'</td></tr>';
|
---|
21 | $DbResult2 = $this->Database->query('SELECT * FROM NetworkInterface WHERE Device = '.$Device['Id']);
|
---|
22 | while($Interface = $DbResult2->fetch_assoc())
|
---|
23 | {
|
---|
24 | if($Interface['Online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = '';
|
---|
25 | $InterfaceName = $Device['Name'];
|
---|
26 | if($Interface['Name'] != '') $InterfaceName .= '-'.$Interface['Name'];
|
---|
27 | $Output .= '<tr><td style="text-align: left; '.$Style.'"> '.$InterfaceName.'</td><td>'.NotBlank($Interface['LocalIP']).'</td><td>'.NotBlank($Interface['ExternalIP']).'</td><td>'.NotBlank($Interface['CZFreeIP']).'</td><td>'.NotBlank($Interface['MAC']).'</td><td> </td><td> </td></tr>';
|
---|
28 | }
|
---|
29 | }
|
---|
30 | $Output .= '</table></div>';
|
---|
31 | return($Output);
|
---|
32 | }
|
---|
33 | }
|
---|
34 |
|
---|
35 | $System->AddModule(new NetworkHostList());
|
---|
36 | $System->Modules['NetworkHostList']->GetOutput();
|
---|
37 |
|
---|
38 | ?>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.