Changeset 208 for trunk/network/user_hosts.php
- Timestamp:
- May 6, 2009, 8:21:23 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/network/user_hosts.php
r204 r208 10 10 function Show() 11 11 { 12 13 $Output = '<br /><table class="WideTable"> 14 <tr><th>Jméno počítače</th><th>Typ</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()) 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>CZFree 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 = (SELECT Id FROM Member WHERE Member.ResponsibleUser = '.$this->System->Modules['User']->User['Member'].') ORDER BY NetworkDevice.Name'); 15 while($Device = $DbResult->fetch_assoc()) 18 16 { 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>'; 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 $Output .= '<tr><td style="text-align: left; '.$Style.'"> '.$Device['Name'].'-'.$Interface['Name'].'</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>'; 24 } 26 25 } 27 $Output .= '</table> ';26 $Output .= '</table></div>'; 28 27 return($Output); 29 28 }
Note:
See TracChangeset
for help on using the changeset viewer.