Added the payments controller and views.
git-svn-id: file:///svn-source/pmgr/branches/initial_20090526@63 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
40
site/views/payments/view.ctp
Normal file
40
site/views/payments/view.ctp
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php /* -*- mode:PHP -*- */ ?>
|
||||
|
||||
<div class="payments view">
|
||||
|
||||
<?php
|
||||
|
||||
function currency($number) {
|
||||
if ($number < 0)
|
||||
return "($ " . number_format(-1*$number, 2) . ")";
|
||||
else
|
||||
return "$ " . number_format($number, 2);
|
||||
}
|
||||
|
||||
function datefmt($date) {
|
||||
$date_fmt = 'm/d/Y';
|
||||
return ($date
|
||||
? date_format(date_create($date), $date_fmt)
|
||||
: null);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* Payment Info
|
||||
*/
|
||||
|
||||
$rows = array(array('ID', $payment['Payment']['id']),
|
||||
array('Type', $payment['PaymentType']['name']),
|
||||
array('Receipt', '#'.$payment['Receipt']['id']),
|
||||
array('Amount', currency($payment['Payment']['amount'])),
|
||||
array('Comment', $payment['Payment']['comment']));
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item payment detail',
|
||||
'caption' => 'Payment Info',
|
||||
'rows' => $rows,
|
||||
'column_class' => array('field', 'value')));
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user