billing rewrite (disabling svn after)

git-svn-id: http://www.observium.org/svn/observer/trunk@2758 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-12-06 22:17:37 +00:00
parent b4855bcce8
commit a1e96f708f
212 changed files with 76139 additions and 260 deletions

View File

@@ -14,6 +14,16 @@ echo("Starting Polling Session ... \n\n");
foreach (dbFetchRows("SELECT * FROM `bills`") as $bill_data)
{
echo("Bill : ".$bill_data['bill_name']."\n");
# replace old bill_gb with bill_quota (we're now storing bytes, not gigabytes)
if($bill_data['bill_type'] == "quota" && !is_numeric($bill_data['bill_quota']))
{
$bill_data['bill_quota'] = $bill_data['bill_gb'] * $config['billing']['base'] * $config['billing']['base'];
dbUpdate(array('bill_quota' => $bill_data['bill_quota']), 'bills', '`bill_id` = ?', array($bill_data['bill_id']));
echo("Quota -> ".$bill_data['bill_quota']);
}
CollectData($bill_data['bill_id']);
$iter++;
}