$_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');
$message .= $message_break.'Bill '.mres($_POST['bill_name']).' ('.$bill_id.') added!';
$message_break .= '
';
if (is_numeric($bill_id) && is_numeric($_POST['port'])) {
dbInsert(array('bill_id' => $bill_id, 'port_id' => $_POST['port']), 'bill_ports');
$message .= $message_break.'Port '.mres($_POST['port']).' added!';
$message_break .= '
';
}
}//end if
$pagetitle[] = 'Billing';
echo "";
if ($vars['view'] == 'history') {
include 'pages/bills/search.inc.php';
include 'pages/bills/pmonth.inc.php';
}
else if ($vars['view'] == 'add') {
if (is_numeric($vars['port'])) {
$port = dbFetchRow('SELECT * FROM `ports` AS P, `devices` AS D WHERE `port_id` = ? AND D.device_id = P.device_id', array($vars['port']));
}
?>
Bill » ";
if (!$vars['view']) {
$vars['view'] = 'add';
}
if ($_SESSION['userlevel'] >= '10') {
if ($vars['view'] == 'add') {
echo " ';
}
}
echo '