'; ?>

Historical Usage

Monthly Usage

'; return $res; }//end showDetails() // $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); 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', $history['bill_hist_id'], $type); $img['bw_day'] = showDetails($bill_id, 'day', $history['bill_hist_id']); $img['bw_hour'] = showDetails($bill_id, 'hour', $history['bill_hist_id']); echo ' '; } } //end if }//end foreach echo '
Period Type Allowed Inbound Outbound Total 95th %ile Overusage Show details Show all details
'.strftime('%Y-%m-%d', strtotime($datefrom)).' to '.strftime('%Y-%m-%d', strtotime($dateto))." $type $allowed $in $out $total_data $rate_95th $overuse ".print_percentage_bar(250, 20, $percent, null, 'ffffff', $background['left'], $percent.'%', 'ffffff', $background['right']).' Show details
'.$img['bitrate'].'
'.$img['bw_day'].'
'.$img['bw_hour'].'
';