Files
addressbook/CakePHP/templates/Addresses/index.php
2025-05-09 20:50:34 +02:00

57 lines
2.6 KiB
PHP

<?php
/**
* @var \App\View\AppView $this
* @var iterable<\App\Model\Entity\Address> $addresses
*/
?>
<div class="addresses index content">
<?= $this->Html->link(__('New Address'), ['action' => 'add'], ['class' => 'button float-right']) ?>
<h3><?= __('Addresses') ?></h3>
<div class="table-responsive">
<table>
<thead>
<tr>
<th><?= $this->Paginator->sort('id') ?></th>
<th><?= $this->Paginator->sort('owner') ?></th>
<th><?= $this->Paginator->sort('first') ?></th>
<th><?= $this->Paginator->sort('last') ?></th>
<th><?= $this->Paginator->sort('street') ?></th>
<th><?= $this->Paginator->sort('zip') ?></th>
<th><?= $this->Paginator->sort('city') ?></th>
<th><?= $this->Paginator->sort('phone') ?></th>
<th class="actions"><?= __('Actions') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($addresses as $address): ?>
<tr>
<td><?= $this->Number->format($address->id) ?></td>
<td><?= $this->Number->format($address->owner) ?></td>
<td><?= h($address->first) ?></td>
<td><?= h($address->last) ?></td>
<td><?= h($address->street) ?></td>
<td><?= h($address->zip) ?></td>
<td><?= h($address->city) ?></td>
<td><?= h($address->phone) ?></td>
<td class="actions">
<?= $this->Html->link(__('View'), ['action' => 'view', $address->id]) ?>
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $address->id]) ?>
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $address->id], ['confirm' => __('Are you sure you want to delete # {0}?', $address->id)]) ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="paginator">
<ul class="pagination">
<?= $this->Paginator->first('<< ' . __('first')) ?>
<?= $this->Paginator->prev('< ' . __('previous')) ?>
<?= $this->Paginator->numbers() ?>
<?= $this->Paginator->next(__('next') . ' >') ?>
<?= $this->Paginator->last(__('last') . ' >>') ?>
</ul>
<p><?= $this->Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?></p>
</div>
</div>