Changeset 192 for trunk/index.php


Ignore:
Timestamp:
Apr 26, 2009, 11:30:31 PM (16 years ago)
Author:
george
Message:
  • Přidáno: Tabulka HostType definující účel zařízení v síti.
  • Opraveno: Zobrazování online stavu počítačů v topologii s adresou IP vyšší než 100.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r189 r192  
    104104    $Output2 = '';
    105105
    106     $DbResult = $this->Database->select('hosts', 'COUNT(*)', 'show_online=1');
     106    $DbResult = $this->Database->query('SELECT COUNT(*) FROM hosts LEFT JOIN HostType ON HostType.Id = hosts.type WHERE HostType.ShowOnline = 1');
    107107    $DbRow = $DbResult->fetch_array();
    108108    $TotalComputers = $DbRow[0];
    109109
    110     $DbResult = $this->Database->select('hosts', 'COUNT(*)', 'show_online=1 AND online=1');
     110    $DbResult = $this->Database->query('SELECT COUNT(*) FROM hosts LEFT JOIN HostType ON HostType.Id = hosts.type WHERE (HostType.ShowOnline = 1) AND (hosts.online = 1)');
    111111    $DbRow = $DbResult->fetch_array();
    112112    $OnlineComputers = $DbRow[0];
     
    118118    $TotalUser = $DbRow[0];
    119119
    120     $DbResult = $this->Database->select('hosts', 'COUNT(DISTINCT(user))', 'show_online=1 AND online=1');
     120    $DbResult = $this->Database->query('SELECT COUNT(DISTINCT(user)) FROM hosts LEFT JOIN HostType ON HostType.Id = hosts.type WHERE HostType.ShowOnline = 1 AND hosts.online = 1');
    121121    $DbRow = $DbResult->fetch_array();
    122122    $OnlineUser = $DbRow[0];
     
    173173  function OnlineHostList()
    174174  {
    175     global $Database;
    176 
    177175    $Output = '<div class="PanelTitle">Online počítače</div><span style="font-size: smaller;">';
    178     $DbResult = $Database->select('hosts', '*', 'online=1 AND show_online=1 ORDER BY name');
     176    $DbResult = $this->Database->query('SELECT hosts.name FROM hosts LEFT JOIN HostType ON HostType.Id = hosts.type WHERE (HostType.ShowOnline = 1) AND (hosts.online = 1) ORDER BY hosts.name');
    179177    while($Row = $DbResult->fetch_array())
    180178    {
Note: See TracChangeset for help on using the changeset viewer.