From f6a4352522883a3a1cd9a2c466c47b932c740438 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Tue, 26 Apr 2011 15:26:36 +0000 Subject: [PATCH] only show ADSL/Neighbours on those devices which have entries git-svn-id: http://www.observium.org/svn/observer/trunk@2170 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/pages/device/ports.inc.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/html/pages/device/ports.inc.php b/html/pages/device/ports.inc.php index 1a809c160..2844889c6 100644 --- a/html/pages/device/ports.inc.php +++ b/html/pages/device/ports.inc.php @@ -7,11 +7,18 @@ if ($_GET['opta'] == 'graphs') print_optionbar_start(); -$menu_options = array('basic' => 'Basic', - 'details' => 'Details', - 'neighbours' => 'Neighbours', - 'arp' => 'ARP Table', - 'adsl' => 'ADSL'); +$menu_options['basic'] = 'Basic'; +$menu_options['details'] = 'Details'; +$menu_options['arp'] = 'ARP Table'; + +if(mysql_result(mysql_query("SELECT * FROM links AS L, ports AS I WHERE I.device_id = '".$device['device_id']."' AND I.interface_id = L.local_interface_id"),0)) +{ + $menu_options['neighbours'] = 'Neighbours'; +} +if(mysql_result(mysql_query("SELECT COUNT(*) FROM `interfaces` WHERE `ifType` = 'adsl'"),0)) +{ + $menu_options['adsl'] = 'ADSL'; +} if (!$_GET['opta']) { $_GET['opta'] = "basic"; }