2011-04-17 15:55:38 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
$datas[] = 'overview';
|
2011-04-19 21:54:43 +00:00
|
|
|
|
2011-04-28 15:01:36 +00:00
|
|
|
if (@mysql_result(mysql_query("select count(*) from vrfs WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0')
|
|
|
|
{
|
|
|
|
$datas[] = 'vrf';
|
|
|
|
}
|
|
|
|
|
2011-04-19 21:54:43 +00:00
|
|
|
$bgp_count = mysql_result(mysql_query("select count(*) from bgpPeers WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
2011-04-17 15:55:38 +00:00
|
|
|
if ($bgp_count) { $datas[] = 'bgp'; }
|
|
|
|
|
2011-04-20 16:37:13 +00:00
|
|
|
$cef_count = mysql_result(mysql_query("select count(*) from cef_switching WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
2011-04-19 21:54:43 +00:00
|
|
|
if ($cef_count) { $datas[] = 'cef'; }
|
|
|
|
|
2011-04-27 01:46:01 +00:00
|
|
|
$ospf_count = mysql_result(mysql_query("select count(*) from ospf_instances WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
|
|
|
if ($ospf_count) { $datas[] = 'ospf'; }
|
|
|
|
|
2011-04-17 15:55:38 +00:00
|
|
|
$type_text['overview'] = "Overview";
|
|
|
|
$type_text['bgp'] = "BGP";
|
2011-04-19 21:54:43 +00:00
|
|
|
$type_text['cef'] = "CEF";
|
2011-04-27 01:46:01 +00:00
|
|
|
$type_text['ospf'] = "OSPF";
|
2011-04-28 15:01:36 +00:00
|
|
|
$type_text['vrf'] = "VRFs";
|
2011-04-17 15:55:38 +00:00
|
|
|
|
|
|
|
print_optionbar_start();
|
|
|
|
|
|
|
|
if (!$_GET['opta']) { $_GET['opta'] = "overview"; }
|
|
|
|
|
|
|
|
unset($sep);
|
|
|
|
foreach ($datas as $type)
|
|
|
|
{
|
|
|
|
echo($sep);
|
|
|
|
|
|
|
|
if ($_GET['opta'] == $type)
|
|
|
|
{
|
|
|
|
echo('<span class="pagemenu-selected">');
|
|
|
|
}
|
|
|
|
|
|
|
|
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/routing/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $type_text[$type] ."</a>");
|
|
|
|
if ($_GET['opta'] == $type) { echo("</span>"); }
|
|
|
|
$sep = " | ";
|
|
|
|
}
|
|
|
|
|
|
|
|
print_optionbar_end();
|
|
|
|
|
|
|
|
if (is_file("pages/device/routing/".mres($_GET['opta']).".inc.php"))
|
|
|
|
{
|
|
|
|
include("pages/device/routing/".mres($_GET['opta']).".inc.php");
|
|
|
|
} else {
|
|
|
|
foreach ($datas as $type)
|
|
|
|
{
|
|
|
|
if ($type != "overview")
|
|
|
|
{
|
2011-04-27 02:03:33 +00:00
|
|
|
if(is_file("pages/device/routing/overview/".mres($type).".inc.php")) {
|
|
|
|
|
|
|
|
$g_i++;
|
|
|
|
if (!is_integer($g_i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
|
|
|
|
|
|
|
echo('<div style="background-color: '.$row_colour.';">');
|
2011-04-27 14:59:50 +00:00
|
|
|
echo('<div style="padding:4px 0px 0px 8px;"><span class=graphhead>'.$type_text[$type].'</span>');
|
2011-04-27 02:03:33 +00:00
|
|
|
include("pages/device/routing/overview/".mres($type).".inc.php");
|
|
|
|
echo('</div>');
|
2011-04-27 14:59:50 +00:00
|
|
|
echo('</div>');
|
2011-04-27 02:03:33 +00:00
|
|
|
} else {
|
|
|
|
$graph_title = $type_text[$type];
|
|
|
|
$graph_type = "device_".$type;
|
|
|
|
include("includes/print-device-graph.php");
|
|
|
|
}
|
2011-04-17 15:55:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|