Changeset 148 for www/hostlist.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/hostlist.php

    r78 r148  
    11<?php
    2 include('style.php');
    3 ShowHeader('Seznam známých počítačů v síti', 'Seznam počítačů');
    4 
    52include_once('global.php');
    63
    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>');
     4class HostListPage extends Page
     5{
     6  var $FullTitle = 'Seznam registrovaných počítačů';
     7  var $ShortTitle = 'Seznam počítačů';
    98
    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'] = '&nbsp;';
    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'] = '&nbsp;';
     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  }
    1924}
    20 echo('</table>');
    2125
    22 ShowFooter();
     26$System->AddModule(new HostListPage());
     27$System->Modules['HostListPage']->GetOutput();
     28
    2329?>
Note: See TracChangeset for help on using the changeset viewer.