Changeset 208 for trunk/hostlist.php


Ignore:
Timestamp:
May 6, 2009, 8:21:23 AM (15 years ago)
Author:
george
Message:
  • Upraveno: Tabulka hosts rozdělena na NetworkDevice, NetworkInterface, NetworkInterfaceType a NetworkLink. Jeden počítač může mít více rozhraní. Nově se již nepočítá pouze s stromovou topologií, ale s celkovou sítí s okruhy. Sloupce Parent byl proto nahrazen tabulkou NetworkLink, ve které jsou uchovány informace o tom, co kam je připojeno. Každé rozhraní má definovaný typ dle NetworkInterfaceType.
  • Upraveno: Tabulka HostType přejmenována na NetworkDeviceType.
  • Smazáno: Původní složka komunikačního programu sunrisechat. Nově nahrazena složkou chat pro podporu IRC.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hostlist.php

    r194 r208  
    99  function Show()
    1010  {
    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>Typ</th><th>Naposledy online</th><th>Správce</th></tr>';
    12     $DbResult = $this->Database->query('SELECT hosts.*, User.Name as UserName, HostType.Name as HostType FROM hosts LEFT JOIN Member ON Member.Id = hosts.user LEFT JOIN User ON Member.ResponsibleUser = User.Id LEFT JOIN HostType ON HostType.Id = hosts.type WHERE hosts.used = 1 ORDER BY hosts.name');
    13     while($Host = $DbResult->fetch_array())
     11    $Output = '<div align="center" style="font-size: small;"><table class="WideTable">';
     12    $Output .= '<tr><th>Jméno počítače</th><th>IP adresa</th><th>Typ</th><th>Naposledy online</th><th>Správce</th></tr>';
     13    $DbResult = $this->Database->query('SELECT NetworkDevice.*, User.Name as UserName, NetworkDeviceType.Name AS HostType FROM NetworkDevice LEFT JOIN Member ON Member.Id = NetworkDevice.Member LEFT JOIN User ON Member.ResponsibleUser = User.Id LEFT JOIN NetworkDeviceType ON NetworkDeviceType.Id = NetworkDevice.Type WHERE NetworkDevice.Used = 1 ORDER BY NetworkDevice.Name');
     14    while($Device = $DbResult->fetch_assoc())
    1415    {
    15       if($Host['online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = '';
    16       if($Host['IP'] == '') $Host['IP'] = '&nbsp;';
    17       $Output .= '<tr><td style="text-align: left; '.$Style.'">'.$Host['name'].'</td><td>'.$Host['IP'].'</td><td>'.$Host['HostType'].'</td><td style="text-align: right;">'.HumanDate($Host['last_online']).'</td><td style="text-align: right;">'.$Host['UserName'].'</td></tr>';
     16      if($Device['Online'] == 1) $Style = 'color: blue;'; else $Style = '';
     17      $Output .= '<tr><td colspan="2" style="text-align: left; font-weight: bold; '.$Style.'">'.$Device['Name'].'</td><td>'.$Device['HostType'].'</td><td style="text-align: right;">'.HumanDate($Device['LastOnline']).'</td><td style="text-align: right;">'.$Device['UserName'].'</td></tr>';
     18      $DbResult2 = $this->Database->query('SELECT * FROM NetworkInterface WHERE Device = '.$Device['Id']);
     19      while($Interface = $DbResult2->fetch_assoc())
     20      {
     21        if($Interface['LocalIP'] == '') $Interface['LocalIP'] = '&nbsp;';
     22        if($Interface['Online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = '';
     23        $Output .= '<tr><td style="text-align: left; '.$Style.'">&nbsp;&nbsp;'.$Device['Name'].'-'.$Interface['Name'].'</td><td>'.$Interface['LocalIP'].'</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
     24      }     
    1825    }
    1926    $Output .= '</table></div>';
Note: See TracChangeset for help on using the changeset viewer.