$_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'], ); $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 'Add'; if ($vars['view'] == 'add') { echo ''; } } echo '
Back to Bills
'; print_optionbar_end(); ?>

Bill : Add Bill

'.$port['hostname'], '" style="color: #000;"> '.$port['hostname'], $devicebtn); $devicebtn = str_replace("overlib('", "overlib('
", $devicebtn); $devicebtn = str_replace("
',;", "
',", $devicebtn); $portbtn = str_replace('">'.strtolower($port['ifName']), '" style="color: #000;"> '.$port['ifName'].''.$portalias, $portbtn); $portbtn = str_replace("overlib('", "overlib('
", $portbtn); $portbtn = str_replace("
',;", "
',", $portbtn); echo "
\n"; echo ' \n"; echo " Ports\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo ' '.$devicebtn."\n"; echo ' '.$portbtn."\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; }//end if ?>
CDR 95th Quota

Optional Information

Billing name Type Allowed Used Overusage "; foreach (dbFetchRows('SELECT * FROM `bills` ORDER BY `bill_name`') 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 = getRates($bill['bill_id'],$datefrom,$dateto); $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']; if (!is_integer($i / 2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } echo " 'bill', 'bill_id' => $bill['bill_id']))."'>".$bill['bill_name'].'
'.strftime('%F', strtotime($datefrom)).' to '.strftime('%F', strtotime($dateto))." $notes $type $allowed $used $overuse ".print_percentage_bar(250, 20, $percent, null, 'ffffff', $background['left'], $percent.'%', 'ffffff', $background['right'])." 'bill', 'bill_id' => $bill['bill_id'], 'view' => 'edit'))."'>Edit Edit "; $i++; } //end if }//end foreach echo ''; }//end if // echo("");