Changeset 210 for trunk/hostlist.php
- Timestamp:
- May 6, 2009, 10:17:15 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hostlist.php
r208 r210 15 15 { 16 16 if($Device['Online'] == 1) $Style = 'color: blue;'; else $Style = ''; 17 $ Output .= '<tr><td colspan="2" style="text-align: left; font-weight: bold; '.$Style.'">'.$Device['Name'].'</td><td>'.$Device['HostType'].'</td><td style="text-align: right;">'.HumanDate($Device['LastOnline']).'</td><td style="text-align: right;">'.$Device['UserName'].'</td></tr>';18 $DbR esult2 = $this->Database->query('SELECT * FROM NetworkInterface WHERE Device = '.$Device['Id']);19 while($Interface = $DbResult2->fetch_assoc())17 $DbResult2 = $this->Database->query('SELECT COUNT(*) FROM NetworkInterface WHERE Device = '.$Device['Id']); 18 $DbRow = $DbResult2->fetch_row(); 19 if($DbRow[0] == 1) 20 20 { 21 $DbResult2 = $this->Database->query('SELECT * FROM NetworkInterface WHERE Device = '.$Device['Id']); 22 $Interface = $DbResult2->fetch_assoc(); 21 23 if($Interface['LocalIP'] == '') $Interface['LocalIP'] = ' '; 22 24 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>'.$Interface['LocalIP'].'</td><td> </td><td> </td><td> </td></tr>'; 24 } 25 } 25 $InterfaceName = $Device['Name']; 26 if($Interface['Name'] != '') $InterfaceName .= '-'.$Interface['Name']; 27 $Output .= '<tr><td style="text-align: left; '.$Style.'">'.$InterfaceName.'</td><td>'.$Interface['LocalIP'].'</td><td>'.$Device['HostType'].'</td><td style="text-align: right;">'.HumanDate($Device['LastOnline']).'</td><td style="text-align: right;">'.$Device['UserName'].'</td></tr>'; 28 } else 29 { 30 $Output .= '<tr><td colspan="2" style="text-align: left; font-weight: bold; '.$Style.'">'.$Device['Name'].'</td><td>'.$Device['HostType'].'</td><td style="text-align: right;">'.HumanDate($Device['LastOnline']).'</td><td style="text-align: right;">'.$Device['UserName'].'</td></tr>'; 31 $DbResult2 = $this->Database->query('SELECT * FROM NetworkInterface WHERE Device = '.$Device['Id']); 32 while($Interface = $DbResult2->fetch_assoc()) 33 { 34 if($Interface['LocalIP'] == '') $Interface['LocalIP'] = ' '; 35 if($Interface['Online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = ''; 36 $InterfaceName = $Device['Name']; 37 if($Interface['Name'] != '') $InterfaceName .= '-'.$Interface['Name']; 38 $Output .= '<tr><td style="text-align: left; '.$Style.'"> '.$InterfaceName.'</td><td>'.$Interface['LocalIP'].'</td><td> </td><td> </td><td> </td></tr>'; 39 } 40 } 41 } 26 42 $Output .= '</table></div>'; 27 43 return($Output);
Note:
See TracChangeset
for help on using the changeset viewer.