hasGlobalAdmin()) { include 'includes/html/pages/bill/actions.inc.php'; } if (bill_permitted($bill_id)) { $bill_data = dbFetchRow('SELECT * FROM bills WHERE bill_id = ?', [$bill_id]); $bill_name = $bill_data['bill_name']; $today = str_replace('-', '', dbFetchCell('SELECT CURDATE()')); $yesterday = str_replace('-', '', dbFetchCell('SELECT DATE_SUB(CURDATE(), INTERVAL 1 DAY)')); $tomorrow = str_replace('-', '', dbFetchCell('SELECT DATE_ADD(CURDATE(), INTERVAL 1 DAY)')); $last_month = str_replace('-', '', dbFetchCell('SELECT DATE_SUB(CURDATE(), INTERVAL 1 MONTH)')); $rightnow = $today . date('His'); $before = $yesterday . date('His'); $lastmonth = $last_month . date('His'); $bill_name = $bill_data['bill_name']; $dayofmonth = $bill_data['bill_day']; $day_data = getDates($dayofmonth); $datefrom = $day_data['0']; $dateto = $day_data['1']; $lastfrom = $day_data['2']; $lastto = $day_data['3']; $rate_95th = $bill_data['rate_95th']; $dir_95th = $bill_data['dir_95th']; $total_data = $bill_data['total_data']; $rate_average = $bill_data['rate_average']; if ($rate_95th > $paid_kb) { $over = ($rate_95th - $paid_kb); $bill_text = $over . 'Kbit excess.'; $bill_color = '#cc0000'; } else { $under = ($paid_kb - $rate_95th); $bill_text = $under . 'Kbit headroom.'; $bill_color = '#0000cc'; } $fromtext = dbFetchCell("SELECT DATE_FORMAT($datefrom, '" . \LibreNMS\Config::get('dateformat.mysql.date') . "')"); $totext = dbFetchCell("SELECT DATE_FORMAT($dateto, '" . \LibreNMS\Config::get('dateformat.mysql.date') . "')"); $unixfrom = dbFetchCell("SELECT UNIX_TIMESTAMP('$datefrom')"); $unixto = dbFetchCell("SELECT UNIX_TIMESTAMP('$dateto')"); $unix_prev_from = dbFetchCell("SELECT UNIX_TIMESTAMP('$lastfrom')"); $unix_prev_to = dbFetchCell("SELECT UNIX_TIMESTAMP('$lastto')"); // Speeds up loading for other included pages by setting it before progessing of mysql data! $ports = dbFetchRows( 'SELECT * FROM `bill_ports` AS B, `ports` AS P, `devices` AS D WHERE B.bill_id = ? AND P.port_id = B.port_id AND D.device_id = P.device_id', [$bill_id] ); if (! $vars['view']) { $vars['view'] = 'quick'; } function print_port_list($ports) { echo '

Billed Ports

'; // Collected Earlier foreach ($ports as $port) { $port = cleanPort($port); $portalias = (empty($port['ifAlias']) ? '' : ' - ' . $port['ifAlias'] . ''); echo '
'; echo generate_port_link($port, $port['ifName'] . $portalias) . ' on ' . generate_device_link($port); echo '
'; } echo '
'; }//end print_port_list?>

Bill » '; $menu_options = [ 'quick' => 'Quick Graphs', 'accurate' => 'Accurate Graphs', 'transfer' => 'Transfer Graphs', 'history' => 'Historical Graphs', ]; if (Auth::user()->hasGlobalAdmin()) { $menu_options['edit'] = 'Edit'; $menu_options['delete'] = 'Delete'; $menu_options['reset'] = 'Reset'; } $sep = ''; foreach ($menu_options as $option => $text) { echo $sep; if ($vars['view'] == $option) { echo ""; } echo generate_link($text, $vars, ['view' => $option]); if ($vars['view'] == $option) { echo ''; } $sep = ' | '; } echo '
Back to Bills
'; print_optionbar_end(); if ($vars['view'] == 'edit' && Auth::user()->hasGlobalAdmin()) { include 'includes/html/pages/bill/edit.inc.php'; } elseif ($vars['view'] == 'delete' && Auth::user()->hasGlobalAdmin()) { include 'includes/html/pages/bill/delete.inc.php'; } elseif ($vars['view'] == 'reset' && Auth::user()->hasGlobalAdmin()) { include 'includes/html/pages/bill/reset.inc.php'; } elseif ($vars['view'] == 'history') { include 'includes/html/pages/bill/history.inc.php'; } elseif ($vars['view'] == 'transfer') { include 'includes/html/pages/bill/transfer.inc.php'; } elseif ($vars['view'] == 'quick' || $vars['view'] == 'accurate') { ?>

Quota Bill

CDR / 95th Bill

Billing Period from to

Bill Summary

of - Average rate
of (95th%ile)
"; $li = ""; $li = ""; $di = ""; $mi = ""; }//end if ?>

Billing View

24 Hour View

Monthly View