"; echo($img['his']); function showDetails($bill_id, $imgtype, $from, $to, $bittype = "Quota") { if ($imgtype == "bitrate") { $res = ""; return $res; } // $url = generate_url($vars, array('detail' => 'yes')); $url = $PHP_SELF."/bill/".$bill_id."/history/detail=all/"; echo(""); foreach (dbFetchRows("SELECT * FROM `bill_history` WHERE `bill_id` = ? ORDER BY `bill_datefrom` DESC LIMIT 24", array($bill_id)) as $history) { if (bill_permitted($history['bill_id'])) { unset($class); $datefrom = $history['bill_datefrom']; $dateto = $history['bill_dateto']; $type = $history['bill_type']; $percent = $history['bill_percent']; $dir_95th = $history['dir_95th']; $rate_95th = formatRates($history['rate_95th']); $total_data = format_number($history['traf_total'], $config['billing']['base']); $background = get_percentage_colours($percent); $row_colour = ((!is_integer($i/2)) ? $list_colour_a : $list_colour_b); if ($type == "CDR") { $allowed = formatRates($history['bill_allowed']); $used = formatRates($history['rate_95th']); $in = formatRates($history['rate_95th_in']); $out = formatRates($history['rate_95th_out']); $overuse = (($history['bill_overuse'] <= 0) ? "-" : "".formatRates($history['bill_overuse']).""); } elseif ($type == "Quota") { $allowed = format_number($history['bill_allowed'], $config['billing']['base']); $used = format_number($history['total_data'], $config['billing']['base']); $in = format_number($history['traf_in'], $config['billing']['base']); $out = format_number($history['traf_out'], $config['billing']['base']); $overuse = (($history['bill_overuse'] <= 0) ? "-" : "".format_number($history['bill_overuse'], $config['billing']['base'])."B"); } $total_data = (($type == "Quota") ? "".$total_data."" : $total_data); $rate_95th = (($type == "CDR") ? "".$rate_95th."" : $rate_95th); $url = generate_url($vars, array('detail' => $history['bill_hist_id'])); echo(" "); if ($vars['detail'] == $history['bill_hist_id'] || $vars['detail'] == "all") { $img['bitrate'] = showDetails($bill_id, "bitrate", strtotime($datefrom), strtotime($dateto), $type); $img['bw_day'] = showDetails($bill_id, "day", strtotime($datefrom), strtotime($dateto)); $img['bw_hour'] = showDetails($bill_id, "hour", strtotime($datefrom), strtotime($dateto)); echo(" "); } $i++; } ### PERMITTED } echo("
Period Type Allowed Inbound Outbound Total 95th %ile Overusage "all"))."\">\"Show Show all details
".strftime("%Y-%m-%d", strtotime($datefrom))." -> ".strftime("%Y-%m-%d", strtotime($dateto))." $type $allowed $in $out $total_data $rate_95th $overuse ".print_percentage_bar(250, 20, $perc, NULL, "ffffff", $background['left'], $percent."%", "ffffff", $background['right'])." \"Show \"PDF
".$img['bitrate']."
".$img['bw_day']."
".$img['bw_hour']."
"); ?>