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 '
of - Average rate | |||
of (95th%ile) | |||