source: trunk/Modules/Network/user_hosts.php@ 366

Last change on this file since 366 was 366, checked in by chronos, 13 years ago
  • Opraveno: Navigační odkazy v modulu Finance, Network a FrontPage.
File size: 1.8 KB
Line 
1<?php
2
3class NetworkHostList extends Page
4{
5 var $FullTitle = 'Registrované počítače';
6 var $ShortTitle = 'Registrované počítače';
7
8 function Show()
9 {
10 global $Config;
11
12 $Output = '<div align="center" style="font-size: small;"><table class="WideTable">';
13 $Output .= '<tr><th>Jméno počítače</th><th>Místní adresa</th><th>Veřejná adresa</th><th>Fyzická adresa</th><th>Typ</th><th>Naposledy online</th></tr>';
14 $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->Models['User']->User['Member'].' ORDER BY NetworkDevice.Name');
15 while($Device = $DbResult->fetch_assoc())
16 {
17 if($Device['Online'] == 1) $Style = 'color: blue;'; else $Style = '';
18 $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>';
19 $DbResult2 = $this->Database->query('SELECT * FROM NetworkInterface WHERE Device = '.$Device['Id']);
20 while($Interface = $DbResult2->fetch_assoc())
21 {
22 if($Interface['Online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = '';
23 $InterfaceName = $Device['Name'];
24 if($Interface['Name'] != '') $InterfaceName .= '-'.$Interface['Name'];
25 $Output .= '<tr><td style="text-align: left; '.$Style.'">&nbsp;&nbsp;'.$InterfaceName.'</td><td>'.NotBlank($Interface['LocalIP']).'</td><td>'.NotBlank($Interface['ExternalIP']).'</td><td>'.NotBlank($Interface['MAC']).'</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
26 }
27 }
28 $Output .= '</table></div>';
29 return($Output);
30 }
31}
32
33?>
Note: See TracBrowser for help on using the repository browser.