2007-04-03 14:10:23 +00:00
<? php
2007-06-24 14:56:47 +00:00
if ( $_GET [ 'location' ]) { $where = "AND location = ' $_GET[location] '" ; }
if ( $_GET [ 'location' ] == "Unset" ) { $where = "AND location = ''" ; }
if ( $_GET [ 'type' ]) { $where = "AND type = ' $_GET[type] '" ; }
2007-04-04 10:43:23 +00:00
2008-03-16 15:16:31 +00:00
$sql = "select * from devices WHERE 1 $where ORDER BY `ignore`, `status`, `hostname`" ;
2007-06-24 14:56:47 +00:00
if ( $_GET [ 'status' ] == "alerted" ) {
$sql = "select * from devices " . $device_alert_sql . " GROUP BY `device_id` ORDER BY `ignore`, `status`, `os`, `hostname`" ;
}
2007-04-03 14:10:23 +00:00
$device_query = mysql_query ( $sql );
echo ( "<table cellpadding=7 cellspacing=0 class=devicetable width=100%>" );
while ( $device = mysql_fetch_array ( $device_query )) {
2007-11-21 14:26:24 +00:00
if ( devicepermitted ( $device [ 'device_id' ]) || $_SESSION [ 'userlevel' ] >= '5' ) {
2007-06-24 14:56:47 +00:00
$device [ 'uptime' ] = @ mysql_result ( mysql_query ( "SELECT `attrib_value` FROM `devices_attribs` WHERE `device_id` = '" . $device [ 'device_id' ] . "' AND `attrib_type` = 'uptime'" ), 0 );
include ( "includes/hostbox.inc" );
}
2007-04-03 14:10:23 +00:00
}
echo ( "</table>" );
?>