* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited * */ register_html_title("Customers"); $navbar['brand'] = "Customers"; $navbar['class'] = "navbar-narrow"; if (isset($vars['customer']) && $vars['customer'] == 'hide') { $navbar['options_right']['cust']['class'] = 'active'; $navbar['options_right']['cust']['url'] = generate_url($vars, array('customer' => NULL)); } else { $navbar['options_right']['cust']['url'] = generate_url($vars, array('customer' => 'hide')); } $navbar['options_right']['cust']['text'] = 'Customer Graphs'; $navbar['options_right']['cust']['icon'] = $config['icon']['graphs']; if (isset($vars['aggregate']) && $vars['aggregate'] == 'show') { $navbar['options_right']['aggregate']['class'] = 'active'; $navbar['options_right']['aggregate']['url'] = generate_url($vars, array('aggregate' => NULL)); } else { $navbar['options_right']['aggregate']['url'] = generate_url($vars, array('aggregate' => 'show')); } $navbar['options_right']['aggregate']['text'] = 'Aggregate'; $navbar['options_right']['aggregate']['icon'] = $config['icon']['graphs']; print_navbar($navbar); unset($navbar); /// Generate customer aggregate graph if (isset($vars['aggregate']) && $vars['aggregate'] == 'show') { $where = "WHERE `port_descr_type` = 'cust'"; $where .= generate_query_permitted(array('port')); $ports = dbFetchRows('SELECT `port_id` FROM `ports` ' . $where); $port_list = array(); foreach ($ports as $port) { $port_list[] = $port['port_id']; } $port_list = implode(',', $port_list); echo generate_box_open(array('title' => 'Total Customer Traffic')); if ($port_list) { $graph_array['type'] = 'multi-port_bits_separate'; $graph_array['to'] = $config['time']['now']; $graph_array['legend'] = 'no'; $graph_array['id'] = $port_list; print_graph_row($graph_array); } echo generate_box_close(); } echo generate_box_open(); ?>
Customer | Device | Interface | Speed | Circuit | Notes | |
---|---|---|---|---|---|---|
' . $customer_name . ' | ' . generate_device_link($device) . ' | ' . generate_port_link_short($port) . ' | ' . $port['port_descr_speed'] . ' | ' . $port['port_descr_circuit'] . ' | ' . $port['port_descr_notes'] . ' | |
'); $graph_array['type'] = "customer_bits"; $graph_array['to'] = $config['time']['now']; $graph_array['id'] = '"' . $port['port_descr_descr'] . '"'; // use double quotes for prevent split var by commas print_graph_row($graph_array); echo(" |