From 7a241765087f50b06098998a754064ace8e23388 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Fri, 8 Jan 2010 23:47:54 +0000 Subject: [PATCH] some code and html cleanups git-svn-id: http://www.observium.org/svn/observer/trunk@625 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/hostbox.inc | 28 +++--- html/includes/print-menubar.php | 168 ++++++++++++++++---------------- html/index.php | 27 ++--- includes/functions.php | 5 +- 4 files changed, 114 insertions(+), 114 deletions(-) diff --git a/html/includes/hostbox.inc b/html/includes/hostbox.inc index b53da3cb9..294468751 100644 --- a/html/includes/hostbox.inc +++ b/html/includes/hostbox.inc @@ -12,22 +12,22 @@ $image = getImage($device['device_id']); - $device['os_text'] = $os_text[$device[os]]; + $device['os_text'] = $os_text[$device['os']]; - echo(" - $image - " . generatedevicelink($device) . " -
$device[sysName] - $device[os_text]
- $device[version] - $device[hardware]
- $device[features] - " . formatUptime($device[uptime]) . " + echo(' + ' . $image . ' + ' . generatedevicelink($device) . ' +
' . $device['sysName'] . ' + ' . $device['os_text'] . '
+ ' . $device['version'] . ' + ' . $device['hardware'] . '
+ ' . $device['features'] . ' + ' . formatUptime($device['uptime']) . '
- $device[location] - + ' . $device['location'] . ' + - "); + '); ?> diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index f4e024e80..ab48ee721 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -9,81 +9,77 @@ $query_a = mysql_query("SELECT * FROM `devices`"); while($device = mysql_fetch_array($query_a)) { - if($device['status'] == 0 && $device['ignore'] == '0') { $this_alert = "1"; } elseif($device['ignore'] == '0') { - if(mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_status = '0' AND service_host = '".$device['device_id']."'"),0)) { $this_alert = "1"; } - if(mysql_result(mysql_query("SELECT count(*) FROM interfaces WHERE `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up' AND device_id = '" . $device['device_id'] . "'"),0)) { $this_alert = "1"; } + $this_alert = 0; + if ($device['status'] == 0 && $device['ignore'] == '0') { $this_alert = "1"; } elseif ($device['ignore'] == '0') { + if (mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_status = '0' AND service_host = '".$device['device_id']."'"),0)) { $this_alert = "1"; } + if (mysql_result(mysql_query("SELECT count(*) FROM interfaces WHERE `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up' AND device_id = '" . $device['device_id'] . "'"),0)) { $this_alert = "1"; } } - if($this_alert) { + if ($this_alert) { $device_alerts++; $device_alert_sql .= " OR `device_id` = '" . $device['device_id'] . "'"; } - unset($this_alert); } ?>