git-svn-id: file:///svn-source/pmgr/branches/initial_20090526/site@15 97e9348a-65ac-dc4b-aefc-98561f571b83
53 lines
1.3 KiB
PHP
53 lines
1.3 KiB
PHP
<?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>
|