$_POST['bill_name'], 'bill_type' => $_POST['bill_type'], 'bill_cdr' => $bill_cdr, 'bill_day' => $_POST['bill_day'], 'bill_quota' => $bill_quota, 'bill_custid' => $_POST['bill_custid'], 'bill_ref' => $_POST['bill_ref'], 'bill_notes' => $_POST['bill_notes'], 'rate_95th_in' => 0, 'rate_95th_out' => 0, 'rate_95th' => 0, 'dir_95th' => 'in', 'total_data' => 0, 'total_data_in' => 0, 'total_data_out' => 0, 'rate_average' => 0, 'rate_average_in' => 0, 'rate_average_out' => 0, 'bill_last_calc' => array('NOW()'), 'bill_autoadded' => 0, ); $bill_id = dbInsert($insert, 'bills'); if (is_numeric($bill_id) && is_numeric($_POST['port_id'])) { dbInsert(array('bill_id' => $bill_id, 'port_id' => $_POST['port_id']), 'bill_ports'); } header('Location: /' . generate_url(array('page' => 'bill', 'bill_id' => $bill_id, 'view' => 'edit'))); exit(); } $pagetitle[] = 'Billing'; echo ""; if ($vars['view'] == 'history') { include 'pages/bills/search.inc.php'; include 'pages/bills/pmonth.inc.php'; } else { include 'pages/bills/search.inc.php'; include 'includes/modal/new_bill.inc.php'; ?>
| Billing name | Type | Allowed | Used | Overusage | bill_cdr) OR (bill_type = 'quota' AND total_data > bill_quota))"; } $query = 'SELECT * FROM `bills` '; if (sizeof($wheres) > 0) { $query .= 'WHERE ' . implode(' AND ', $wheres) . "\n"; } $query .= 'ORDER BY bills.bill_name'; foreach (dbFetchRows($query, $params) as $bill) { if (bill_permitted($bill['bill_id'])) { unset($class); $day_data = getDates($bill['bill_day']); $datefrom = $day_data['0']; $dateto = $day_data['1']; $rate_data = $bill; $rate_95th = $rate_data['rate_95th']; $dir_95th = $rate_data['dir_95th']; $total_data = $rate_data['total_data']; $rate_average = $rate_data['rate_average']; if ($bill['bill_type'] == 'cdr') { $type = 'CDR'; $allowed = format_si($bill['bill_cdr']).'bps'; $used = format_si($rate_data['rate_95th']).'bps'; $percent = round((($rate_data['rate_95th'] / $bill['bill_cdr']) * 100), 2); $background = get_percentage_colours($percent); $overuse = ($rate_data['rate_95th'] - $bill['bill_cdr']); $overuse = (($overuse <= 0) ? '-' : ''.format_si($overuse).'bps'); } else if ($bill['bill_type'] == 'quota') { $type = 'Quota'; $allowed = format_bytes_billing($bill['bill_quota']); $used = format_bytes_billing($rate_data['total_data']); $percent = round((($rate_data['total_data'] / ($bill['bill_quota'])) * 100), 2); $background = get_percentage_colours($percent); $overuse = ($rate_data['total_data'] - $bill['bill_quota']); $overuse = (($overuse <= 0) ? '-' : ''.format_bytes_billing($overuse).''); } $right_background = $background['right']; $left_background = $background['left']; ?> | ||
|---|---|---|---|---|---|---|---|
|
'bill', 'bill_id' => $bill['bill_id'])) ?>'>
to |
= 10) { ?>
'bill', 'bill_id' => $bill['bill_id'], 'view' => 'edit')) ?>'> Edit
|