git-svn-id: file:///svn-source/pmgr/branches/initial_20090526/site@64 97e9348a-65ac-dc4b-aefc-98561f571b83
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?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', $html->link('#'.$payment['Receipt']['id'],
|
|
array('controller' => 'receipts',
|
|
'action' => 'view',
|
|
$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>
|