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/network/user_hosts.php

    r204 r208  
    1010  function Show()
    1111  {
    12 
    13     $Output = '<br /><table class="WideTable">
    14 <tr><th>Jméno počítače</th><th>Typ</th><th>Místní IP adresa</th><th>Veřejná IP adresa</th><th>CZFree IP adresa</th><th>Naposledy online</th><th>Fyzická adresa</th></tr>';
    15 
    16     $DbResult = $this->Database->query('SELECT hosts.*, HostType.Name AS HostType FROM hosts LEFT JOIN HostType ON HostType.Id = hosts.type WHERE (hosts.used = 1) AND (hosts.user = '.$this->System->Modules['User']->User['Member'].') ORDER BY hosts.name');
    17     while($Host = $DbResult->fetch_array())
     12    $Output = '<div align="center" style="font-size: small;"><table class="WideTable">';
     13    $Output .= '<tr><th>Jméno počítače</th><th>Místní adresa</th><th>Veřejná adresa</th><th>CZFree adresa</th><th>Fyzická adresa</th><th>Typ</th><th>Naposledy online</th></tr>';
     14    $DbResult = $this->Database->query('SELECT NetworkDevice.*, NetworkDeviceType.Name AS HostType FROM NetworkDevice LEFT JOIN NetworkDeviceType ON NetworkDeviceType.Id = NetworkDevice.Type WHERE NetworkDevice.Used = 1 AND NetworkDevice.Member = (SELECT Id FROM Member WHERE Member.ResponsibleUser = '.$this->System->Modules['User']->User['Member'].') ORDER BY NetworkDevice.Name');
     15    while($Device = $DbResult->fetch_assoc())
    1816    {
    19       if($Host['online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = '';
    20       if($Host['IP'] == '') $Host['IP'] = '&nbsp;';
    21       if($Host['name'] == '') $Host['name'] = '&nbsp;';
    22       if($Host['czfree_ip'] == '') $Host['czfree_ip'] = '&nbsp;';
    23       if($Host['external_ip'] == '') $Host['external_ip'] = '&nbsp;';
    24       if($Host['MAC'] == '') $Host['MAC'] = '&nbsp;';
    25       $Output .= '<tr><td style="text-align: left; '.$Style.'">'.$Host['name'].'</td><td>'.$Host['HostType'].'</td><td>'.$Host['IP'].'</td><td>'.$Host['external_ip'].'</td><td>'.$Host['czfree_ip'].'</td><td >'.HumanDate($Host['last_online']).'</td><td>'.$Host['MAC'].'</td></tr>';
     17      if($Device['Online'] == 1) $Style = 'color: blue;'; else $Style = '';
     18      $Output .= '<tr><td colspan="5" style="text-align: left; font-weight: bold; '.$Style.'">'.$Device['Name'].'</td><td>'.$Device['HostType'].'</td><td style="text-align: right;">'.HumanDate($Device['LastOnline']).'</td></tr>';
     19      $DbResult2 = $this->Database->query('SELECT * FROM NetworkInterface WHERE Device = '.$Device['Id']);
     20      while($Interface = $DbResult2->fetch_assoc())
     21      {
     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>'.NotBlank($Interface['LocalIP']).'</td><td>'.NotBlank($Interface['ExternalIP']).'</td><td>'.NotBlank($Interface['CZFreeIP']).'</td><td>'.NotBlank($Interface['MAC']).'</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
     24      }     
    2625    }
    27     $Output .= '</table>';
     26    $Output .= '</table></div>';
    2827    return($Output);
    2928  }
Note: See TracChangeset for help on using the changeset viewer.