<?php
include('style.php');
ShowHeader('Seznam známých počítačů v síti', 'Seznam počítačů');

include_once('global.php');

echo('<table border="1" cellspacing="0" cellpadding="2" style="font-size: small;">
<tr><th>Jméno počítače</th><th>IP adresa</th><th>Naposledy</th><th>Správce</th></tr>');

$DbResult = $Database->select('hosts', '*', 'type=0 ORDER BY name');
while($Host = $DbResult->fetch_array())
{
  $DbResult2 = $Database->select('users','*, CONCAT(second_name," ",first_name) as fullname','id='.$Host['user']);
  $User = $DbResult2->fetch_array();
 //'<img src="http://wwp.icq.com/scripts/online.dll?icq='.$Row['icq'].'&img=5">'.
  if($Host['online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = '';
  if($Host['IP'] == '') $Host['IP'] = '&nbsp';
  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>');
}
echo('</table>');

ShowFooter();
?>
