= '10') { include 'pages/bill/actions.inc.php'; } if (bill_permitted($bill_id)) { $bill_data = dbFetchRow('SELECT * FROM bills WHERE bill_id = ?', array($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, '".$config['dateformat']['mysql']['date']."')"); $totext = dbFetchCell("SELECT DATE_FORMAT($dateto, '".$config['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', array($bill_id) ); if (!$vars['view']) { $vars['view'] = 'quick'; } function print_port_list() { global $ports; echo '

Billed Ports

'; // Collected Earlier foreach ($ports as $port) { $portalias = (empty($port['ifAlias']) ? '' : ' - '.display($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 = array( 'quick' => 'Quick Graphs', 'accurate' => 'Accurate Graphs', 'transfer' => 'Transfer Graphs', 'history' => 'Historical Graphs' ); if ($_SESSION['userlevel'] >= '10') { $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, array('view' => $option)); if ($vars['view'] == $option) { echo ''; } $sep = ' | '; } echo '
Back to Bills
'; print_optionbar_end(); if ($vars['view'] == 'edit' && $_SESSION['userlevel'] >= '10') { include 'pages/bill/edit.inc.php'; } elseif ($vars['view'] == 'delete' && $_SESSION['userlevel'] >= '10') { include 'pages/bill/delete.inc.php'; } elseif ($vars['view'] == 'reset' && $_SESSION['userlevel'] >= '10') { include 'pages/bill/reset.inc.php'; } elseif ($vars['view'] == 'history') { include 'pages/bill/history.inc.php'; } elseif ($vars['view'] == 'transfer') { include '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 = ""; }//end if ?>

Billing View

24 Hour View

Monthly View