'; foreach (dbFetchRows("SELECT * FROM `ospf_instances` WHERE `ospfAdminStat` = 'enabled'") as $instance) { $device = device_by_id_cache($instance['device_id']); $area_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_areas` WHERE `device_id` = '" . $device['device_id'] . "'"); $port_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_ports` WHERE `device_id` = '" . $device['device_id'] . "'"); $port_count_enabled = dbFetchCell("SELECT COUNT(*) FROM `ospf_ports` WHERE `ospfIfAdminStat` = 'enabled' AND `device_id` = '" . $device['device_id'] . "'"); $nbr_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_nbrs` WHERE `device_id` = '" . $device['device_id'] . "'"); $status_color = $abr_status_color = $asbr_status_color = 'default'; if ($instance['ospfAdminStat'] == 'enabled') { $status_color = 'success'; } if ($instance['ospfAreaBdrRtrStatus'] == 'true') { $abr_status_color = 'success'; } if ($instance['ospfASBdrRtrStatus'] == 'true') { $asbr_status_color = 'success'; } echo ' '; } echo '
  Device Router ID Status ABR ASBR Areas Ports(Enabled) Neighbours
' . generate_device_link($device, 0, array('tab' => 'routing', 'proto' => 'ospf')) . ' ' . $instance['ospfRouterId'] . ' ' . $instance['ospfAdminStat'] . ' ' . $instance['ospfAreaBdrRtrStatus'] . ' ' . $instance['ospfASBdrRtrStatus'] . ' ' . $area_count . ' ' . $port_count . '(' . $port_count_enabled . ') ' . $nbr_count . '
';