Stuff
public text v1 · immutable<?php echo $html->formTag('/Contacts/Search/'); ?>
<table>
<?php
$letter_range = array_merge(array('All'), range('A','Z'), array('Other'));
foreach ($letter_range as $letter) {
if ($ContactsSearch == up($letter)) {
$letters[] = __($letter);
} else {
$letters[] = $html->link(__($letter),"/Contacts/Search/{$letter}", null, null, false);
}
}
$letters = array_merge(array($html->input('Search/id')), $letters);
echo $html->tableCells($letters);
?>
</table>
<?php echo $html->link(__('Add Contact'), '/Contacts/Add', 'style="float:right;"'); ?>
<table>
<?php
echo $html->tableHeaders(array(__('label_username'), __('label_phone'), __('label_action')));
foreach ($contacts as $contact) {
$actions = array(
$html->link(__('edit'), "/Contacts/Edit/{$contact['Contact']['id']}"),
$html->link(__('delete'), "/Contacts/Delete/{$contact['Contact']['id']}", null, __('Are you sure?'))
);
$actions = implode(' ',$actions);
echo $html->tableCells(array($contact['Contact']['name'], $contact['Contact']['phone'], $actions));
}
?>
</table>
</form>