Changeset 217


Ignore:
Timestamp:
May 21, 2009, 4:58:39 PM (15 years ago)
Author:
george
Message:
  • Přidáno: Administrační filtr zobrazení síťových zařízení.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/hostlist.php

    r210 r217  
    99  function Show()
    1010  {
     11    if(array_key_exists('admin', $_GET)) $Where = 'AND NetworkDevice.Type IN (1,4,5) ';
     12      else $Where = '';
    1113    $Output = '<div align="center" style="font-size: small;"><table class="WideTable">';
    1214    $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');
     15    $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 '.$Where.'ORDER BY NetworkDevice.Name');
    1416    while($Device = $DbResult->fetch_assoc())
    1517    {
  • trunk/network/dostupnost.php

    r208 r217  
    2727    LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 30 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 30 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodMonth ON PeriodMonth.host_id = NetworkDevice.id
    2828    LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 365 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 365 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodYear ON PeriodYear.host_id = NetworkDevice.Id
    29     WHERE NetworkDevice.Used = 1 ORDER BY Name');
     29    WHERE NetworkDevice.Used = 1 AND NetworkDevice.Type IN (1, 4, 5) ORDER BY Name');
    3030    while($Row = $DbResult->fetch_assoc())
    31     if(($Row['Type'] == 1) or ($Row['Type'] == 4))
    3231    {
    3332      $Output .= '<tr><td>'.$Row['Name'].'</td><td style="text-align: right;">'.sprintf('%01.2f', $Row['Hour']).'</td><td style="text-align: right;">'.sprintf('%01.2f', $Row['Day']).'</td><td style="text-align: right;">'.sprintf('%01.2f', $Row['Week']).'</td><td style="text-align: right;">'.sprintf('%01.2f', $Row['Month']).'</td><td style="text-align: right;">'.sprintf('%01.2f', $Row['Year']).'</td></tr>';
Note: See TracChangeset for help on using the changeset viewer.