Improved service display

This commit is contained in:
Deon George
2011-07-14 19:09:03 +10:00
parent 46c3b9a075
commit 27cdab1fe4
37 changed files with 1319 additions and 1042 deletions

View File

@@ -28,22 +28,6 @@ class ADSL {
return new ADSL;
}
/**
* Return the additional information used by product_view
*/
public function product_view($data) {
// @todo - this test shouldnt be required
if (preg_match('/^a:/',$data))
throw new Kohana_Exception('Data shouldnt be a serialized array');
$ao = ORM::factory('adsl_plan',$data);
$output = View::factory('adsl/product_view')
->set('record',$ao);
return $output;
}
public function contract_view($data,$price_base,$price_setup) {
// @todo - this test shouldnt be required
if (preg_match('/^a:/',$data))

View File

@@ -37,23 +37,5 @@ class Model_ADSL_Plan extends ORMOSB {
'Currency::display'=>array(),
),
);
/**
* Show the ADSL allowance as a peak/offpeak metric
*/
public function allowance($string=TRUE) {
$output = ADSL::allowance(array(
'base_down_peak'=>$this->base_down_peak,
'base_down_offpeak'=>$this->base_down_offpeak,
'base_up_peak'=>$this->base_up_peak,
'base_up_offpeak'=>$this->base_up_offpeak,
'extra_down_peak'=>$this->extra_down_peak,
'extra_down_offpeak'=>$this->extra_down_offpeak,
'extra_up_peak'=>$this->extra_up_peak,
'extra_up_offpeak'=>$this->extra_up_offpeak,
));
return $string ? implode('/',$output) : $output;
}
}
?>

View File

@@ -1,26 +0,0 @@
<!-- //@todo To translate -->
<table class="box-full">
<tr>
<td style="width: 60%;">Speed</td>
<td class="head" colspan="2"><?php echo $record->display('speed'); ?></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Peak</td>
<td>Off Peak</td>
</tr>
<tr>
<td>Included Download Traffic</td>
<!-- // @todo Since price is stored in the DB in GB, so should the traffic. -->
<td class="head"><?php echo $record->base_down_peak/1000; ?> GB</td>
<td class="head"><?php echo $record->base_down_offpeak/1000; ?> GB</td>
</tr>
<tr>
<td>Extra Download Traffic</td>
<td class="head"><?php echo $record->display('extra_down_peak'); ?>/GB</td>
<td class="head"><?php echo $record->display('extra_down_offpeak'); ?>/GB</td>
</tr>
</table>