git-svn-id: file:///svn-source/pmgr/branches/v0.3_work@992 97e9348a-65ac-dc4b-aefc-98561f571b83
41 lines
2.3 KiB
PHP
41 lines
2.3 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
// Define the table columns
|
|
$cols = array();
|
|
$cols['Size'] = array('index' => 'UnitSize.name', 'formatter' => 'shortname');
|
|
$cols['Type'] = array('index' => 'UnitType.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['Per Foot'] = array('index' => 'sqcost', 'formatter' => 'currency');
|
|
$cols['Per Cubic Ft'] = 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('Width', 'Depth',
|
|
'Deposit',
|
|
'Height', 'Volume',
|
|
//'Per Foot',
|
|
'Per Cubic Ft',
|
|
'Occupied',
|
|
//'Total',
|
|
'Occupancy',
|
|
//'Vacancy',
|
|
'Comment')));
|