2009-10-21 11:37:03 +00:00
< ? php
echo ( "
< div style = 'width: 100%; text-align: right; padding-bottom: 10px; clear: both; display:block; height:20px;' >
2011-03-28 20:29:34 +00:00
< a href = '/vrf/" . $device[' device_id '] . "/' > Basic </ a > |
< a href = '/vrf/" . $device[' device_id '] . "/details/' > Details </ a > | Graphs :
< a href = '/vrf/" . $device[' device_id '] . "/graphs/bits/' > Bits </ a > |
< a href = '/vrf/" . $device[' device_id '] . "/graphs/pkts/' > Packets </ a > |
< a href = '/vrf/" . $device[' device_id '] . "/graphs/nupkts/' > NU Packets </ a > |
< a href = '/vrf/" . $device[' device_id '] . "/graphs/errors/' > Errors </ a >
2011-03-17 00:09:20 +00:00
</ div > " );
2009-10-21 11:37:03 +00:00
2011-03-17 00:09:20 +00:00
if ( $_GET [ 'opta' ] == 'graphs' )
{
if ( $_GET [ 'optb' ])
{
2009-10-21 11:37:03 +00:00
$graph_type = $_GET [ 'optb' ];
} else {
$graph_type = " bits " ;
}
$dographs = 1 ;
}
2011-03-17 00:09:20 +00:00
if ( $_GET [ 'opta' ] == " details " )
{
2009-10-21 11:37:03 +00:00
$port_details = 1 ;
}
2011-03-17 00:09:20 +00:00
echo ( " <div style='background: $list_colour_b ; padding: 10px;'><table border=0 cellspacing=0 cellpadding=5 width=100%> " );
2011-03-28 20:29:34 +00:00
$vrf_query = mysql_query ( " SELECT * FROM `vrfs` WHERE mplsVpnVrfRouteDistinguisher = ' " . $device [ 'device_id' ] . " ' " );
2011-03-17 00:09:20 +00:00
$vrf = mysql_fetch_array ( $vrf_query );
echo ( " <tr valign=top bgcolor=' $bg_colour '> " );
echo ( " <td width=200 class=list-large><a href='vrf/ " . $vrf [ 'mplsVpnVrfRouteDistinguisher' ] . " /'> " . $vrf [ 'vrf_name' ] . " </a></td> " );
echo ( " <td width=100 class=box-desc> " . $vrf [ 'mplsVpnVrfRouteDistinguisher' ] . " </td> " );
echo ( " <td width=200 class=box-desc> " . $vrf [ 'mplsVpnVrfDescription' ] . " </td> " );
echo ( " </table></div> " );
2009-10-21 11:37:03 +00:00
2011-03-17 00:09:20 +00:00
$devices = mysql_query ( " SELECT * FROM `vrfs` AS V, `devices` AS D WHERE `mplsVpnVrfRouteDistinguisher` = ' " . $vrf [ 'mplsVpnVrfRouteDistinguisher' ] . " ' AND D.device_id = V.device_id " );
$x = 1 ;
2009-10-21 11:37:03 +00:00
2011-03-17 00:09:20 +00:00
while ( $device = mysql_fetch_array ( $devices ))
{
$hostname = $device [ 'hostname' ];
#if (!is_integer($x/2)) { $device_colour = $list_colour_a; } else { $device_colour = $list_colour_b; }
echo ( " <table cellpadding=7 cellspacing=0 class=devicetable width=100%> " );
include ( " includes/device-header.inc.php " );
echo ( " </table> " );
$ports = mysql_query ( " SELECT * FROM `ports` WHERE `ifVrf` = ' " . $device [ 'vrf_id' ] . " ' and device_id = ' " . $device [ 'device_id' ] . " ' " );
unset ( $seperator );
echo ( " <table cellspacing=0 cellpadding=7> " );
$i = 1 ;
while ( $interface = mysql_fetch_array ( $ports ))
{
if ( ! is_integer ( $x / 2 ))
{
if ( is_integer ( $i / 2 )) { $int_colour = $list_colour_a_a ; } else { $int_colour = $list_colour_a_b ; }
} else {
if ( is_integer ( $i / 2 )) { $int_colour = $list_colour_b_b ; } else { $int_colour = $list_colour_b_a ; }
}
include ( " includes/print-interface.inc.php " );
$i ++ ;
}
$x ++ ;
echo ( " </table> " );
echo ( " <div style='height: 10px;'></div> " );
}
2009-10-21 11:37:03 +00:00
2011-03-17 00:09:20 +00:00
?>