<?php
include('style.php');
include_once('global.php');
ShowHeader('Seznam uživatelů na síti', 'Seznam uživatelů');

//echo('<a href="#network">Nastavení sítě</a><br>');
echo('<table border="1" cellspacing="0" cellpadding="2" style="font-size: small;"><tr><th>Jméno uľivatele</th><th>E-mail</th><th>ICQ</th><th>Telefon</th><th>Počítače</th></tr>');

$DbResult = $Database->select('users','*,CONCAT(second_name," ",first_name) as fullname','1 ORDER BY fullname');
while($User = $DbResult->fetch_array())
{
  if($User['icq']>0) $ICQ = $User['icq']; else $ICQ = '&nbsp;';
  if($User['phone']>0) $Phone = $User['phone']; else $Phone = '&nbsp;';
  
  $DbResult2 = $Database->select('hosts','*','user='.$User['id'].' AND block=0 ORDER BY name');
  $Hosts = '';
  while($Host = $DbResult2->fetch_array())
  {
    $Hosts = $Hosts.$Host['name'].', ';
    //'<img src="http://wwp.icq.com/scripts/online.dll?icq='.$Row['icq'].'&img=5">'.
  }
  if($Hosts != '') $Hosts = substr($Hosts, 0, -2);
  echo('<tr><td>'.$User['fullname'].'</td><td>'.$User['email'].'&nbsp;</td><td>'.$ICQ.'</td><td>'.$Phone.'</td><td>'.$Hosts.'</td></tr>');
}
echo('</table>');

//for($i=0;$i<60;$i++) echo('<img //src="http://wwp.icq.com/scripts/online.dll?icq=277158770&img='.$i.'"><br>');

ShowFooter();
?>
