2007-04-03 14:10:23 +00:00
|
|
|
<?php
|
|
|
|
|
2010-07-26 20:04:31 +00:00
|
|
|
$sql = "SELECT * FROM `ports` WHERE `port_descr_type` = 'cust' GROUP BY `port_descr_descr` ORDER BY `port_descr_descr`";
|
2010-07-04 19:14:42 +00:00
|
|
|
$cust_query = mysql_query($sql);
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2010-07-04 19:14:42 +00:00
|
|
|
echo("<table border=0 cellspacing=0 cellpadding=2 class=devicetable width=100%>");
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2010-07-04 19:14:42 +00:00
|
|
|
echo("
|
|
|
|
<tr bgcolor='$list_colour_a'>
|
|
|
|
<th width='7'></th>
|
|
|
|
<th width='250'><span style='font-weight: bold;' class=interface>Customer</span></th>
|
|
|
|
<th width='150'>Device</th>
|
|
|
|
<th width='100'>Interface</th>
|
|
|
|
<th width='100'>Speed</th>
|
|
|
|
<th width='100'>Circuit</th>
|
|
|
|
<th>Notes</th>
|
|
|
|
</tr>
|
|
|
|
");
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2010-07-04 19:14:42 +00:00
|
|
|
$i = 1;
|
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
while ($customer = mysql_fetch_array($cust_query))
|
|
|
|
{
|
2010-07-04 19:14:42 +00:00
|
|
|
$i++;
|
2011-03-17 00:09:20 +00:00
|
|
|
|
2010-07-26 20:04:31 +00:00
|
|
|
$port_sql = "SELECT * FROM `ports` WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = '".$customer['port_descr_descr']."'";
|
2010-07-04 19:14:42 +00:00
|
|
|
$port_query = mysql_query($port_sql);
|
2008-03-09 23:22:34 +00:00
|
|
|
|
2010-07-04 19:14:42 +00:00
|
|
|
$customer_name = $customer['port_descr_descr'];
|
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
if (!is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; }
|
2010-07-04 19:14:42 +00:00
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
while ($port = mysql_fetch_array($port_query))
|
|
|
|
{
|
|
|
|
$device = device_by_id_cache($port['device_id']);
|
2007-04-08 21:27:05 +00:00
|
|
|
|
2007-04-03 14:10:23 +00:00
|
|
|
unset($class);
|
2007-04-08 21:27:05 +00:00
|
|
|
|
|
|
|
$ifname = fixifname($device['ifDescr']);
|
2010-07-04 19:14:42 +00:00
|
|
|
$ifclass = ifclass($port['ifOperStatus'], $port['ifAdminStatus']);
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
if ($device['os'] == "ios")
|
|
|
|
{
|
|
|
|
if ($port['ifTrunk']) { $vlan = "<span class=box-desc><span class=red>" . $port['ifTrunk'] . "</span></span>"; }
|
|
|
|
elseif ($port['ifVlan']) { $vlan = "<span class=box-desc><span class=blue>VLAN " . $port['ifVlan'] . "</span></span>"; }
|
|
|
|
else { $vlan = ""; }
|
2007-12-03 16:56:58 +00:00
|
|
|
}
|
|
|
|
|
2007-04-03 14:10:23 +00:00
|
|
|
echo("
|
2009-05-12 08:44:00 +00:00
|
|
|
<tr bgcolor='$bg_colour'>
|
2007-04-03 14:10:23 +00:00
|
|
|
<td width='7'></td>
|
2010-07-04 19:14:42 +00:00
|
|
|
<td width='250'><span style='font-weight: bold;' class=interface>".$customer_name."</span></td>
|
2010-08-02 22:09:52 +00:00
|
|
|
<td width='150'>" . generate_device_link($device) . "</td>
|
|
|
|
<td width='100'>" . generate_port_link($port, makeshortif($port['ifDescr'])) . "</td>
|
2010-07-04 19:14:42 +00:00
|
|
|
<td width='100'>".$port['port_descr_speed']."</td>
|
|
|
|
<td width='100'>".$port['port_descr_circuit']."</td>
|
|
|
|
<td>".$port['port_descr_notes']."</td>
|
2007-04-03 14:10:23 +00:00
|
|
|
</tr>
|
|
|
|
");
|
|
|
|
|
2010-07-04 19:14:42 +00:00
|
|
|
|
|
|
|
unset($customer_name);
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
echo("<tr bgcolor='$bg_colour'><td></td><td colspan=6>
|
2011-03-28 09:11:05 +00:00
|
|
|
<img src='".$config['base_url']."/graph.php?id=".rawurlencode($customer['port_descr_descr'])."&type=customer_bits&from=$day&to=$now&width=215&height=100'>
|
|
|
|
<img src='".$config['base_url']."/graph.php?id=".rawurlencode($customer['port_descr_descr'])."&type=customer_bits&from=$week&to=$now&width=215&height=100'>
|
|
|
|
<img src='".$config['base_url']."/graph.php?id=".rawurlencode($customer['port_descr_descr'])."&type=customer_bits&from=$month&to=$now&width=215&height=100'>
|
|
|
|
<img src='".$config['base_url']."/graph.php?id=".rawurlencode($customer['port_descr_descr'])."&type=customer_bits&from=$year&to=$now&width=215&height=100'>
|
2010-07-04 19:14:42 +00:00
|
|
|
</td></tr>");
|
|
|
|
}
|
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
echo("</table>");
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
?>
|