2008-03-13 11:58:06 +00:00
< ? php
2011-03-12 08:50:47 +00:00
if ( ! is_integer ( $i / 2 )) { $bg_colour = $list_colour_a ; } else { $bg_colour = $list_colour_b ; }
2008-03-13 11:58:06 +00:00
echo ( " <tr bgcolor=' $bg_colour '> " );
2009-08-07 11:53:10 +00:00
echo ( " <td width=100 class=list-large> Vlan " . $vlan [ 'vlan_vlan' ] . " </td> " );
echo ( " <td width=200 class=box-desc> " . $vlan [ 'vlan_descr' ] . " </td> " );
2008-03-13 11:58:06 +00:00
echo ( " <td class=list-bold> " );
2011-09-23 10:35:26 +00:00
2011-12-15 23:14:50 +00:00
$vlan_ports = array ();
$otherports = dbFetchRows ( " SELECT * FROM `ports_vlans` AS V, `ports` as P WHERE V.`device_id` = ? AND V.`vlan` = ? AND P.interface_id = V.interface_id " , array ( $device [ 'device_id' ], $vlan [ 'vlan_vlan' ]));
foreach ( $otherports as $otherport )
{
$vlan_ports [ $otherport [ ifIndex ]] = $otherport ;
}
$otherports = dbFetchRows ( " SELECT * FROM ports WHERE `device_id` = ? AND `ifVlan` = ? " , array ( $device [ 'device_id' ], $vlan [ 'vlan_vlan' ]));
foreach ( $otherports as $otherport )
{
$vlan_ports [ $otherport [ ifIndex ]] = array_merge ( $otherport , array ( 'untagged' => '1' ));
}
ksort ( $vlan_ports );
foreach ( $vlan_ports as $port )
2011-03-12 08:50:47 +00:00
{
2011-11-23 12:53:24 +00:00
$port = ifLabel ( $port , $device );
2011-09-27 13:04:04 +00:00
if ( $vars [ 'view' ] == " graphs " )
2011-03-12 08:50:47 +00:00
{
echo ( " <div style='display: block; padding: 2px; margin: 2px; min-width: 139px; max-width:139px; min-height:85px; max-height:85px; text-align: center; float: left; background-color: " . $list_colour_b_b . " ;'>
2011-03-16 18:28:52 +00:00
< div style = 'font-weight: bold;' > " .makeshortif( $port['ifDescr'] ). " </ div >
2011-09-27 10:07:39 +00:00
< a href = 'device/device=".$device[' device_id ']."/tab=port/port=".$port[' interface_id ']."/' onmouseover = \ " return overlib(' \
2009-08-07 11:53:10 +00:00
< div style = \ 'font-size: 16px; padding:5px; font-weight: bold; color: #e5e5e5;\'>".$device[' hostname ']." - ".$port[' ifDescr ' ] . " </div> \
" . $port['ifAlias'] . " \
2011-09-27 10:15:56 +00:00
< img src = \ 'graph.php?type=$graph_type&id=".$port[' interface_id ' ] . " &from=-2day&to= " . $now . " &width=450&height=150 \ '> \
2009-08-07 11:53:10 +00:00
', CENTER, LEFT, FGCOLOR, ' #e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
2011-09-27 10:15:56 +00:00
" <img src='graph.php?type= $graph_type &id= " . $port [ 'interface_id' ] . " &from=-2day&to= " . $now . " &width=132&height=40&legend=no'>
2009-08-07 11:53:10 +00:00
</ a >
< div style = 'font-size: 9px;' > " .truncate(short_port_descr( $port['ifAlias'] ), 22, ''). " </ div >
</ div > " );
2011-03-12 08:50:47 +00:00
}
else
{
2011-11-23 15:34:23 +00:00
echo ( $vlan [ 'port_sep' ] . generate_port_link ( $port , makeshortif ( $port [ 'label' ])));
2009-08-07 11:53:10 +00:00
$vlan [ 'port_sep' ] = " , " ;
2011-12-15 23:14:50 +00:00
if ( $port [ 'untagged' ]) { echo ( " (U) " ); }
2009-08-07 11:53:10 +00:00
}
2008-03-13 11:58:06 +00:00
}
2011-03-12 08:50:47 +00:00
echo ( '</td></tr>' );
2011-05-12 22:14:56 +00:00
?>