Changed how tables are layed out (since I was repeatedly duplicating code in many places) by adding a table element to be used wherever we need a table. This could probably have been a helper instead of an element, but it's not clear to me why one should be chosen over the other, and I already know how to quickly add an element (I think the real choice resides in whether you need a collection of helper functions, or you just want to drop in a chunk of html, i.e. a helper element). Also, a major revamp to the style sheets as well, although more work is clearly needed.
git-svn-id: file:///svn-source/pmgr/branches/initial_20090526@42 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -21,18 +21,16 @@ function datefmt($date) {
|
||||
/**********************************************************************
|
||||
* Unit Info
|
||||
*/
|
||||
$rows = array();
|
||||
foreach($unit['Unit'] AS $col => $val) {
|
||||
$rows[] = array(array($col, 'width=1%'), $val);
|
||||
}
|
||||
|
||||
echo('<table cellpadding="0" cellspacing="0">' . "\n");
|
||||
echo(' <CAPTION>Unit Info</CAPTION>' . "\n");
|
||||
echo $html->tableCells(array(array('Name', $unit['Unit']['name']),
|
||||
array('Status', $unit['Unit']['status']),
|
||||
array('Comment', $unit['Unit']['comment'])),
|
||||
null, array('class' => "altrow"), false, false);
|
||||
echo('</table>' . "\n");
|
||||
$rows = array(array('Name', $unit['Unit']['name']),
|
||||
array('Status', $unit['Unit']['status']),
|
||||
array('Comment', $unit['Unit']['comment']));
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item unit detail',
|
||||
'caption' => 'Unit Info',
|
||||
'rows' => $rows,
|
||||
'column_class' => array('field', 'value')));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
@@ -54,11 +52,12 @@ foreach($unit['Lease'] AS $lease) {
|
||||
$lease['comment']);
|
||||
}
|
||||
|
||||
echo('<table cellpadding="0" cellspacing="0">' . "\n");
|
||||
echo(' <CAPTION>Lease History</CAPTION>' . "\n");
|
||||
echo $html->tableHeaders($headers);
|
||||
echo $html->tableCells($rows, null, array('class' => "altrow"), false, false);
|
||||
echo('</table>' . "\n");
|
||||
echo $this->element('table',
|
||||
array('class' => 'item lease list',
|
||||
'caption' => 'Lease History',
|
||||
'headers' => $headers,
|
||||
'rows' => $rows,
|
||||
'column_class' => $headers));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
@@ -98,12 +97,12 @@ foreach($unit['Lease'] AS $lease) {
|
||||
}
|
||||
$grand_total += $running_total;
|
||||
|
||||
echo('<table cellpadding="0" cellspacing="0">' . "\n");
|
||||
echo(' <CAPTION>Lease #'.$lease['number'].' ('.$lease['Contact'][0]['display_name'].')</CAPTION>' . "\n");
|
||||
echo $html->tableHeaders($headers);
|
||||
echo $html->tableCells($rows, null, array('class' => "altrow"), false, false);
|
||||
echo('</table>' . "\n");
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item ledger list',
|
||||
'caption' => 'Lease #'.$lease['number'].' ('.$lease['Contact'][0]['display_name'].')',
|
||||
'headers' => $headers,
|
||||
'rows' => $rows,
|
||||
'column_class' => $headers));
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user