Files
pmgr/site/views/accounts/view.ctp

96 lines
2.5 KiB
PHP

<?php /* -*- mode:PHP -*- */ ?>
<div class="account view">
<?php
; // Editor alignment
function currency($number) {
if (!isset($number))
return null;
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);
}
function comment($comment) {
if (isset($comment) && is_array($comment)) {
foreach (array_keys($comment) AS $k) {
if (!$comment[$k])
unset($comment[$k]);
}
return implode('; ', $comment);
}
return $comment;
}
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* Account Detail Main Section
*/
$rows = array(array('ID', $account['Account']['id']),
array('Name', $account['Account']['name']),
array('Type', $account['Account']['type']),
array('External Name', $account['Account']['external_name']),
array('External Account', $account['Account']['external_account']),
array('Comment', $account['Account']['comment']));
echo $this->element('table',
array('class' => 'item account detail',
'caption' => 'Account Detail',
'rows' => $rows,
'column_class' => array('field', 'value')));
/**********************************************************************
* Account Info Box
*/
?>
<DIV CLASS="infobox">
<DIV CLASS="summary balance">
Account Balance: <?php echo currency($balance); ?>
</DIV>
</DIV>
<DIV CLASS="detail supporting">
<?php
; // Editor alignment
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* Supporting Elements Section
*/
/**********************************************************************
* Ledger
*/
echo $this->element('ledgers',
array('caption' => $account['Account']['name'] . " Ledgers",
'ledgers' => $account['Ledger']));
/* End "detail supporting" DIV */ ?>
</DIV>
</div>