fix billing-calculate strings

git-svn-id: http://www.observium.org/svn/observer/trunk@2773 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-12-12 12:16:57 +00:00
parent ff9d09911b
commit 349290a037

View File

@ -48,6 +48,8 @@ foreach (dbFetchRows("SELECT * FROM `bills` ORDER BY `bill_name`") as $bill)
$type = "CDR";
$allowed = $bill['bill_cdr'];
$used = $rate_data['rate_95th'];
$allowed_text = format_si($allowed)."bps";
$used_text = format_si($used)."bps";
$overuse = $used - $allowed;
$overuse = (($overuse <= 0) ? "0" : $overuse);
$percent = round(($rate_data['rate_95th'] / $bill['bill_cdr']) * 100,2);
@ -56,11 +58,13 @@ foreach (dbFetchRows("SELECT * FROM `bills` ORDER BY `bill_name`") as $bill)
$type = "Quota";
$allowed = $bill['bill_quota'];
$used = $rate_data['total_data'];
$allowed_text = format_bytes_billing($allowed);
$used_text = format_bytes_billing($used);
$overuse = $used - $allowed;
$overuse = (($overuse <= 0) ? "0" : $overuse);
$percent = round(($rate_data['total_data'] / $bill['bill_quota']) * 100,2);
}
echo(strftime("%x @ %X", strtotime($datefrom))." to ".strftime("%x @ %X", strtotime($dateto))." ".str_pad($type,8)." ".str_pad($allowed,10)." ".str_pad($used,10)." ".$percent."%");
echo(strftime("%x @ %X", strtotime($datefrom))." to ".strftime("%x @ %X", strtotime($dateto))." ".str_pad($type,8)." ".str_pad($allowed_text,10)." ".str_pad($used_text,10)." ".$percent."%");
if($i == '0')
{