Files
pmgr/views/elements/units.ctp

60 lines
1.7 KiB
PHP

<?php /* -*- mode:PHP -*- */ ?>
<p>
<?php
if (isset($heading))
echo $heading;
else
echo '<h2>'.__('Units',true).'</h2>';
?>
</p>
<table cellpadding="0" cellspacing="0">
<?php
{
if (isset($paginator)) {
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records (%start% - %end%) of %count% total', true)));
$rows = array($paginator->sort('id'),
$paginator->sort('name'),
$paginator->sort('unit_size_id'),
$paginator->sort('status'),
$paginator->sort('comment'));
} else {
$rows = array('Id', 'Name', 'Size', 'Status', 'Comment');
}
echo $html->tableHeaders($rows);
$rows = array();
foreach ($units as $unit) {
$rows[] = array($html->link($unit['Unit']['id'],
array('controller' => 'units',
'action' => 'view',
$unit['Unit']['id'])),
$html->link($unit['Unit']['name'],
array('controller' => 'units',
'action' => 'view',
$unit['Unit']['id'])),
$unit['UnitSize']['name'],
$unit['Unit']['status'],
$unit['Unit']['comment']);
}
echo $html->tableCells($rows, null, array('class' => "altrow"), false, false);
}
?>
</table>
<?php
if (isset($paginator)) {
echo('<div class="paging">' . "\n");
echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));
echo(' | ');
echo $paginator->numbers();
echo(' | ');
echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));
echo('</div>' . "\n");
}
?>