$_POST['bill_name'], 'bill_type' => $_POST['bill_type'], 'bill_cdr' => $_POST['bill_cdr'], 'bill_day' => $_POST['bill_day'], 'bill_gb' => $_POST['bill_quota'], 'bill_custid' => $_POST['bill_custid'], 'bill_ref' => $_POST['bill_ref'], 'bill_notes' => $_POST['bill_notes']); $affected = dbInsert($insert, 'bills'); $message .= $message_break . "Bill ".mres($_POST['bill_name'])." added!"; $message_break .= "
"; } echo(""); if ($_GET['opta'] == "add") { ?>
Add Bill
Description
Billing Type CDR 95th: KBps
Quota: GB
Billing Day

Optional Information

Customer Reference
Billing Reference
Notes
Bills
Add Add Bill
"); $i=1; foreach (dbFetchRows("SELECT * FROM `bills` ORDER BY `bill_name`") as $bill) { #echo("
");
    #print_r($permissions);
    #echo("
"); if (bill_permitted($bill['bill_id'])) { unset($class); $day_data = getDates($bill['bill_day']); $datefrom = $day_data['0']; $dateto = $day_data['1']; $rate_data = getRates($bill['bill_id'],$datefrom,$dateto); $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 = formatRates($bill['bill_cdr'] * 1000); $used = formatRates($rate_data['rate_95th'] * 1000); $percent = round(($rate_data['rate_95th'] / $bill['bill_cdr']) * 100,2); } elseif ($bill['bill_type'] == "quota") { $type = "Quota"; $allowed = formatStorage($bill['bill_gb']* 1024 * 1024 * 1024); $used = formatStorage($rate_data['total_data'] * 1024 * 1024); $percent = round(($rate_data['total_data'] / ($bill['bill_gb'] * 1024)) * 100,2); } $background = get_percentage_colours($percent); $right_background = $background['right']; $left_background = $background['left']; if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } echo(" ".$bill['bill_name']." $notes $type $allowed $used ".print_percentage_bar (350, 20, $perc, NULL, "ffffff", $background['left'], $percent . "%", "ffffff", $background['right'])." Edit Edit "); $i++; } ### PERMITTED } echo(""); } echo(""); ?>