Changeset 148 for www/hostlist.php
- Timestamp:
- Feb 15, 2009, 7:59:35 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/hostlist.php
r78 r148 1 1 <?php 2 include('style.php');3 ShowHeader('Seznam známých počítačů v síti', 'Seznam počítačů');4 5 2 include_once('global.php'); 6 3 7 echo('<table border="1" cellspacing="0" cellpadding="2" style="font-size: small;"> 8 <tr><th>Jméno počítače</th><th>IP adresa</th><th>Naposledy</th><th>Správce</th></tr>'); 4 class HostListPage extends Page 5 { 6 var $FullTitle = 'Seznam registrovaných počítačů'; 7 var $ShortTitle = 'Seznam počítačů'; 9 8 10 $DbResult = $Database->select('hosts', '*', 'type=0 ORDER BY name'); 11 while($Host = $DbResult->fetch_array()) 12 { 13 $DbResult2 = $Database->select('users','*, CONCAT(second_name," ",first_name) as fullname','id='.$Host['user']); 14 $User = $DbResult2->fetch_array(); 15 //'<img src="http://wwp.icq.com/scripts/online.dll?icq='.$Row['icq'].'&img=5">'. 16 if($Host['online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = ''; 17 if($Host['IP'] == '') $Host['IP'] = ' '; 18 echo('<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['fullname'].'</td></tr>'); 9 function Show() 10 { 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 BY name'); 13 while($Host = $DbResult->fetch_array()) 14 { 15 $DbResult2 = $this->Database->select('users','*, CONCAT(second_name," ",first_name) as fullname','id='.$Host['user']); 16 $User = $DbResult2->fetch_array(); 17 if($Host['online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = ''; 18 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['fullname'].'</td></tr>'; 20 } 21 $Output .= '</table></div>'; 22 return($Output); 23 } 19 24 } 20 echo('</table>');21 25 22 ShowFooter(); 26 $System->AddModule(new HostListPage()); 27 $System->Modules['HostListPage']->GetOutput(); 28 23 29 ?>
Note:
See TracChangeset
for help on using the changeset viewer.