Added a receipt controller to verify receipt data

git-svn-id: file:///svn-source/pmgr/branches/initial_20090526/site@60 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-01 07:24:51 +00:00
parent 8ea0822ed1
commit cdd274adf7
4 changed files with 289 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?php /* -*- mode:PHP -*- */
if (isset($heading))
echo $heading;
else
echo '<h2>'.__('Receipts',true).'</h2>';
$headers_manual = array('Id', 'Timestamp', 'Comment');
if (isset($paginator)) {
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records (%start% - %end%) of %count% total', true)));
$headers = array($paginator->sort('id'),
$paginator->sort('Timestamp', 'stamp'),
$paginator->sort('comment'));
} else {
$headers = $headers_manual;
}
$rows = array();
foreach ($receipts as $receipt) {
$rows[] = array($html->link($receipt['Receipt']['id'],
array('controller' => 'receipts',
'action' => 'view',
$receipt['Receipt']['id'])),
$receipt['Receipt']['stamp'],
$receipt['Receipt']['comment']);
}
echo $this->element('table',
array('class' => 'item receipt list',
'headers' => $headers,
'rows' => $rows,
'column_class' => $headers_manual));
if (isset($paginator)) {
echo('<div class="paging">' . "\n");
echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));
echo(' | ');
echo $paginator->numbers();
echo(' | ');
echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));
echo('</div>' . "\n");
}