';
echo "
|
Customer |
Device |
Interface |
Speed |
Circuit |
Notes |
";
$i = 1;
$pagetitle[] = 'Customers';
if (!is_array($config['customers_descr'])) {
$config['customers_descr'] = array($config['customers_descr']);
}
$descr_type = "'".implode("', '", $config['customers_descr'])."'";
foreach (dbFetchRows('SELECT * FROM `ports` WHERE `port_descr_type` IN (?) GROUP BY `port_descr_descr` ORDER BY `port_descr_descr`', array(array($descr_type))) as $customer) {
$i++;
$customer_name = $customer['port_descr_descr'];
if (!is_integer($i / 2)) {
$bg_colour = $list_colour_a;
}
else {
$bg_colour = $list_colour_b;
}
foreach (dbFetchRows('SELECT * FROM `ports` WHERE `port_descr_type` IN (?) AND `port_descr_descr` = ?', array(array($descr_type), $customer['port_descr_descr'])) as $port) {
$device = device_by_id_cache($port['device_id']);
unset($class);
$ifname = fixifname($device['ifDescr']);
$ifclass = ifclass($port['ifOperStatus'], $port['ifAdminStatus']);
if ($device['os'] == 'ios') {
if ($port['ifTrunk']) {
$vlan = ''.$port['ifTrunk'].'';
}
else if ($port['ifVlan']) {
$vlan = 'VLAN '.$port['ifVlan'].'';
}
else {
$vlan = '';
}
}
echo "
|
".$customer_name." |
".generate_device_link($device)." |
".generate_port_link($port, makeshortif($port['ifDescr']))." |
".$port['port_descr_speed']." |
".$port['port_descr_circuit'].' |
'.$port['port_descr_notes'].' |
';
unset($customer_name);
}
echo " | ";
$graph_array['type'] = 'customer_bits';
$graph_array['height'] = '100';
$graph_array['width'] = '220';
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $customer['port_descr_descr'];
include 'includes/print-graphrow.inc.php';
echo ' |
';
}
echo '';