diff --git a/includes/html/pages/device/routing/ospf.inc.php b/includes/html/pages/device/routing/ospf.inc.php index 699ebf52df..ca68a57c05 100644 --- a/includes/html/pages/device/routing/ospf.inc.php +++ b/includes/html/pages/device/routing/ospf.inc.php @@ -27,7 +27,7 @@ foreach (dbFetchRows('SELECT * FROM `ospf_instances` WHERE `device_id` = ?', arr $nbr_count = dbFetchCell('SELECT COUNT(*) FROM `ospf_nbrs` WHERE `device_id` = ?', array($device['device_id'])); $status_color = $abr_status_color = $asbr_status_color = 'default'; - + if ($instance['ospfAdminStat'] == 'enabled') { $status_color = 'success'; } @@ -39,7 +39,7 @@ foreach (dbFetchRows('SELECT * FROM `ospf_instances` WHERE `device_id` = ?', arr if ($instance['ospfASBdrRtrStatus'] == 'true') { $asbr_status_color = 'success'; } - + echo ' @@ -70,7 +70,7 @@ foreach (dbFetchRows('SELECT * FROM `ospf_instances` WHERE `device_id` = ?', arr foreach (dbFetchRows('SELECT * FROM `ospf_areas` WHERE `device_id` = ?', array($device['device_id'])) as $area) { $area_port_count = dbFetchCell('SELECT COUNT(*) FROM `ospf_ports` WHERE `device_id` = ? AND `ospfIfAreaId` = ?', array($device['device_id'], $area['ospfAreaId'])); $area_port_count_enabled = dbFetchCell("SELECT COUNT(*) FROM `ospf_ports` WHERE `ospfIfAdminStat` = 'enabled' AND `device_id` = ? AND `ospfIfAreaId` = ?", array($device['device_id'], $area['ospfAreaId'])); - + echo ' @@ -94,17 +94,18 @@ foreach (dbFetchRows('SELECT * FROM `ospf_instances` WHERE `device_id` = ?', arr Port Type Port State Status + Area ID '; - foreach (dbFetchRows("SELECT * FROM `ospf_ports` AS O, `ports` AS P WHERE O.`ospfIfAdminStat` = 'enabled' AND O.`device_id` = ? AND O.`ospfIfAreaId` = ? AND P.port_id = O.port_id", array($device['device_id'], $area['ospfAreaId'])) as $ospfport) { + foreach (dbFetchRows("SELECT * FROM `ospf_ports` AS O, `ports` AS P WHERE O.`ospfIfAdminStat` = 'enabled' AND O.`device_id` = ? AND P.port_id = O.port_id ORDER BY O.`ospfIfAreaId`", array($device['device_id'])) as $ospfport) { $ospfport = cleanPort($ospfport); $port_status_color = 'default'; if ($ospfport['ospfIfAdminStat'] == 'enabled') { $port_status_color = 'success'; } - + echo ' @@ -112,6 +113,7 @@ foreach (dbFetchRows('SELECT * FROM `ospf_instances` WHERE `device_id` = ?', arr ' . $ospfport['ospfIfType'] . ' ' . $ospfport['ospfIfState'] . ' ' . $ospfport['ospfIfAdminStat'] . ' + ' . $ospfport['ospfIfAreaId'] . ' '; } @@ -133,10 +135,10 @@ foreach (dbFetchRows('SELECT * FROM `ospf_instances` WHERE `device_id` = ?', arr '; foreach (dbFetchRows('SELECT * FROM `ospf_nbrs` WHERE `device_id` = ?', array($device['device_id'])) as $nbr) { $host = @dbFetchRow('SELECT * FROM `ipv4_addresses` AS A, `ports` AS I, `devices` AS D WHERE A.ipv4_address = ? AND I.port_id = A.port_id AND D.device_id = I.device_id', array($nbr['ospfNbrRtrId'])); - + $rtr_id = 'unknown'; $ospfnbr_status_color = 'default'; - + if (is_array($host)) { $rtr_id = generate_device_link($host); }