2007-04-03 14:10:23 +00:00
< ? php
2007-04-04 10:43:23 +00:00
if ( $_GET [ 'location' ]) { $where = " WHERE location = ' $_GET[location] ' " ; }
if ( $_GET [ 'location' ] == " Unset " ) { $where = " WHERE location = '' " ; }
if ( $_GET [ 'type' ]) { $where = " WHERE type = ' $_GET[type] ' " ; }
$sql = " select * from devices $where ORDER BY `ignore`, `status`, `os`, `hostname` " ;
2007-04-08 14:34:19 +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-04-09 01:58:25 +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 );
2007-04-03 14:10:23 +00:00
include ( " includes/hostbox.inc " );
}
echo ( " </table> " );
?>