Ignore:
Timestamp:
May 31, 2009, 8:48:51 PM (16 years ago)
Author:
hajdam
Message:

Úprava zobrazení topologie

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/is/topologie-img2.php

    r80 r222  
    3636}
    3737
    38 $DbResult = $Database->query("SELECT * FROM hosts, hosts_topology WHERE host = id AND used=1");
     38//$DbResult = $Database->query("SELECT * FROM hosts, hosts_topology WHERE host = id AND used=1");
     39$DbResult = $Database->query("SELECT tpl.*, tpl.host AS id, dev.name AS name, dev.online AS online, dtp.iconname AS iconname, dtp.showonline AS showonline
     40  FROM hosts_topology tpl LEFT JOIN NetworkDevice dev ON dev.id = tpl.host LEFT JOIN NetworkDeviceType dtp ON dev.type = dtp.id");
    3941while($item = $DbResult->fetch_array())
    4042{
     
    5254      imageline($im, xpos() + $halfx, ($vtop + 1) * $spacey - 10, xpos() + $halfx, ($vtop + 1) * $spacey, $black);
    5355    }
    54     $ip = explode('.',$item['IP']);
    55     if(!array_key_exists(3, $ip)) $ip[3] = '';
    56     if($ip[3] < 100)
    57     {
    58       $image = $im_comp;
     56//    $ip = explode('.',$item['IP']);
     57//    if(!array_key_exists(3, $ip)) $ip[3] = '';
     58    if ($item['iconname']=='comp')
     59    {
     60      if($item['online'] == 1) { $color = $green; } else $color = $black;
     61      $image = $im_comp;
    5962    } else $image = $im_dev; 
    60     if(($ip[0] != 192) and ($ip[0] != 168))
    61     {
     63    if ($item['iconname']=='device')
     64    {
     65      if($item['online'] == 1) { $color = $green; } else $color = $red;
    6266      $image = $im_dev;
    6367    }
    64     if($item['IP'] == '')
    65     { 
     68    if($item['showonline']==0)
     69    {
    6670      $color = $gray;
    6771      $image = $im_dev;
    68     } else
    69     {
    70       if((($ip[0] != 192) and ($ip[0] != 168)) or ($ip[3] >= 100) or ($ip[3] == 1))
    71       {
    72         if($item['online'] == 1) { $color = $green; } else $color = $red;
    73       } else
    74       {
    75         if($item['online'] == 1) { $color = $green; } else $color = $black;
    76       }
    7772    }
    7873//      $text='IP: '.$ip[0];
Note: See TracChangeset for help on using the changeset viewer.