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'] = formatStorage($bill_data['total_data'] * $gbconvert * $gbconvert); if ($bill_data['bill_type'] == "quota") { $total['allow'] = formatStorage($bill_data['bill_gb'] * $gbconvert * $gbconvert * $gbconvert); } else { $total['allow'] = "-"; } $total['ave'] = formatStorage(($bill_data['total_data'] / $cur_days) * $gbconvert * $gbconvert); $total['est'] = formatStorage(($bill_data['total_data'] / $cur_days * $total_days) * $gbconvert * $gbconvert); $total['per'] = round((($bill_data['total_data'] / $gbconvert) / $bill_data['bill_gb'] * 100), 2); $total['bg'] = get_percentage_colours($total['per']); $in['data'] = formatStorage($bill_data['total_data_in'] * $gbconvert * $gbconvert); $in['allow'] = $total['data']; $in['ave'] = formatStorage(($bill_data['total_data_in'] / $cur_days) * $gbconvert * $gbconvert); $in['est'] = formatStorage(($bill_data['total_data_in'] / $cur_days * $total_days) * $gbconvert * $gbconvert); $in['per'] = round(($bill_data['total_data_in'] / $bill_data['total_data'] * 100), 2); $in['bg'] = get_percentage_colours($in['per']); $out['data'] = formatStorage($bill_data['total_data_out'] * $gbconvert * $gbconvert); $out['allow'] = $total['data']; $out['ave'] = formatStorage(($bill_data['total_data_out'] / $cur_days) * $gbconvert * $gbconvert); $out['est'] = formatStorage(($bill_data['total_data_out'] / $cur_days * $total_days) * $gbconvert * $gbconvert); $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'] * $gbconvert); $ousage['over'] = (($ousage['over'] < 0) ? "0" : $ousage['over']); $ousage['data'] = formatStorage($ousage['over'] * $gbconvert * $gbconvert); $ousage['allow'] = $total['allow']; $ousage['ave'] = formatStorage(($ousage['over'] / $cur_days ) * $gbconvert * $gbconvert); $ousage['est'] = formatStorage(($ousage['over'] / $cur_days * $total_days) * $gbconvert * $gbconvert); $ousage['per'] = round(((($bill_data['total_data'] / $gbconvert) / $bill_data['bill_gb'] * 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"); ?>