= '5') { if(!isset($_GET['optb'])) { $_GET['optb'] = "all"; } if(!isset($_GET['optc'])) { $_GET['optc'] = "basic"; } print_optionbar_start(); echo('VRF » '); if ($_GET['opta'] == "vrf" && $_GET['optb'] == "all") { echo(""); } echo('All'); if ($_GET['opta'] == "vrf" && $_GET['optb'] == "all") { echo(""); } echo(' | '); if ($_GET['opta'] == "vrf" && $_GET['optc'] == "basic") { echo(""); } echo('Basic'); if ($_GET['opta'] == "vrf" && $_GET['optc'] == "basic") { echo(""); } echo(" | "); if ($_GET['opta'] == "vrf" && $_GET['optc'] == "details") { echo(""); } echo('Details'); if ($_GET['opta'] == "vrf" && $_GET['optc'] == "details") { echo(""); } echo(" | Graphs: ( "); if ($_GET['opta'] == "vrf" && $_GET['optc'] == "bits") { echo(""); } echo('Bits'); if ($_GET['opta'] == "vrf" && $_GET['optc'] == "bits") { echo(""); } echo(" | "); if ($_GET['opta'] == "vrf" && $_GET['optc'] == "upkts") { echo(""); } echo('Packets'); if ($_GET['opta'] == "vrf" && $_GET['optc'] == "upkts") { echo(""); } echo(" | "); if ($_GET['opta'] == "vrf" && $_GET['optc'] == "nupkts") { echo(""); } echo('NU Packets'); if ($_GET['opta'] == "vrf" && $_GET['optc'] == "nupkts") { echo(""); } echo(" | "); if ($_GET['opta'] == "vrf" && $_GET['optc'] == "errors") { echo(""); } echo('Errors'); if ($_GET['opta'] == "vrf" && $_GET['optc'] == "errors") { echo(""); } echo(" )"); print_optionbar_end(); if($_GET['optb'] == "all" ) { echo("
"); $i = "1"; foreach (dbFetchRows("SELECT * FROM `vrfs` GROUP BY `mplsVpnVrfRouteDistinguisher`") as $vrf) { if (!is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; } echo(""); echo(""); echo(""); #echo(""); echo(""); $i++; } echo("
" . $vrf['vrf_name'] . "
" . $vrf['mplsVpnVrfDescription'] . "
" . $vrf['mplsVpnVrfRouteDistinguisher'] . "" . $vrf['mplsVpnVrfDescription'] . ""); $x=1; foreach (dbFetchRows("SELECT * FROM `vrfs` AS V, `devices` AS D WHERE `mplsVpnVrfRouteDistinguisher` = ? AND D.device_id = V.device_id", array($vrf['mplsVpnVrfRouteDistinguisher'])) as $device) { if (!is_integer($i/2)) { if (!is_integer($x/2)) { $dev_colour = $list_colour_a_a; } else { $dev_colour = $list_colour_a_b; } } else { if (!is_integer($x/2)) { $dev_colour = $list_colour_b_b; } else { $dev_colour = $list_colour_b_a; } } echo(""); $x++; } // End While echo("
".generate_device_link($device, shorthost($device['hostname']))); if ($device['vrf_name'] != $vrf['vrf_name']) { echo("Configured : ".$device['vrf_name']."', CAPTION, 'VRF Inconsistency' ,FGCOLOR,'#e5e5e5', BGCOLOR, '#c0c0c0', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#050505');\" onmouseout=\"return nd();\"> "); } echo(""); unset($seperator); foreach(dbFetchRows("SELECT * FROM `ports` WHERE `ifVrf` = ? AND `device_id` = ?", array($device['vrf_id'], $device['device_id'])) as $port) { $port = array_merge ($device, $port); switch ($_GET['optc']) { case 'bits': case 'upkts': case 'nupkts': case 'errors': $port['width'] = "130"; $port['height'] = "30"; $port['from'] = $day; $port['to'] = $now; $port['bg'] = "#".$bg; $port['graph_type'] = "port_".$_GET['optc']; echo("
".makeshortif($port['ifDescr'])."
"); generate_port_thumbnail($port); echo("
".truncate(short_port_descr($port['ifAlias']), 22, '')."
"); break; default: echo($seperator.generate_port_link($port,makeshortif($port['ifDescr']))); $seperator = ", "; break; } } echo("
"); } else { echo("
"); $vrf = dbFetchRow("SELECT * FROM `vrfs` WHERE mplsVpnVrfRouteDistinguisher = ?", array($_GET['optb'])); echo(""); echo(""); echo(""); echo(""); echo("
" . $vrf['vrf_name'] . "" . $vrf['mplsVpnVrfRouteDistinguisher'] . "" . $vrf['mplsVpnVrfDescription'] . "
"); $x=0; $devices = dbFetchRows("SELECT * FROM `vrfs` AS V, `devices` AS D WHERE `mplsVpnVrfRouteDistinguisher` = ? AND D.device_id = V.device_id", array($vrf['mplsVpnVrfRouteDistinguisher'])); foreach ($devices as $device) { $hostname = $device['hostname']; if (!is_integer($x/2)) { $device_colour = $list_colour_a; } else { $device_colour = $list_colour_b; } echo(""); include("includes/device-header.inc.php"); echo("
"); unset($seperator); echo('
'); $i=1; foreach (dbFetchRows("SELECT * FROM `ports` WHERE `ifVrf` = ? AND `device_id` = ?", array($device['vrf_id'], $device['device_id'])) as $interface) { if (!is_integer($x/2)) { if (is_integer($i/2)) { $int_colour = $list_colour_a_b; } else { $int_colour = $list_colour_a_a; } } else { if (is_integer($i/2)) { $int_colour = $list_colour_b_a; } else { $int_colour = $list_colour_b_b; } } include("includes/print-interface.inc.php"); $i++; } $x++; echo("
"); echo("
"); } } } else { include("includes/error-no-perm.inc.php"); } ## End Permission if ?>