Billed Ports"); foreach ($ports as $port) { echo(generate_port_link($port) . " on " . generate_device_link($port) . "
"); } $cur_days = date('d', (strtotime("now") - strtotime($datefrom))); $total_days = date('d', (strtotime($dateto) - strtotime($datefrom))); $total['data'] = format_bytes_billing($bill_data['total_data']); if ($bill_data['bill_type'] == "quota") { $total['allow'] = format_bytes_billing($bill_data['bill_quota']); } else { $total['allow'] = "-"; } $total['ave'] = format_bytes_billing($bill_data['total_data'] / $cur_days); $total['est'] = format_bytes_billing($bill_data['total_data'] / $cur_days * $total_days); $total['per'] = round(($bill_data['total_data'] / $bill_data['bill_quota'] * 100), 2); $total['bg'] = get_percentage_colours($total['per']); $in['data'] = format_bytes_billing($bill_data['total_data_in']); $in['allow'] = $total['allow']; $in['ave'] = format_bytes_billing($bill_data['total_data_in'] / $cur_days); $in['est'] = format_bytes_billing($bill_data['total_data_in'] / $cur_days * $total_days); $in['per'] = round(($bill_data['total_data_in'] / $bill_data['total_data'] * 100), 2); $in['bg'] = get_percentage_colours($in['per']); $out['data'] = format_number($bill_data['total_data_out'] , $config['billing']['base']); $out['allow'] = $total['allow']; $out['ave'] = format_bytes_billing($bill_data['total_data_out'] / $cur_days); $out['est'] = format_bytes_billing($bill_data['total_data_out'] / $cur_days * $total_days); $out['per'] = round(($bill_data['total_data_out'] / $bill_data['total_data'] * 100), 2); $out['bg'] = get_percentage_colours($out['per']); $ousage['over'] = $bill_data['total_data'] - ($bill_data['bill_gb'] * $config['billing']['base']); $ousage['over'] = (($ousage['over'] < 0) ? "0" : $ousage['over']); $ousage['data'] = format_number($ousage['over'] , $config['billing']['base']); $ousage['allow'] = $total['allow']; $ousage['ave'] = format_bytes_billing($ousage['over'] / $cur_days ); $ousage['est'] = format_bytes_billing($ousage['over'] / $cur_days * $total_days); $ousage['per'] = round((($bill_data['total_data'] / $bill_data['bill_quota'] * 100) - 100), 2); $ousage['per'] = (($ousage['per'] < 0) ? "0" : $ousage['per']); $ousage['bg'] = get_percentage_colours($ousage['per']); function showPercent($per) { $background = get_percentage_colours($per); $right_background = $background['right']; $left_background = $background['left']; $res = print_percentage_bar(350, 20, $perc, NULL, "ffffff", $left_background, $per."%", "ffffff", $right_background); return $res; } echo("

Bill Summary

"); echo("

Quota Bill

"); echo(""); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); if ($ousage['over'] > 0 && $bill_data['bill_type'] == "quota") { echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); echo(" "); } echo("
Billing Period from ".$fromtext." to ".$totext."
BandwidthUsedAllowedAverageEstimated
Transferred:".$total['data']."".$total['allow']."".$total['ave']."".$total['est']."".showPercent($total['per'])."
Inbound:".$in['data']."".$in['allow']."".$in['ave']."".$in['est']."".showPercent($in['per'])."
Outbound:".$out['data']."".$out['allow']."".$out['ave']."".$out['est']."".showPercent($out['per'])."
Already overusage:".$ousage['data']."".$ousage['allow']."".$ousage['ave']."".$ousage['est']."".showPercent($ousage['per'])."
"); $bi = "Billing View$bi"); #echo("

Previous Bill View

$li"); echo("

24 Hour View

$di"); echo("

Monthly View

$mi"); ?>