'.__('Receipts',true).''; 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); } $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'])), datefmt($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('