Very, very early snapshot. Some models are working, and I have a controller for testing. Everything is subject to change. I _do_ have a working tenant ledger though, so it's worth a snapshot.
git-svn-id: file:///svn-source/pmgr/branches/initial_20090526@15 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
53
site/views/transactions/ledger.ctp
Normal file
53
site/views/transactions/ledger.ctp
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php /* -*- mode:PHP -*- */ ?>
|
||||
|
||||
<div class="ledgers view">
|
||||
<h2><?php __('Ledgers'); ?></h2>
|
||||
|
||||
<?php
|
||||
foreach($ledgers AS $ledger) {
|
||||
foreach ($ledger AS $tablename => $table) {
|
||||
|
||||
if (array_key_exists(0, $table)) {
|
||||
// Horizontal table (multiple items)
|
||||
$headers = array_keys($table[0]);
|
||||
|
||||
//$rows = array_map('array_values', $table);
|
||||
$rows = array();
|
||||
//echo("<PRE>table:\n"); print_r($table); echo("</PRE>\n");
|
||||
foreach ($table as $row) {
|
||||
//echo("<PRE>row:\n"); print_r($row); echo("</PRE>\n");
|
||||
$rows[] = array_values($row);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Vertical table (one item)
|
||||
$headers = array('Field', 'Value');
|
||||
|
||||
$rows = array();
|
||||
foreach ($table as $col => $val) {
|
||||
$rows[] = array($col, $val);
|
||||
}
|
||||
}
|
||||
|
||||
foreach($rows AS &$row) {
|
||||
foreach ($row AS &$cell) {
|
||||
if (is_array($cell))
|
||||
$cell = "<ARRAY>";
|
||||
}
|
||||
}
|
||||
//echo("<PRE>headers:\n"); print_r($headers); echo("</PRE>\n");
|
||||
//echo("<PRE>rows:\n"); print_r($rows); echo("</PRE>\n");
|
||||
?>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<CAPTION><?php echo $tablename ?></CAPTION>
|
||||
<?php
|
||||
echo $html->tableHeaders($headers);
|
||||
echo $html->tableCells($rows, null, array('class' => "altrow"));
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user