| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-16 18:28:52 +00:00
										 |  |  |    if ($bg == $list_colour_b) { $bg = $list_colour_a; } else { $bg = $list_colour_b; } | 
					
						
							| 
									
										
										
										
											2010-02-08 18:07:00 +00:00
										 |  |  |    if ($device['status'] == '0') { $class = "list-device-down"; $bg_image = "images/warning-background.png"; } else { $class = "list-device"; unset ($bg_image); } | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |    if ($device['ignore'] == '1') { | 
					
						
							|  |  |  |      $class = "list-device-ignored"; | 
					
						
							|  |  |  |      if ($device['status'] == '1') { $class = "list-device-ignored-up"; } | 
					
						
							|  |  |  |    } | 
					
						
							| 
									
										
										
										
											2007-04-09 01:58:25 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |    $type = strtolower($device['os']); | 
					
						
							|  |  |  |    unset($image); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-04-08 18:09:21 +00:00
										 |  |  |    $image = getImage($device['device_id']); | 
					
						
							| 
									
										
										
										
											2010-02-21 17:02:20 +00:00
										 |  |  |    if ($device['os'] == "ios") { formatCiscoHardware($device, true); } | 
					
						
							| 
									
										
										
										
											2011-03-16 18:28:52 +00:00
										 |  |  |    $device['os_text'] = $config['os'][$device['os']]['text']; | 
					
						
							| 
									
										
										
										
											2009-11-28 09:48:23 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-09-26 22:10:04 +00:00
										 |  |  |    $port_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `ports` WHERE `device_id` = '".$device['device_id']."'"),0); | 
					
						
							|  |  |  |    $sensor_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `sensors` WHERE `device_id` = '".$device['device_id']."'"),0); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-16 18:28:52 +00:00
										 |  |  |    echo('  <tr background="'.$bg_image.'" bgcolor="' . $bg . '" onmouseover="this.style.backgroundColor=\'#fdd\';" onmouseout="this.style.backgroundColor=\'' . $bg . '\';"
 | 
					
						
							| 
									
										
										
										
											2011-03-04 16:07:30 +00:00
										 |  |  |              onclick="location.href=\'/device/'.$device['device_id'].'/\'" style="cursor: pointer;"> | 
					
						
							| 
									
										
										
										
											2010-01-08 23:47:54 +00:00
										 |  |  |              <td width="40" align="center" valign="middle">' . $image . '</td> | 
					
						
							| 
									
										
										
										
											2010-08-02 22:09:52 +00:00
										 |  |  |              <td width="300"><span style="font-weight: bold; font-size: 14px;">' . generate_device_link($device) . '</span> | 
					
						
							| 
									
										
										
										
											2010-01-08 23:47:54 +00:00
										 |  |  |              <br />' . $device['sysName'] . '</td> | 
					
						
							| 
									
										
										
										
											2010-09-26 22:48:48 +00:00
										 |  |  | 	     <td width=55>'); | 
					
						
							| 
									
										
										
										
											2010-09-26 22:10:04 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-16 18:28:52 +00:00
										 |  |  |     if ($port_count) { echo(' <img src="images/icons/port.png" align=absmiddle> '.$port_count); } | 
					
						
							| 
									
										
										
										
											2010-09-26 22:10:04 +00:00
										 |  |  |     echo('<br />'); | 
					
						
							| 
									
										
										
										
											2011-03-16 18:28:52 +00:00
										 |  |  |     if ($sensor_count) { echo(' <img src="images/icons/sensors.png" align=absmiddle> '.$sensor_count); } | 
					
						
							| 
									
										
										
										
											2010-09-26 22:10:04 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     echo('   </td> | 
					
						
							| 
									
										
										
										
											2010-01-08 23:47:54 +00:00
										 |  |  |              <td width="200">' . $device['os_text'] . '<br /> | 
					
						
							|  |  |  |              ' . $device['version'] . '</td> | 
					
						
							|  |  |  |              <td width="200">' . $device['hardware'] . '<br /> | 
					
						
							|  |  |  |              ' . $device['features'] . '</td> | 
					
						
							|  |  |  |              <td>' . formatUptime($device['uptime']) . ' | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |              <br /> | 
					
						
							| 
									
										
										
										
											2010-01-08 23:47:54 +00:00
										 |  |  |              ' . $device['location'] . '</td> | 
					
						
							|  |  |  |              <td width="10"> | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |              </td> | 
					
						
							| 
									
										
										
										
											2010-01-08 23:47:54 +00:00
										 |  |  |            </tr>'); | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ?>
 |