Changeset 193
- Timestamp:
- Apr 27, 2009, 12:04:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hostlist.php
r189 r193 10 10 { 11 11 $Output = '<div align="center" style="font-size: small;"><table class="WideTable"><tr><th>Jméno počítače</th><th>IP adresa</th><th>Naposledy</th><th>Správce</th></tr>'; 12 $DbResult = $this->Database-> select('hosts', '*', 'type=0 ORDER BYname');12 $DbResult = $this->Database->query('SELECT hosts.*, User.Name as UserName FROM hosts LEFT JOIN Member ON Member.Id = hosts.user LEFT JOIN User ON Member.ResponsibleUser = User.Id ORDER BY hosts.name'); 13 13 while($Host = $DbResult->fetch_array()) 14 14 { 15 $DbResult2 = $this->Database->select('User','*', 'Id='.$Host['user']);16 $User = $DbResult2->fetch_assoc();17 15 if($Host['online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = ''; 18 16 if($Host['IP'] == '') $Host['IP'] = ' '; 19 $Output .= '<tr><td style="text-align: left; '.$Style.'">'.$Host['name'].'</td><td>'.$Host['IP'].'</td><td style="text-align: right;">'.HumanDate($Host['last_online']).'</td><td style="text-align: right;">'.$ User['Name'].'</td></tr>';17 $Output .= '<tr><td style="text-align: left; '.$Style.'">'.$Host['name'].'</td><td>'.$Host['IP'].'</td><td style="text-align: right;">'.HumanDate($Host['last_online']).'</td><td style="text-align: right;">'.$Host['UserName'].'</td></tr>'; 20 18 } 21 19 $Output .= '</table></div>';
Note:
See TracChangeset
for help on using the changeset viewer.