Overhaul ADSL traffic reporting/graphing

This commit is contained in:
Deon George
2013-11-14 22:50:35 +11:00
parent 158a4f9e47
commit e01d37244c
33 changed files with 891 additions and 471 deletions

View File

@@ -73,6 +73,7 @@ class ADSL_Billing_Exetelvisp {
$start = $end = FALSE;
$result = array();
$c = 0;
foreach (preg_split("/\n/",$data) as $line) {
// Items start after "Item ID"
if (! $start && preg_match('/^Item ID,/',$line)) {
@@ -113,7 +114,7 @@ class ADSL_Billing_Exetelvisp {
list($service,$description) = explode(':',(preg_replace('/([0-9]+)\s+-\s+(.*)$/',"$1:$2",$record[3])));
$result[$service]['cost'] = str_replace('$','',$record[6]);
} elseif (preg_match('/Monthly Charge On Plan /',$record[3])) {
} elseif (preg_match('/([0-9]+)\s+-\s+Monthly Charge On Plan /',$record[3])) {
list($service,$description) = explode(':',(preg_replace('/([0-9]+)\s+-\s+(.*)$/',"$1:$2",$record[3])));
$result[$service]['cost'] = str_replace('$','',$record[6]);
$result[$service]['info'] = 'Other Service';
@@ -139,7 +140,7 @@ class ADSL_Billing_Exetelvisp {
list($service,$description) = explode(':',(preg_replace('/([0-9]+)\s+-\s+(.*)$/',"$1:$2",$record[3])));
$result[$service]['info'] = $line;
} catch (Exception $e) {
$result['000']['info'] = $line;
$result["000-".$c++]['info'] = $line;
}
}
}
@@ -148,7 +149,7 @@ class ADSL_Billing_Exetelvisp {
// @todo This could be optimised better.
foreach ($aso->services(TRUE) as $so)
$this->haveService($so->plugin()->service_number,$so->plugin()->product()->adsl_supplier_plan->total());
$this->haveService($so->plugin()->service_number,$so->plugin()->admin_plan()->adsl_supplier_plan->display('base_cost'));
return $this;
}