Fix device list page.

git-svn-id: http://www.observium.org/svn/observer/trunk@53 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2007-04-04 10:33:12 +00:00
parent e8ba26c033
commit 249b755550
3 changed files with 7 additions and 18 deletions

View File

@@ -20,7 +20,7 @@
$device[version]</td>
<td width='200'>$device[hardware]<br />
$device[features]</td>
<td>" . formatUptime($device[uptime]) . "
<td>" . formatUptime($device[device_uptime]) . "
<br />
$device[location]</td>
<td width=10>

View File

@@ -3,29 +3,18 @@
if($_GET['ignore']) { mysql_query("UPDATE devices SET `ignore` = '1' WHERE `id` = '$_GET[ignore]'"); }
if($_GET['unignore']) { mysql_query("UPDATE devices SET `ignore` = '0' WHERE `id` = '$_GET[unignore]'"); }
if($_GET['location']) { $where = "WHERE location = '$_GET[location]'"; }
if($_GET['location'] == "Unset") { $where = "WHERE location = ''"; }
if($_GET['type']) { $where = "WHERE type = '$_GET[type]'"; }
if($_GET['status'] == "alerted") { $where = $device_alert_sql; }
if($_GET['location']) { $where = "AND location = '$_GET[location]'"; }
if($_GET['location'] == "Unset") { $where = "AND location = ''"; }
if($_GET['type']) { $where = "AND type = '$_GET[type]'"; }
$sql = "select * from devices AS D, device_uptime AS U WHERE D.id = U.device_id $where ORDER BY `ignore`, `status`, `os`, `hostname`";
if($_GET['status'] == "alerted") { $sql = "select *, D.id as id from devices AS D, device_uptime AS U WHERE D.id = U.device_id " . str_replace("WHERE", "OR", $device_alert_sql) . " GROUP BY `id` ORDER BY `ignore`, `status`, `os`, `hostname`"; }
$sql = "select * from devices $where ORDER BY `ignore`, STATUS, os, hostname";
$device_query = mysql_query($sql);
echo("<table cellpadding=7 cellspacing=0 class=devicetable width=100%>");
//echo("<tr class=interface-desc bgcolor=#e5e5e5 style='font-weight:bold;'>
//<td></td>
//<td>Hostname - Description</td>
//<td>Operating System - Version</td>
//<td>Hardware - Features</td>
//<td>Uptime - Location</td>
//<td></td>
//</tr>");
while($device = mysql_fetch_array($device_query)) {
include("includes/hostbox.inc");
}
echo("</table>");

View File

@@ -19,7 +19,7 @@ while($device = mysql_fetch_array($device_query)) {
if($loc != "") {
echo("<table border=0 cellspacing=0 cellpadding=7 class=devicetable width=100%>
<tr bgcolor='$bg'>
<td class=interface width=300><a class='list-bold' href='?page=list&location=$device[location]'>$loc</a></td>
<td class=interface width=300><a class='list-bold' href='?page=devices&location=$device[location]'>$loc</a></td>
<td width='100'>$alert</td>
<td width='100'>$num devices</td>
<td width='100'>$net network</td>