Files

89 lines
2.2 KiB
PHP
Raw Permalink Normal View History

2007-04-15 14:37:12 +00:00
<?php
$link_array = array(
'page' => 'device',
'device' => $device['device_id'],
'tab' => 'vlans',
);
2011-09-27 13:04:04 +00:00
print_optionbar_start();
echo "<span style='font-weight: bold;'>VLANs</span> &#187; ";
if ($vars['view'] == 'graphs' || $vars['view'] == 'minigraphs') {
if (isset($vars['graph'])) {
$graph_type = 'port_'.$vars['graph'];
2016-08-18 20:28:22 -05:00
} else {
$graph_type = 'port_bits';
}
2011-09-27 13:04:04 +00:00
}
if (!$vars['view']) {
$vars['view'] = 'basic';
}
2011-09-27 13:04:04 +00:00
$menu_options['basic'] = 'Basic';
// $menu_options['details'] = 'Details';
$sep = '';
foreach ($menu_options as $option => $text) {
echo $sep;
if ($vars['view'] == $option) {
echo "<span class='pagemenu-selected'>";
}
echo generate_link($text, $link_array, array('view' => $option));
if ($vars['view'] == $option) {
echo '</span>';
}
$sep = ' | ';
2011-09-27 13:04:04 +00:00
}
unset($sep);
echo ' | Graphs: ';
$graph_types = array(
'bits' => 'Bits',
'upkts' => 'Unicast Packets',
'nupkts' => 'Non-Unicast Packets',
'errors' => 'Errors',
);
foreach ($graph_types as $type => $descr) {
echo "$type_sep";
if ($vars['graph'] == $type && $vars['view'] == 'graphs') {
echo "<span class='pagemenu-selected'>";
}
echo generate_link($descr, $link_array, array('view' => 'graphs', 'graph' => $type));
if ($vars['graph'] == $type && $vars['view'] == 'graphs') {
echo '</span>';
}
/*
echo(' (');
if ($vars['graph'] == $type && $vars['type'] == "minigraphs") { echo("<span class='pagemenu-selected'>"); }
echo(generate_link('Mini',$link_array,array('type'=>'minigraphs','graph'=>$type)));
if ($vars['graph'] == $type && $vars['type'] == "minigraphs") { echo("</span>"); }
echo(')');
*/
$type_sep = ' | ';
2011-09-27 13:04:04 +00:00
}
print_optionbar_end();
echo '<table border="0" cellspacing="0" cellpadding="5" width="100%">';
2009-08-11 15:41:11 +00:00
$i = '1';
2007-04-15 14:37:12 +00:00
foreach (dbFetchRows("SELECT * FROM `vlans` WHERE `device_id` = ? ORDER BY 'vlan_vlan'", array($device['device_id'])) as $vlan) {
2019-04-11 23:26:42 -05:00
include 'includes/html/print-vlan.inc.php';
2012-04-06 13:56:23 +00:00
$i++;
2011-03-16 23:10:10 +00:00
}
echo '</table>';
$pagetitle[] = 'VLANs';