Files
pmgr/site/views/elements/contacts.ctp
abijah e38e99c94e Removed the revisit code, as use of it would only screw up pagination anyway.
git-svn-id: file:///svn-source/pmgr/branches/initial_20090526@25 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-05-28 09:36:58 +00:00

64 lines
1.9 KiB
PHP

<?php /* -*- mode:PHP -*- */ ?>
<p>
<?php
if (isset($heading))
echo $heading;
else
echo '<h2>'.__('Contacts',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('last_name'),
$paginator->sort('first_name'),
$paginator->sort('company_name'),
//$paginator->sort('unit_id'),
$paginator->sort('comment'));
} else {
$rows = array('Id', 'Last Name', 'First Name', 'Company', 'Comment');
}
echo $html->tableHeaders($rows);
$rows = array();
foreach ($contacts as $contact) {
$rows[] = array($html->link($contact['Contact']['id'],
array('controller' => 'contacts',
'action' => 'view',
$contact['Contact']['id'])),
$html->link($contact['Contact']['last_name'],
array('controller' => 'contacts',
'action' => 'view',
$contact['Contact']['id'])),
$html->link($contact['Contact']['first_name'],
array('controller' => 'contacts',
'action' => 'view',
$contact['Contact']['id'])),
$contact['Contact']['company_name'],
$contact['Contact']['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");
}
?>