From a46d4d7ce30f7da379062be85dba9d0e9933d265 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Fri, 8 Jan 2010 23:09:25 +0000 Subject: [PATCH] fixed the interface display in event log, plus some html fixes git-svn-id: http://www.observium.org/svn/observer/trunk@624 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/print-event.inc | 25 ++++++++++--------------- html/pages/device/events.inc.php | 6 +++--- html/pages/eventlog.php | 4 ++-- includes/common.php | 6 ++++++ 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/html/includes/print-event.inc b/html/includes/print-event.inc index ac23a7f101..288128a1c4 100644 --- a/html/includes/print-event.inc +++ b/html/includes/print-event.inc @@ -4,19 +4,18 @@ if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; } $hostname = gethostbyid($entry['host']); - $interface = fixifname(getifbyid($entry['interface'])); unset($icon); $icon = geteventicon($entry['message']); - if($icon) {$icon = ""; } + if($icon) {$icon = ''; } - echo(" - - - " . $entry['datetime'] . " - "); + echo(' + + + ' . $entry['datetime'] . ' + '); if(!$_GET[id] && !$overview) { $dev['device_id'] = $entry['host']; $dev['hostname'] = $hostname; @@ -25,15 +24,11 @@ if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; } "); } - echo(""); - - if($interface) { - $if['interface_id'] = $entry['interface']; - $if['ifDescr'] = $interface; - echo(generateiflink($if)); + echo(''); + if($entry['interface']) { + echo(generateiflink(getifbyid($entry['interface']))); } - echo(" " . htmlspecialchars($entry['message']) . " - + echo("" . htmlspecialchars($entry['message']) . " "); diff --git a/html/pages/device/events.inc.php b/html/pages/device/events.inc.php index bd6b01e56f..c20b41283d 100644 --- a/html/pages/device/events.inc.php +++ b/html/pages/device/events.inc.php @@ -2,11 +2,11 @@ $query = "SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` WHERE `host` = '$_GET[id]' ORDER BY `datetime` DESC LIMIT 0,250"; $data = mysql_query($query); -echo(""); +echo('
'); while($entry = mysql_fetch_array($data)) { include("includes/print-event.inc"); } -echo("
"); +echo(''); - ?> +?> diff --git a/html/pages/eventlog.php b/html/pages/eventlog.php index b57b713c38..63985c83f1 100644 --- a/html/pages/eventlog.php +++ b/html/pages/eventlog.php @@ -9,7 +9,7 @@ if($_SESSION['userlevel'] >= '5') { $data = mysql_query($query); -echo(""); +echo('
'); while($entry = mysql_fetch_array($data)) { include("includes/print-event.inc"); @@ -17,4 +17,4 @@ while($entry = mysql_fetch_array($data)) { echo("
"); - ?> +?> diff --git a/includes/common.php b/includes/common.php index 4c7145015c..5c1ebc01fc 100644 --- a/includes/common.php +++ b/includes/common.php @@ -51,6 +51,12 @@ function getifindexbyid($id) { } function getifbyid($id) { + $sql = mysql_query("SELECT * FROM `interfaces` WHERE `interface_id` = '$id'"); + $result = @mysql_fetch_array($sql); + return $result; +} + +function getifdescrbyid($id) { $sql = mysql_query("SELECT `ifDescr` FROM `interfaces` WHERE `interface_id` = '$id'"); $result = @mysql_result($sql, 0); return $result;