git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@788 97e9348a-65ac-dc4b-aefc-98561f571b83
34 lines
2.1 KiB
PHP
34 lines
2.1 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
// Define the table columns
|
|
$cols = array();
|
|
$cols['Size'] = array('index' => 'UnitSize.name', 'formatter' => 'shortname');
|
|
$cols['Width'] = array('index' => 'UnitSize.width', 'formatter' => 'number');
|
|
$cols['Depth'] = array('index' => 'UnitSize.depth', 'formatter' => 'number');
|
|
$cols['Height'] = array('index' => 'UnitSize.height', 'formatter' => 'number');
|
|
$cols['Area'] = array('index' => 'sqft', 'formatter' => 'number');
|
|
$cols['Volume'] = array('index' => 'cuft', 'formatter' => 'number');
|
|
$cols['Deposit'] = array('index' => 'UnitSize.deposit', 'formatter' => 'currency');
|
|
$cols['Rent'] = array('index' => 'UnitSize.rent', 'formatter' => 'currency');
|
|
$cols['A. Cost'] = array('index' => 'sqcost', 'formatter' => 'currency');
|
|
$cols['V. Cost'] = array('index' => 'cucost', 'formatter' => 'currency');
|
|
$cols['Unavailable'] = array('index' => 'unavailable', 'formatter' => 'number');
|
|
$cols['Occupied'] = array('index' => 'occupied', 'formatter' => 'number');
|
|
$cols['Available'] = array('index' => 'available', 'formatter' => 'number');
|
|
$cols['Total'] = array('index' => 'units', 'formatter' => 'number');
|
|
$cols['Occupancy'] = array('index' => 'occupancy', 'formatter' => 'percentage', 'formatoptions' => array('precision' => 0));
|
|
$cols['Vacancy'] = array('index' => 'vacancy', 'formatter' => 'percentage', 'formatoptions' => array('precision' => 0));
|
|
$cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment');
|
|
|
|
// Render the grid
|
|
$grid
|
|
->columns($cols)
|
|
->sortField('Area')
|
|
->defaultFields(array('Size', 'Area'))
|
|
->searchFields(array('Size', 'Width', 'Depth', 'Area', 'Deposit', 'Rent'))
|
|
->render($this, isset($config) ? $config : null,
|
|
array_diff(array_keys($cols), array('Height', 'Volume',
|
|
'A. Cost', 'V. Cost',
|
|
'Occupied', 'Total', 'Occupancy', 'Vacancy',
|
|
'Comment')));
|