Changeset 222 for trunk/is/topologie-img2.php
- Timestamp:
- May 31, 2009, 8:48:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/is/topologie-img2.php
r80 r222 36 36 } 37 37 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"); 39 41 while($item = $DbResult->fetch_array()) 40 42 { … … 52 54 imageline($im, xpos() + $halfx, ($vtop + 1) * $spacey - 10, xpos() + $halfx, ($vtop + 1) * $spacey, $black); 53 55 } 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; 59 62 } 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; 62 66 $image = $im_dev; 63 67 } 64 if($item[' IP'] == '')65 { 68 if($item['showonline']==0) 69 { 66 70 $color = $gray; 67 71 $image = $im_dev; 68 } else69 {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 } else74 {75 if($item['online'] == 1) { $color = $green; } else $color = $black;76 }77 72 } 78 73 // $text='IP: '.$ip[0];
Note:
See TracChangeset
for help on using the changeset viewer.