Changeset 148 for www/userlist.php


Ignore:
Timestamp:
Feb 15, 2009, 7:59:35 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Přepracován systém generování zobrazení výstupu. Pro nový systím přepsáno mnoho stránek.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • www/userlist.php

    r143 r148  
    11<?php
    2 include('style.php');
    32include_once('global.php');
    4 ShowHeader('Seznam uživatelů na síti', 'Seznam uživatelů');
    53
    6 //echo('<a href="#network">Nastavení sítě</a><br>');
    7 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>');
     4class UserListPage extends Page
     5{
     6  var $FullTitle = 'Seznam registrovaných uživatelů';
     7  var $ShortTitle = 'Seznam uživatelů';
    88
    9 $DbResult = $Database->select('users', '*,CONCAT(second_name," ",first_name) as fullname','role=2 ORDER BY fullname');
    10 while($User = $DbResult->fetch_array())
    11 {
    12   if($User['icq']>0) $ICQ = $User['icq']; else $ICQ = '&nbsp;';
    13   if($User['phone']>0) $Phone = $User['phone']; else $Phone = '&nbsp;';
    14  
    15   $DbResult2 = $Database->select('hosts','*','user='.$User['id'].' AND block=0 ORDER BY name');
    16   $Hosts = '';
    17   while($Host = $DbResult2->fetch_array())
     9  function Show()
    1810  {
    19     $Hosts = $Hosts.$Host['name'].', ';
    20     //'<img src="http://wwp.icq.com/scripts/online.dll?icq='.$Row['icq'].'&img=5">'.
     11    $Output = '<table class="WideTable" 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>';
     12
     13    $DbResult = $this->Database->select('users', '*, CONCAT(second_name," ",first_name) as fullname', '1 ORDER BY fullname');
     14    while($User = $DbResult->fetch_array())
     15    {
     16      if($User['icq'] > 0) $ICQ = $User['icq']; else $ICQ = '&nbsp;';
     17      if($User['phone'] > 0) $Phone = $User['phone']; else $Phone = '&nbsp;';
     18
     19      $DbResult2 = $this->Database->select('hosts', '*', 'user='.$User['id'].' AND block=0 ORDER BY name');
     20      $Hosts = '';
     21      while($Host = $DbResult2->fetch_array())
     22      {
     23        $Hosts = $Hosts.$Host['name'].', ';
     24        //'<img src="http://wwp.icq.com/scripts/online.dll?icq='.$Row['icq'].'&img=5">'.
     25      }
     26      if($Hosts != '') $Hosts = substr($Hosts, 0, -2);
     27      $Output .= '<tr><td>'.$User['fullname'].'</td><td>'.$User['email'].'&nbsp;</td><td>'.$ICQ.'</td><td>'.$Phone.'</td><td>'.$Hosts.'</td></tr>';
     28    }
     29    $Output .= '</table>';
     30    return($Output);
    2131  }
    22   if($Hosts != '') $Hosts = substr($Hosts, 0, -2);
    23   echo('<tr><td>'.$User['fullname'].'</td><td>'.$User['email'].'&nbsp;</td><td>'.$ICQ.'</td><td>'.$Phone.'</td><td>'.$Hosts.'</td></tr>');
    2432}
    25 echo('</table>');
    2633
    27 //for($i=0;$i<60;$i++) echo('<img //src="http://wwp.icq.com/scripts/online.dll?icq=277158770&img='.$i.'"><br>');
     34$System->AddModule(new UserListPage());
     35$System->Modules['UserListPage']->GetOutput();
    2836
    29 ShowFooter();
    3037?>
Note: See TracChangeset for help on using the changeset viewer.