CakeAddresses/templates/Countries/index.php

91 lines
5.2 KiB
PHP
Raw Normal View History

2025-11-18 08:43:34 +00:00
<?php
/**
* @var \App\View\AppView $this
* @var iterable<\Cake\Datasource\EntityInterface> $countries
*/
?>
<div class="countries index content">
<?= $this->Html->link(__('New Country'), ['action' => 'add'], ['class' => 'button float-right']) ?>
<h3><?= __('Countries') ?></h3>
<div class="table-responsive">
<table>
<thead>
<tr>
<th><?= $this->Paginator->sort('id') ?></th>
<th><?= $this->Paginator->sort('name') ?></th>
<th><?= $this->Paginator->sort('iso3') ?></th>
<th><?= $this->Paginator->sort('numeric_code') ?></th>
<th><?= $this->Paginator->sort('iso2') ?></th>
<th><?= $this->Paginator->sort('phonecode') ?></th>
<th><?= $this->Paginator->sort('capital') ?></th>
<th><?= $this->Paginator->sort('currency') ?></th>
<th><?= $this->Paginator->sort('currency_name') ?></th>
<th><?= $this->Paginator->sort('currency_symbol') ?></th>
<th><?= $this->Paginator->sort('tld') ?></th>
<th><?= $this->Paginator->sort('native') ?></th>
<th><?= $this->Paginator->sort('region') ?></th>
<th><?= $this->Paginator->sort('region_id') ?></th>
<th><?= $this->Paginator->sort('subregion') ?></th>
<th><?= $this->Paginator->sort('subregion_id') ?></th>
<th><?= $this->Paginator->sort('nationality') ?></th>
<th><?= $this->Paginator->sort('latitude') ?></th>
<th><?= $this->Paginator->sort('longitude') ?></th>
<th><?= $this->Paginator->sort('emoji') ?></th>
<th><?= $this->Paginator->sort('emojiU') ?></th>
<th><?= $this->Paginator->sort('created_at') ?></th>
<th><?= $this->Paginator->sort('updated_at') ?></th>
<th><?= $this->Paginator->sort('flag') ?></th>
<th><?= $this->Paginator->sort('wikiDataId') ?></th>
<th class="actions"><?= __('Actions') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($countries as $country): ?>
<tr>
<td><?= $this->Number->format($country->id) ?></td>
<td><?= h($country->name) ?></td>
<td><?= h($country->iso3) ?></td>
<td><?= h($country->numeric_code) ?></td>
<td><?= h($country->iso2) ?></td>
<td><?= h($country->phonecode) ?></td>
<td><?= h($country->capital) ?></td>
<td><?= h($country->currency) ?></td>
<td><?= h($country->currency_name) ?></td>
<td><?= h($country->currency_symbol) ?></td>
<td><?= h($country->tld) ?></td>
<td><?= h($country->native) ?></td>
<td><?= h($country->region) ?></td>
<td><?= $country->hasValue('region_entity') ? $this->Html->link($country->region_entity->name, ['controller' => 'Regions', 'action' => 'view', $country->region_entity->id]) : '' ?></td>
<td><?= h($country->subregion) ?></td>
<td><?= $country->hasValue('subregion_entity') ? $this->Html->link($country->subregion_entity->name, ['controller' => 'Subregions', 'action' => 'view', $country->subregion_entity->id]) : '' ?></td>
<td><?= h($country->nationality) ?></td>
<td><?= $country->latitude === null ? '' : $this->Number->format($country->latitude) ?></td>
<td><?= $country->longitude === null ? '' : $this->Number->format($country->longitude) ?></td>
<td><?= h($country->emoji) ?></td>
<td><?= h($country->emojiU) ?></td>
<td><?= h($country->created_at) ?></td>
<td><?= h($country->updated_at) ?></td>
<td><?= h($country->flag) ?></td>
<td><?= h($country->wikiDataId) ?></td>
<td class="actions">
<?= $this->Html->link(__('View'), ['action' => 'view', $country->id]) ?>
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $country->id]) ?>
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $country->id], ['confirm' => __('Are you sure you want to delete # {0}?', $country->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>