first standalone plugin commit
This commit is contained in:
28
templates/Addresses/add.php
Normal file
28
templates/Addresses/add.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $address
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $cities
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $states
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $countries
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Addresses'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="addresses form content">
|
||||
<?= $this->Form->create($address) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Address') ?></legend>
|
||||
<?= $this->element('Addresses/form'); ?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
47
templates/Addresses/edit.php
Normal file
47
templates/Addresses/edit.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $address
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $cities
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $states
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $countries
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
[
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'delete',
|
||||
$address->id,
|
||||
],
|
||||
[
|
||||
'confirm' => __('Are you sure you want to delete # {0}?', $address->id),
|
||||
'class' => 'side-nav-item',
|
||||
]
|
||||
) ?>
|
||||
<?= $this->Html->link(__('List Addresses'), [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'index',
|
||||
], [
|
||||
'class' => 'side-nav-item',
|
||||
]) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="addresses form content">
|
||||
<?= $this->Form->create($address) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Address') ?></legend>
|
||||
<?= $this->element('Addresses/form'); ?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
89
templates/Addresses/index.php
Normal file
89
templates/Addresses/index.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\Cake\Datasource\EntityInterface|\CakeAddresses\Model\Entity\Address> $addresses
|
||||
*/
|
||||
?>
|
||||
<div class="addresses index content">
|
||||
<?= $this->Html->link(__('New Address'), [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'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('address_name') ?></th>
|
||||
<th><?= $this->Paginator->sort('contact_name') ?></th>
|
||||
<th><?= $this->Paginator->sort('address_line1') ?></th>
|
||||
<th><?= $this->Paginator->sort('address_line2') ?></th>
|
||||
<th><?= $this->Paginator->sort('city') ?></th>
|
||||
<th><?= $this->Paginator->sort('city_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('state') ?></th>
|
||||
<th><?= $this->Paginator->sort('state_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('postal_code') ?></th>
|
||||
<th><?= $this->Paginator->sort('country') ?></th>
|
||||
<th><?= $this->Paginator->sort('country_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('phone_number') ?></th>
|
||||
<th><?= $this->Paginator->sort('email') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($addresses as $address): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($address->id) ?></td>
|
||||
<td><?= h($address->address_name) ?></td>
|
||||
<td><?= h($address->contact_name) ?></td>
|
||||
<td><?= h($address->address_line1) ?></td>
|
||||
<td><?= h($address->address_line2) ?></td>
|
||||
<td><?= h($address->city) ?></td>
|
||||
<td><?= $address->hasValue('city_entity') ? $this->Html->link($address->city_entity->name, ['controller' => 'Cities', 'action' => 'view', $address->city_entity->id]) : '' ?></td>
|
||||
<td><?= h($address->state) ?></td>
|
||||
<td><?= $address->hasValue('state_entity') ? $this->Html->link($address->state_entity->name, ['controller' => 'States', 'action' => 'view', $address->state_entity->id]) : '' ?></td>
|
||||
<td><?= h($address->postal_code) ?></td>
|
||||
<td><?= h($address->country) ?></td>
|
||||
<td><?= $address->hasValue('country_entity') ? $this->Html->link($address->country_entity->name, ['controller' => 'Countries', 'action' => 'view', $address->country_entity->id]) : '' ?></td>
|
||||
<td><?= h($address->phone_number) ?></td>
|
||||
<td><?= h($address->email) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'view',
|
||||
$address->id,
|
||||
]); ?>
|
||||
<?= $this->Html->link(__('Edit'), [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'edit',
|
||||
$address->id,
|
||||
]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'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>
|
||||
86
templates/Addresses/view.php
Normal file
86
templates/Addresses/view.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $address
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('Edit Address'), ['action' => 'edit', $address->id], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Form->postLink(__('Delete Address'), ['action' => 'delete', $address->id], ['confirm' => __('Are you sure you want to delete # {0}?', $address->id), 'class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('List Addresses'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('New Address'), ['action' => 'add'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="addresses view content">
|
||||
<h3><?= h($address->address_line1) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Address Name') ?></th>
|
||||
<td><?= h($address->address_name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Contact Name') ?></th>
|
||||
<td><?= h($address->contact_name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Address Line1') ?></th>
|
||||
<td><?= h($address->address_line1) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Address Line2') ?></th>
|
||||
<td><?= h($address->address_line2) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('City') ?></th>
|
||||
<td><?= h($address->city) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('City') ?></th>
|
||||
<td><?= $address->hasValue('city_entity') ? $this->Html->link($address->city_entity->name, ['controller' => 'Cities', 'action' => 'view', $address->city_entity->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('State') ?></th>
|
||||
<td><?= h($address->state) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('State') ?></th>
|
||||
<td><?= $address->hasValue('state_entity') ? $this->Html->link($address->state_entity->name, ['controller' => 'States', 'action' => 'view', $address->state_entity->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Postal Code') ?></th>
|
||||
<td><?= h($address->postal_code) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Country') ?></th>
|
||||
<td><?= h($address->country) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Country') ?></th>
|
||||
<td><?= $address->hasValue('country_entity') ? $this->Html->link($address->country_entity->name, ['controller' => 'Countries', 'action' => 'view', $address->country_entity->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Phone Number') ?></th>
|
||||
<td><?= h($address->phone_number) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Email') ?></th>
|
||||
<td><?= h($address->email) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($address->id) ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="text">
|
||||
<strong><?= __('Notes') ?></strong>
|
||||
<blockquote>
|
||||
<?= $this->Text->autoParagraph(h($address->notes)); ?>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
39
templates/Cities/add.php
Normal file
39
templates/Cities/add.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $city
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $states
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $countries
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Cities'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="cities form content">
|
||||
<?= $this->Form->create($city) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add City') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('state_id', ['options' => $states]);
|
||||
echo $this->Form->control('state_code');
|
||||
echo $this->Form->control('country_id', ['options' => $countries]);
|
||||
echo $this->Form->control('country_code');
|
||||
echo $this->Form->control('latitude');
|
||||
echo $this->Form->control('longitude');
|
||||
echo $this->Form->control('created_at');
|
||||
echo $this->Form->control('updated_at');
|
||||
echo $this->Form->control('flag');
|
||||
echo $this->Form->control('wikiDataId');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
44
templates/Cities/edit.php
Normal file
44
templates/Cities/edit.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $city
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $states
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $countries
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $city->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $city->id), 'class' => 'side-nav-item']
|
||||
) ?>
|
||||
<?= $this->Html->link(__('List Cities'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="cities form content">
|
||||
<?= $this->Form->create($city) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit City') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('state_id', ['options' => $states]);
|
||||
echo $this->Form->control('state_code');
|
||||
echo $this->Form->control('country_id', ['options' => $countries]);
|
||||
echo $this->Form->control('country_code');
|
||||
echo $this->Form->control('latitude');
|
||||
echo $this->Form->control('longitude');
|
||||
echo $this->Form->control('created_at');
|
||||
echo $this->Form->control('updated_at');
|
||||
echo $this->Form->control('flag');
|
||||
echo $this->Form->control('wikiDataId');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
61
templates/Cities/index.php
Normal file
61
templates/Cities/index.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\Cake\Datasource\EntityInterface> $cities
|
||||
*/
|
||||
?>
|
||||
<div class="cities index content">
|
||||
<h3><?= __('Cities') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('id') ?></th>
|
||||
<th><?= $this->Paginator->sort('name') ?></th>
|
||||
<th><?= $this->Paginator->sort('state_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('state_code') ?></th>
|
||||
<th><?= $this->Paginator->sort('country_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('country_code') ?></th>
|
||||
<th><?= $this->Paginator->sort('latitude') ?></th>
|
||||
<th><?= $this->Paginator->sort('longitude') ?></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 ($cities as $city): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($city->id) ?></td>
|
||||
<td><?= h($city->name) ?></td>
|
||||
<td><?= $city->hasValue('state') ? $this->Html->link($city->state->name, ['controller' => 'States', 'action' => 'view', $city->state->id]) : '' ?></td>
|
||||
<td><?= h($city->state_code) ?></td>
|
||||
<td><?= $city->hasValue('country') ? $this->Html->link($city->country->name, ['controller' => 'Countries', 'action' => 'view', $city->country->id]) : '' ?></td>
|
||||
<td><?= h($city->country_code) ?></td>
|
||||
<td><?= $this->Number->format($city->latitude) ?></td>
|
||||
<td><?= $this->Number->format($city->longitude) ?></td>
|
||||
<td><?= h($city->created_at) ?></td>
|
||||
<td><?= h($city->updated_at) ?></td>
|
||||
<td><?= h($city->flag) ?></td>
|
||||
<td><?= h($city->wikiDataId) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $city->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>
|
||||
10
templates/Cities/select.php
Normal file
10
templates/Cities/select.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\Cake\Datasource\EntityInterface> $cities
|
||||
*/
|
||||
$this->setLayout('ajax');
|
||||
?>
|
||||
<?php foreach ($cities as $cityId => $city): ?>
|
||||
<option value="<?= $cityId; ?>"><?= $city; ?></option>
|
||||
<?php endforeach; ?>
|
||||
120
templates/Cities/view.php
Normal file
120
templates/Cities/view.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $city
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Cities'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="cities view content">
|
||||
<h3><?= h($city->name) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Name') ?></th>
|
||||
<td><?= h($city->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('State') ?></th>
|
||||
<td><?= $city->hasValue('state') ? $this->Html->link($city->state->name, ['controller' => 'States', 'action' => 'view', $city->state->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('State Code') ?></th>
|
||||
<td><?= h($city->state_code) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Country') ?></th>
|
||||
<td><?= $city->hasValue('country') ? $this->Html->link($city->country->name, ['controller' => 'Countries', 'action' => 'view', $city->country->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Country Code') ?></th>
|
||||
<td><?= h($city->country_code) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('WikiDataId') ?></th>
|
||||
<td><?= h($city->wikiDataId) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($city->id) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Latitude') ?></th>
|
||||
<td><?= $this->Number->format($city->latitude) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Longitude') ?></th>
|
||||
<td><?= $this->Number->format($city->longitude) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Created At') ?></th>
|
||||
<td><?= h($city->created_at) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Updated At') ?></th>
|
||||
<td><?= h($city->updated_at) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Flag') ?></th>
|
||||
<td><?= $city->flag ? __('Yes') : __('No'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="related">
|
||||
<h4><?= __('Related Addresses') ?></h4>
|
||||
<?php if (!empty($city->addresses)) : ?>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<th><?= __('Address Name') ?></th>
|
||||
<th><?= __('Contact Name') ?></th>
|
||||
<th><?= __('Address Line1') ?></th>
|
||||
<th><?= __('Address Line2') ?></th>
|
||||
<th><?= __('City') ?></th>
|
||||
<th><?= __('City Id') ?></th>
|
||||
<th><?= __('State') ?></th>
|
||||
<th><?= __('State Id') ?></th>
|
||||
<th><?= __('Postal Code') ?></th>
|
||||
<th><?= __('Country') ?></th>
|
||||
<th><?= __('Country Id') ?></th>
|
||||
<th><?= __('Phone Number') ?></th>
|
||||
<th><?= __('Email') ?></th>
|
||||
<th><?= __('Notes') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($city->addresses as $addresses) : ?>
|
||||
<tr>
|
||||
<td><?= h($addresses->id) ?></td>
|
||||
<td><?= h($addresses->address_name) ?></td>
|
||||
<td><?= h($addresses->contact_name) ?></td>
|
||||
<td><?= h($addresses->address_line1) ?></td>
|
||||
<td><?= h($addresses->address_line2) ?></td>
|
||||
<td><?= h($addresses->city) ?></td>
|
||||
<td><?= h($addresses->city_id) ?></td>
|
||||
<td><?= h($addresses->state) ?></td>
|
||||
<td><?= h($addresses->state_id) ?></td>
|
||||
<td><?= h($addresses->postal_code) ?></td>
|
||||
<td><?= h($addresses->country) ?></td>
|
||||
<td><?= h($addresses->country_id) ?></td>
|
||||
<td><?= h($addresses->phone_number) ?></td>
|
||||
<td><?= h($addresses->email) ?></td>
|
||||
<td><?= h($addresses->notes) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['controller' => 'Addresses', 'action' => 'view', $addresses->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['controller' => 'Addresses', 'action' => 'edit', $addresses->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['controller' => 'Addresses', 'action' => 'delete', $addresses->id], ['confirm' => __('Are you sure you want to delete # {0}?', $addresses->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
54
templates/Countries/add.php
Normal file
54
templates/Countries/add.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $country
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $regions
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $subregions
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Countries'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="countries form content">
|
||||
<?= $this->Form->create($country) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Country') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('iso3');
|
||||
echo $this->Form->control('numeric_code');
|
||||
echo $this->Form->control('iso2');
|
||||
echo $this->Form->control('phonecode');
|
||||
echo $this->Form->control('capital');
|
||||
echo $this->Form->control('currency');
|
||||
echo $this->Form->control('currency_name');
|
||||
echo $this->Form->control('currency_symbol');
|
||||
echo $this->Form->control('tld');
|
||||
echo $this->Form->control('native');
|
||||
echo $this->Form->control('region');
|
||||
echo $this->Form->control('region_id', ['options' => $regions, 'empty' => true]);
|
||||
echo $this->Form->control('subregion');
|
||||
echo $this->Form->control('subregion_id', ['options' => $subregions, 'empty' => true]);
|
||||
echo $this->Form->control('nationality');
|
||||
echo $this->Form->control('timezones');
|
||||
echo $this->Form->control('translations');
|
||||
echo $this->Form->control('latitude');
|
||||
echo $this->Form->control('longitude');
|
||||
echo $this->Form->control('emoji');
|
||||
echo $this->Form->control('emojiU');
|
||||
echo $this->Form->control('created_at');
|
||||
echo $this->Form->control('updated_at');
|
||||
echo $this->Form->control('flag');
|
||||
echo $this->Form->control('wikiDataId');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
59
templates/Countries/edit.php
Normal file
59
templates/Countries/edit.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $country
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $regions
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $subregions
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $country->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $country->id), 'class' => 'side-nav-item']
|
||||
) ?>
|
||||
<?= $this->Html->link(__('List Countries'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="countries form content">
|
||||
<?= $this->Form->create($country) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Country') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('iso3');
|
||||
echo $this->Form->control('numeric_code');
|
||||
echo $this->Form->control('iso2');
|
||||
echo $this->Form->control('phonecode');
|
||||
echo $this->Form->control('capital');
|
||||
echo $this->Form->control('currency');
|
||||
echo $this->Form->control('currency_name');
|
||||
echo $this->Form->control('currency_symbol');
|
||||
echo $this->Form->control('tld');
|
||||
echo $this->Form->control('native');
|
||||
echo $this->Form->control('region');
|
||||
echo $this->Form->control('region_id', ['options' => $regions, 'empty' => true]);
|
||||
echo $this->Form->control('subregion');
|
||||
echo $this->Form->control('subregion_id', ['options' => $subregions, 'empty' => true]);
|
||||
echo $this->Form->control('nationality');
|
||||
echo $this->Form->control('timezones');
|
||||
echo $this->Form->control('translations');
|
||||
echo $this->Form->control('latitude');
|
||||
echo $this->Form->control('longitude');
|
||||
echo $this->Form->control('emoji');
|
||||
echo $this->Form->control('emojiU');
|
||||
echo $this->Form->control('created_at');
|
||||
echo $this->Form->control('updated_at');
|
||||
echo $this->Form->control('flag');
|
||||
echo $this->Form->control('wikiDataId');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
90
templates/Countries/index.php
Normal file
90
templates/Countries/index.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?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>
|
||||
229
templates/Countries/view.php
Normal file
229
templates/Countries/view.php
Normal file
@@ -0,0 +1,229 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $country
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Countries'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="countries view content">
|
||||
<h3><?= h($country->name) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Name') ?></th>
|
||||
<td><?= h($country->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Iso3') ?></th>
|
||||
<td><?= h($country->iso3) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Numeric Code') ?></th>
|
||||
<td><?= h($country->numeric_code) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Iso2') ?></th>
|
||||
<td><?= h($country->iso2) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Phonecode') ?></th>
|
||||
<td><?= h($country->phonecode) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Capital') ?></th>
|
||||
<td><?= h($country->capital) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Currency') ?></th>
|
||||
<td><?= h($country->currency) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Currency Name') ?></th>
|
||||
<td><?= h($country->currency_name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Currency Symbol') ?></th>
|
||||
<td><?= h($country->currency_symbol) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Tld') ?></th>
|
||||
<td><?= h($country->tld) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Native') ?></th>
|
||||
<td><?= h($country->native) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Region') ?></th>
|
||||
<td><?= h($country->region) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Region') ?></th>
|
||||
<td><?= $country->hasValue('region_entity') ? $this->Html->link($country->region_entity->name, ['controller' => 'Regions', 'action' => 'view', $country->region_entity->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Subregion') ?></th>
|
||||
<td><?= h($country->subregion) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Subregion') ?></th>
|
||||
<td><?= $country->hasValue('subregion_entity') ? $this->Html->link($country->subregion_entity->name, ['controller' => 'Subregions', 'action' => 'view', $country->subregion_entity->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Nationality') ?></th>
|
||||
<td><?= h($country->nationality) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Emoji') ?></th>
|
||||
<td><?= h($country->emoji) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('EmojiU') ?></th>
|
||||
<td><?= h($country->emojiU) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('WikiDataId') ?></th>
|
||||
<td><?= h($country->wikiDataId) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($country->id) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Latitude') ?></th>
|
||||
<td><?= $country->latitude === null ? '' : $this->Number->format($country->latitude) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Longitude') ?></th>
|
||||
<td><?= $country->longitude === null ? '' : $this->Number->format($country->longitude) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Created At') ?></th>
|
||||
<td><?= h($country->created_at) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Updated At') ?></th>
|
||||
<td><?= h($country->updated_at) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Flag') ?></th>
|
||||
<td><?= $country->flag ? __('Yes') : __('No'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="text">
|
||||
<strong><?= __('Timezones') ?></strong>
|
||||
<blockquote>
|
||||
<?= $this->Text->autoParagraph(h($country->timezones)); ?>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="text">
|
||||
<strong><?= __('Translations') ?></strong>
|
||||
<blockquote>
|
||||
<?= $this->Text->autoParagraph(h($country->translations)); ?>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h4><?= __('Related Addresses') ?></h4>
|
||||
<?php if (!empty($country->addresses)) : ?>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<th><?= __('Address Name') ?></th>
|
||||
<th><?= __('Contact Name') ?></th>
|
||||
<th><?= __('Address Line1') ?></th>
|
||||
<th><?= __('Address Line2') ?></th>
|
||||
<th><?= __('City') ?></th>
|
||||
<th><?= __('City Id') ?></th>
|
||||
<th><?= __('State') ?></th>
|
||||
<th><?= __('State Id') ?></th>
|
||||
<th><?= __('Postal Code') ?></th>
|
||||
<th><?= __('Country') ?></th>
|
||||
<th><?= __('Country Id') ?></th>
|
||||
<th><?= __('Phone Number') ?></th>
|
||||
<th><?= __('Email') ?></th>
|
||||
<th><?= __('Notes') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($country->addresses as $addresses) : ?>
|
||||
<tr>
|
||||
<td><?= h($addresses->id) ?></td>
|
||||
<td><?= h($addresses->address_name) ?></td>
|
||||
<td><?= h($addresses->contact_name) ?></td>
|
||||
<td><?= h($addresses->address_line1) ?></td>
|
||||
<td><?= h($addresses->address_line2) ?></td>
|
||||
<td><?= h($addresses->city) ?></td>
|
||||
<td><?= h($addresses->city_id) ?></td>
|
||||
<td><?= h($addresses->state) ?></td>
|
||||
<td><?= h($addresses->state_id) ?></td>
|
||||
<td><?= h($addresses->postal_code) ?></td>
|
||||
<td><?= h($addresses->country) ?></td>
|
||||
<td><?= h($addresses->country_id) ?></td>
|
||||
<td><?= h($addresses->phone_number) ?></td>
|
||||
<td><?= h($addresses->email) ?></td>
|
||||
<td><?= h($addresses->notes) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['controller' => 'Addresses', 'action' => 'view', $addresses->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['controller' => 'Addresses', 'action' => 'edit', $addresses->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['controller' => 'Addresses', 'action' => 'delete', $addresses->id], ['confirm' => __('Are you sure you want to delete # {0}?', $addresses->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h4><?= __('Related States') ?></h4>
|
||||
<?php if (!empty($country->states)) : ?>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<th><?= __('Name') ?></th>
|
||||
<th><?= __('Country Id') ?></th>
|
||||
<th><?= __('Country Code') ?></th>
|
||||
<th><?= __('Fips Code') ?></th>
|
||||
<th><?= __('Iso2') ?></th>
|
||||
<th><?= __('Type') ?></th>
|
||||
<th><?= __('Latitude') ?></th>
|
||||
<th><?= __('Longitude') ?></th>
|
||||
<th><?= __('Created At') ?></th>
|
||||
<th><?= __('Updated At') ?></th>
|
||||
<th><?= __('Flag') ?></th>
|
||||
<th><?= __('WikiDataId') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($country->states as $states) : ?>
|
||||
<tr>
|
||||
<td><?= h($states->id) ?></td>
|
||||
<td><?= h($states->name) ?></td>
|
||||
<td><?= h($states->country_id) ?></td>
|
||||
<td><?= h($states->country_code) ?></td>
|
||||
<td><?= h($states->fips_code) ?></td>
|
||||
<td><?= h($states->iso2) ?></td>
|
||||
<td><?= h($states->type) ?></td>
|
||||
<td><?= h($states->latitude) ?></td>
|
||||
<td><?= h($states->longitude) ?></td>
|
||||
<td><?= h($states->created_at) ?></td>
|
||||
<td><?= h($states->updated_at) ?></td>
|
||||
<td><?= h($states->flag) ?></td>
|
||||
<td><?= h($states->wikiDataId) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['controller' => 'States', 'action' => 'view', $states->id]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
32
templates/Regions/add.php
Normal file
32
templates/Regions/add.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $region
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Regions'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="regions form content">
|
||||
<?= $this->Form->create($region) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Region') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('translations');
|
||||
echo $this->Form->control('created_at');
|
||||
echo $this->Form->control('updated_at');
|
||||
echo $this->Form->control('flag');
|
||||
echo $this->Form->control('wikiDataId');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
37
templates/Regions/edit.php
Normal file
37
templates/Regions/edit.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $region
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $region->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $region->id), 'class' => 'side-nav-item']
|
||||
) ?>
|
||||
<?= $this->Html->link(__('List Regions'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="regions form content">
|
||||
<?= $this->Form->create($region) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Region') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('translations');
|
||||
echo $this->Form->control('created_at');
|
||||
echo $this->Form->control('updated_at');
|
||||
echo $this->Form->control('flag');
|
||||
echo $this->Form->control('wikiDataId');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
49
templates/Regions/index.php
Normal file
49
templates/Regions/index.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\Cake\Datasource\EntityInterface> $regions
|
||||
*/
|
||||
?>
|
||||
<div class="regions index content">
|
||||
<h3><?= __('Regions') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('id') ?></th>
|
||||
<th><?= $this->Paginator->sort('name') ?></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 ($regions as $region): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($region->id) ?></td>
|
||||
<td><?= h($region->name) ?></td>
|
||||
<td><?= h($region->created_at) ?></td>
|
||||
<td><?= h($region->updated_at) ?></td>
|
||||
<td><?= h($region->flag) ?></td>
|
||||
<td><?= h($region->wikiDataId) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $region->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>
|
||||
155
templates/Regions/view.php
Normal file
155
templates/Regions/view.php
Normal file
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $region
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Regions'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="regions view content">
|
||||
<h3><?= h($region->name) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Name') ?></th>
|
||||
<td><?= h($region->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('WikiDataId') ?></th>
|
||||
<td><?= h($region->wikiDataId) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($region->id) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Created At') ?></th>
|
||||
<td><?= h($region->created_at) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Updated At') ?></th>
|
||||
<td><?= h($region->updated_at) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Flag') ?></th>
|
||||
<td><?= $region->flag ? __('Yes') : __('No'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="text">
|
||||
<strong><?= __('Translations') ?></strong>
|
||||
<blockquote>
|
||||
<?= $this->Text->autoParagraph(h($region->translations)); ?>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h4><?= __('Related Countries') ?></h4>
|
||||
<?php if (!empty($region->countries)) : ?>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<th><?= __('Name') ?></th>
|
||||
<th><?= __('Iso3') ?></th>
|
||||
<th><?= __('Numeric Code') ?></th>
|
||||
<th><?= __('Iso2') ?></th>
|
||||
<th><?= __('Phonecode') ?></th>
|
||||
<th><?= __('Capital') ?></th>
|
||||
<th><?= __('Currency') ?></th>
|
||||
<th><?= __('Currency Name') ?></th>
|
||||
<th><?= __('Currency Symbol') ?></th>
|
||||
<th><?= __('Tld') ?></th>
|
||||
<th><?= __('Native') ?></th>
|
||||
<th><?= __('Region') ?></th>
|
||||
<th><?= __('Region Id') ?></th>
|
||||
<th><?= __('Subregion') ?></th>
|
||||
<th><?= __('Subregion Id') ?></th>
|
||||
<th><?= __('Nationality') ?></th>
|
||||
<th><?= __('Timezones') ?></th>
|
||||
<th><?= __('Latitude') ?></th>
|
||||
<th><?= __('Longitude') ?></th>
|
||||
<th><?= __('Emoji') ?></th>
|
||||
<th><?= __('EmojiU') ?></th>
|
||||
<th><?= __('Created At') ?></th>
|
||||
<th><?= __('Updated At') ?></th>
|
||||
<th><?= __('Flag') ?></th>
|
||||
<th><?= __('WikiDataId') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($region->countries as $countries) : ?>
|
||||
<tr>
|
||||
<td><?= h($countries->id) ?></td>
|
||||
<td><?= h($countries->name) ?></td>
|
||||
<td><?= h($countries->iso3) ?></td>
|
||||
<td><?= h($countries->numeric_code) ?></td>
|
||||
<td><?= h($countries->iso2) ?></td>
|
||||
<td><?= h($countries->phonecode) ?></td>
|
||||
<td><?= h($countries->capital) ?></td>
|
||||
<td><?= h($countries->currency) ?></td>
|
||||
<td><?= h($countries->currency_name) ?></td>
|
||||
<td><?= h($countries->currency_symbol) ?></td>
|
||||
<td><?= h($countries->tld) ?></td>
|
||||
<td><?= h($countries->native) ?></td>
|
||||
<td><?= h($countries->region) ?></td>
|
||||
<td><?= h($countries->region_id) ?></td>
|
||||
<td><?= h($countries->subregion) ?></td>
|
||||
<td><?= h($countries->subregion_id) ?></td>
|
||||
<td><?= h($countries->nationality) ?></td>
|
||||
<td><?= h($countries->timezones) ?></td>
|
||||
<td><?= h($countries->latitude) ?></td>
|
||||
<td><?= h($countries->longitude) ?></td>
|
||||
<td><?= h($countries->emoji) ?></td>
|
||||
<td><?= h($countries->emojiU) ?></td>
|
||||
<td><?= h($countries->created_at) ?></td>
|
||||
<td><?= h($countries->updated_at) ?></td>
|
||||
<td><?= h($countries->flag) ?></td>
|
||||
<td><?= h($countries->wikiDataId) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['controller' => 'Countries', 'action' => 'view', $countries->id]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h4><?= __('Related Subregions') ?></h4>
|
||||
<?php if (!empty($region->subregions)) : ?>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<th><?= __('Name') ?></th>
|
||||
<th><?= __('Region Id') ?></th>
|
||||
<th><?= __('Created At') ?></th>
|
||||
<th><?= __('Updated At') ?></th>
|
||||
<th><?= __('Flag') ?></th>
|
||||
<th><?= __('WikiDataId') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($region->subregions as $subregions) : ?>
|
||||
<tr>
|
||||
<td><?= h($subregions->id) ?></td>
|
||||
<td><?= h($subregions->name) ?></td>
|
||||
<td><?= h($subregions->region_id) ?></td>
|
||||
<td><?= h($subregions->created_at) ?></td>
|
||||
<td><?= h($subregions->updated_at) ?></td>
|
||||
<td><?= h($subregions->flag) ?></td>
|
||||
<td><?= h($subregions->wikiDataId) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['controller' => 'Subregions', 'action' => 'view', $subregions->id]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
39
templates/States/add.php
Normal file
39
templates/States/add.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $state
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $countries
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List States'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="states form content">
|
||||
<?= $this->Form->create($state) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add State') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('country_id', ['options' => $countries]);
|
||||
echo $this->Form->control('country_code');
|
||||
echo $this->Form->control('fips_code');
|
||||
echo $this->Form->control('iso2');
|
||||
echo $this->Form->control('type');
|
||||
echo $this->Form->control('latitude');
|
||||
echo $this->Form->control('longitude');
|
||||
echo $this->Form->control('created_at');
|
||||
echo $this->Form->control('updated_at');
|
||||
echo $this->Form->control('flag');
|
||||
echo $this->Form->control('wikiDataId');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
44
templates/States/edit.php
Normal file
44
templates/States/edit.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $state
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $countries
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $state->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $state->id), 'class' => 'side-nav-item']
|
||||
) ?>
|
||||
<?= $this->Html->link(__('List States'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="states form content">
|
||||
<?= $this->Form->create($state) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit State') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('country_id', ['options' => $countries]);
|
||||
echo $this->Form->control('country_code');
|
||||
echo $this->Form->control('fips_code');
|
||||
echo $this->Form->control('iso2');
|
||||
echo $this->Form->control('type');
|
||||
echo $this->Form->control('latitude');
|
||||
echo $this->Form->control('longitude');
|
||||
echo $this->Form->control('created_at');
|
||||
echo $this->Form->control('updated_at');
|
||||
echo $this->Form->control('flag');
|
||||
echo $this->Form->control('wikiDataId');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
63
templates/States/index.php
Normal file
63
templates/States/index.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\Cake\Datasource\EntityInterface> $states
|
||||
*/
|
||||
?>
|
||||
<div class="states index content">
|
||||
<h3><?= __('States') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('id') ?></th>
|
||||
<th><?= $this->Paginator->sort('name') ?></th>
|
||||
<th><?= $this->Paginator->sort('country_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('country_code') ?></th>
|
||||
<th><?= $this->Paginator->sort('fips_code') ?></th>
|
||||
<th><?= $this->Paginator->sort('iso2') ?></th>
|
||||
<th><?= $this->Paginator->sort('type') ?></th>
|
||||
<th><?= $this->Paginator->sort('latitude') ?></th>
|
||||
<th><?= $this->Paginator->sort('longitude') ?></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 ($states as $state): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($state->id) ?></td>
|
||||
<td><?= h($state->name) ?></td>
|
||||
<td><?= $state->hasValue('country') ? $this->Html->link($state->country->name, ['controller' => 'Countries', 'action' => 'view', $state->country->id]) : '' ?></td>
|
||||
<td><?= h($state->country_code) ?></td>
|
||||
<td><?= h($state->fips_code) ?></td>
|
||||
<td><?= h($state->iso2) ?></td>
|
||||
<td><?= h($state->type) ?></td>
|
||||
<td><?= $state->latitude === null ? '' : $this->Number->format($state->latitude) ?></td>
|
||||
<td><?= $state->longitude === null ? '' : $this->Number->format($state->longitude) ?></td>
|
||||
<td><?= h($state->created_at) ?></td>
|
||||
<td><?= h($state->updated_at) ?></td>
|
||||
<td><?= h($state->flag) ?></td>
|
||||
<td><?= h($state->wikiDataId) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $state->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>
|
||||
13
templates/States/select.php
Normal file
13
templates/States/select.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\Cake\Datasource\EntityInterface> $states
|
||||
*/
|
||||
|
||||
$this->setLayout('ajax');
|
||||
|
||||
?>
|
||||
<option value="">Select a state</option>
|
||||
<?php foreach ($states as $stateId => $stateName): ?>
|
||||
<option value="<?= $stateId; ?>" <?= $this->request->getQuery('state_id') == $stateId ? 'selected="selected"' : ''; ?>><?= $stateName; ?></option>
|
||||
<?php endforeach; ?>
|
||||
167
templates/States/view.php
Normal file
167
templates/States/view.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $state
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List States'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="states view content">
|
||||
<h3><?= h($state->name) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Name') ?></th>
|
||||
<td><?= h($state->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Country') ?></th>
|
||||
<td><?= $state->hasValue('country') ? $this->Html->link($state->country->name, ['controller' => 'Countries', 'action' => 'view', $state->country->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Country Code') ?></th>
|
||||
<td><?= h($state->country_code) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Fips Code') ?></th>
|
||||
<td><?= h($state->fips_code) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Iso2') ?></th>
|
||||
<td><?= h($state->iso2) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Type') ?></th>
|
||||
<td><?= h($state->type) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('WikiDataId') ?></th>
|
||||
<td><?= h($state->wikiDataId) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($state->id) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Latitude') ?></th>
|
||||
<td><?= $state->latitude === null ? '' : $this->Number->format($state->latitude) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Longitude') ?></th>
|
||||
<td><?= $state->longitude === null ? '' : $this->Number->format($state->longitude) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Created At') ?></th>
|
||||
<td><?= h($state->created_at) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Updated At') ?></th>
|
||||
<td><?= h($state->updated_at) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Flag') ?></th>
|
||||
<td><?= $state->flag ? __('Yes') : __('No'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="related">
|
||||
<h4><?= __('Related Addresses') ?></h4>
|
||||
<?php if (!empty($state->addresses)) : ?>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<th><?= __('Address Name') ?></th>
|
||||
<th><?= __('Contact Name') ?></th>
|
||||
<th><?= __('Address Line1') ?></th>
|
||||
<th><?= __('Address Line2') ?></th>
|
||||
<th><?= __('City') ?></th>
|
||||
<th><?= __('City Id') ?></th>
|
||||
<th><?= __('State') ?></th>
|
||||
<th><?= __('State Id') ?></th>
|
||||
<th><?= __('Postal Code') ?></th>
|
||||
<th><?= __('Country') ?></th>
|
||||
<th><?= __('Country Id') ?></th>
|
||||
<th><?= __('Phone Number') ?></th>
|
||||
<th><?= __('Email') ?></th>
|
||||
<th><?= __('Notes') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($state->addresses as $addresses) : ?>
|
||||
<tr>
|
||||
<td><?= h($addresses->id) ?></td>
|
||||
<td><?= h($addresses->address_name) ?></td>
|
||||
<td><?= h($addresses->contact_name) ?></td>
|
||||
<td><?= h($addresses->address_line1) ?></td>
|
||||
<td><?= h($addresses->address_line2) ?></td>
|
||||
<td><?= h($addresses->city) ?></td>
|
||||
<td><?= h($addresses->city_id) ?></td>
|
||||
<td><?= h($addresses->state) ?></td>
|
||||
<td><?= h($addresses->state_id) ?></td>
|
||||
<td><?= h($addresses->postal_code) ?></td>
|
||||
<td><?= h($addresses->country) ?></td>
|
||||
<td><?= h($addresses->country_id) ?></td>
|
||||
<td><?= h($addresses->phone_number) ?></td>
|
||||
<td><?= h($addresses->email) ?></td>
|
||||
<td><?= h($addresses->notes) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['controller' => 'Addresses', 'action' => 'view', $addresses->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['controller' => 'Addresses', 'action' => 'edit', $addresses->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['controller' => 'Addresses', 'action' => 'delete', $addresses->id], ['confirm' => __('Are you sure you want to delete # {0}?', $addresses->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h4><?= __('Related Cities') ?></h4>
|
||||
<?php if (!empty($state->cities)) : ?>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<th><?= __('Name') ?></th>
|
||||
<th><?= __('State Id') ?></th>
|
||||
<th><?= __('State Code') ?></th>
|
||||
<th><?= __('Country Id') ?></th>
|
||||
<th><?= __('Country Code') ?></th>
|
||||
<th><?= __('Latitude') ?></th>
|
||||
<th><?= __('Longitude') ?></th>
|
||||
<th><?= __('Created At') ?></th>
|
||||
<th><?= __('Updated At') ?></th>
|
||||
<th><?= __('Flag') ?></th>
|
||||
<th><?= __('WikiDataId') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($state->cities as $cities) : ?>
|
||||
<tr>
|
||||
<td><?= h($cities->id) ?></td>
|
||||
<td><?= h($cities->name) ?></td>
|
||||
<td><?= h($cities->state_id) ?></td>
|
||||
<td><?= h($cities->state_code) ?></td>
|
||||
<td><?= h($cities->country_id) ?></td>
|
||||
<td><?= h($cities->country_code) ?></td>
|
||||
<td><?= h($cities->latitude) ?></td>
|
||||
<td><?= h($cities->longitude) ?></td>
|
||||
<td><?= h($cities->created_at) ?></td>
|
||||
<td><?= h($cities->updated_at) ?></td>
|
||||
<td><?= h($cities->flag) ?></td>
|
||||
<td><?= h($cities->wikiDataId) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['controller' => 'Cities', 'action' => 'view', $cities->id]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
34
templates/Subregions/add.php
Normal file
34
templates/Subregions/add.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $subregion
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $regions
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Subregions'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="subregions form content">
|
||||
<?= $this->Form->create($subregion) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Subregion') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('translations');
|
||||
echo $this->Form->control('region_id', ['options' => $regions]);
|
||||
echo $this->Form->control('created_at');
|
||||
echo $this->Form->control('updated_at');
|
||||
echo $this->Form->control('flag');
|
||||
echo $this->Form->control('wikiDataId');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
39
templates/Subregions/edit.php
Normal file
39
templates/Subregions/edit.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $subregion
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $regions
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $subregion->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $subregion->id), 'class' => 'side-nav-item']
|
||||
) ?>
|
||||
<?= $this->Html->link(__('List Subregions'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="subregions form content">
|
||||
<?= $this->Form->create($subregion) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Subregion') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('translations');
|
||||
echo $this->Form->control('region_id', ['options' => $regions]);
|
||||
echo $this->Form->control('created_at');
|
||||
echo $this->Form->control('updated_at');
|
||||
echo $this->Form->control('flag');
|
||||
echo $this->Form->control('wikiDataId');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
54
templates/Subregions/index.php
Normal file
54
templates/Subregions/index.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\Cake\Datasource\EntityInterface> $subregions
|
||||
*/
|
||||
?>
|
||||
<div class="subregions index content">
|
||||
<?= $this->Html->link(__('New Subregion'), ['action' => 'add'], ['class' => 'button float-right']) ?>
|
||||
<h3><?= __('Subregions') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('id') ?></th>
|
||||
<th><?= $this->Paginator->sort('name') ?></th>
|
||||
<th><?= $this->Paginator->sort('region_id') ?></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 ($subregions as $subregion): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($subregion->id) ?></td>
|
||||
<td><?= h($subregion->name) ?></td>
|
||||
<td><?= $subregion->hasValue('region') ? $this->Html->link($subregion->region->name, ['controller' => 'Regions', 'action' => 'view', $subregion->region->id]) : '' ?></td>
|
||||
<td><?= h($subregion->created_at) ?></td>
|
||||
<td><?= h($subregion->updated_at) ?></td>
|
||||
<td><?= h($subregion->flag) ?></td>
|
||||
<td><?= h($subregion->wikiDataId) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $subregion->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $subregion->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $subregion->id], ['confirm' => __('Are you sure you want to delete # {0}?', $subregion->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>
|
||||
133
templates/Subregions/view.php
Normal file
133
templates/Subregions/view.php
Normal file
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $subregion
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('Edit Subregion'), ['action' => 'edit', $subregion->id], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Form->postLink(__('Delete Subregion'), ['action' => 'delete', $subregion->id], ['confirm' => __('Are you sure you want to delete # {0}?', $subregion->id), 'class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('List Subregions'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('New Subregion'), ['action' => 'add'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="subregions view content">
|
||||
<h3><?= h($subregion->name) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Name') ?></th>
|
||||
<td><?= h($subregion->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Region') ?></th>
|
||||
<td><?= $subregion->hasValue('region') ? $this->Html->link($subregion->region->name, ['controller' => 'Regions', 'action' => 'view', $subregion->region->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('WikiDataId') ?></th>
|
||||
<td><?= h($subregion->wikiDataId) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($subregion->id) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Created At') ?></th>
|
||||
<td><?= h($subregion->created_at) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Updated At') ?></th>
|
||||
<td><?= h($subregion->updated_at) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Flag') ?></th>
|
||||
<td><?= $subregion->flag ? __('Yes') : __('No'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="text">
|
||||
<strong><?= __('Translations') ?></strong>
|
||||
<blockquote>
|
||||
<?= $this->Text->autoParagraph(h($subregion->translations)); ?>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h4><?= __('Related Countries') ?></h4>
|
||||
<?php if (!empty($subregion->countries)) : ?>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<th><?= __('Name') ?></th>
|
||||
<th><?= __('Iso3') ?></th>
|
||||
<th><?= __('Numeric Code') ?></th>
|
||||
<th><?= __('Iso2') ?></th>
|
||||
<th><?= __('Phonecode') ?></th>
|
||||
<th><?= __('Capital') ?></th>
|
||||
<th><?= __('Currency') ?></th>
|
||||
<th><?= __('Currency Name') ?></th>
|
||||
<th><?= __('Currency Symbol') ?></th>
|
||||
<th><?= __('Tld') ?></th>
|
||||
<th><?= __('Native') ?></th>
|
||||
<th><?= __('Region') ?></th>
|
||||
<th><?= __('Region Id') ?></th>
|
||||
<th><?= __('Subregion') ?></th>
|
||||
<th><?= __('Subregion Id') ?></th>
|
||||
<th><?= __('Nationality') ?></th>
|
||||
<th><?= __('Timezones') ?></th>
|
||||
<th><?= __('Translations') ?></th>
|
||||
<th><?= __('Latitude') ?></th>
|
||||
<th><?= __('Longitude') ?></th>
|
||||
<th><?= __('Emoji') ?></th>
|
||||
<th><?= __('EmojiU') ?></th>
|
||||
<th><?= __('Created At') ?></th>
|
||||
<th><?= __('Updated At') ?></th>
|
||||
<th><?= __('Flag') ?></th>
|
||||
<th><?= __('WikiDataId') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($subregion->countries as $countries) : ?>
|
||||
<tr>
|
||||
<td><?= h($countries->id) ?></td>
|
||||
<td><?= h($countries->name) ?></td>
|
||||
<td><?= h($countries->iso3) ?></td>
|
||||
<td><?= h($countries->numeric_code) ?></td>
|
||||
<td><?= h($countries->iso2) ?></td>
|
||||
<td><?= h($countries->phonecode) ?></td>
|
||||
<td><?= h($countries->capital) ?></td>
|
||||
<td><?= h($countries->currency) ?></td>
|
||||
<td><?= h($countries->currency_name) ?></td>
|
||||
<td><?= h($countries->currency_symbol) ?></td>
|
||||
<td><?= h($countries->tld) ?></td>
|
||||
<td><?= h($countries->native) ?></td>
|
||||
<td><?= h($countries->region) ?></td>
|
||||
<td><?= h($countries->region_id) ?></td>
|
||||
<td><?= h($countries->subregion) ?></td>
|
||||
<td><?= h($countries->subregion_id) ?></td>
|
||||
<td><?= h($countries->nationality) ?></td>
|
||||
<td><?= h($countries->timezones) ?></td>
|
||||
<td><?= h($countries->translations) ?></td>
|
||||
<td><?= h($countries->latitude) ?></td>
|
||||
<td><?= h($countries->longitude) ?></td>
|
||||
<td><?= h($countries->emoji) ?></td>
|
||||
<td><?= h($countries->emojiU) ?></td>
|
||||
<td><?= h($countries->created_at) ?></td>
|
||||
<td><?= h($countries->updated_at) ?></td>
|
||||
<td><?= h($countries->flag) ?></td>
|
||||
<td><?= h($countries->wikiDataId) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['controller' => 'Countries', 'action' => 'view', $countries->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['controller' => 'Countries', 'action' => 'edit', $countries->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['controller' => 'Countries', 'action' => 'delete', $countries->id], ['confirm' => __('Are you sure you want to delete # {0}?', $countries->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
59
templates/element/Addresses/form.php
Normal file
59
templates/element/Addresses/form.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $address
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $cities
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $states
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $countries
|
||||
* @var string|null $prefix
|
||||
*/
|
||||
$prefix = $prefix ?? '';
|
||||
$stateIdId = $prefix ? str_replace('.', '-', $prefix) . 'state_id' : 'state_id';
|
||||
$inputs = [
|
||||
$prefix ? $prefix . 'address_name' : 'address_name' => [],
|
||||
$prefix ? $prefix . 'contact_name' : 'contact_name' => [],
|
||||
$prefix ? $prefix . 'address_line1' : 'address_line1' => [],
|
||||
$prefix ? $prefix . 'address_line2' : 'address_line2' => [],
|
||||
$prefix ? $prefix . 'city' : 'city' => [],
|
||||
$prefix ? $prefix . 'city_id' : 'city_id' => [
|
||||
'hidden' => true,
|
||||
'options' => $cities ?? [],
|
||||
'empty' => true
|
||||
],
|
||||
$prefix ? $prefix . 'state_id' : 'state_id' => [
|
||||
'options' => $states ?? [],
|
||||
'id' => $stateIdId,
|
||||
'empty' => 'Select a state',
|
||||
'default' => $address->state_id ?? '',
|
||||
'value' => $address->state_id ?? '',
|
||||
],
|
||||
$prefix ? $prefix . 'postal_code' : 'postal_code' => [],
|
||||
$prefix ? $prefix . 'country_id' : 'country_id' => [
|
||||
'options' => $countries,
|
||||
'empty' => 'Select a country',
|
||||
'default' => 233,
|
||||
'hx-trigger' => isset($address->id) ? 'change' : 'change, load delay:1s',
|
||||
'hx-get' => $this->Url->build([
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'States',
|
||||
'action' => 'select',
|
||||
'?' => [
|
||||
'state_id' => $address->state_id ?? '',
|
||||
],
|
||||
]),
|
||||
'hx-target' => '#' . $stateIdId,
|
||||
// 'hx-indicator' => '.htmx-indicator',
|
||||
],
|
||||
$prefix ? $prefix . 'phone_number' : 'phone_number' => [],
|
||||
$prefix ? $prefix . 'email' : 'email' => [],
|
||||
$prefix ? $prefix . 'notes' : 'notes' => [],
|
||||
];
|
||||
foreach ($inputs as $inputName => $inputOptions) {
|
||||
if (array_key_exists('hidden', $inputOptions) && $inputOptions['hidden']) {
|
||||
echo $this->Form->hidden($inputName, $inputOptions);
|
||||
}
|
||||
if (!array_key_exists('hidden', $inputOptions) || !$inputOptions['hidden']) {
|
||||
echo $this->Form->control($inputName, $inputOptions);
|
||||
}
|
||||
}
|
||||
?>
|
||||
0
templates/element/Layout/submenu.php
Normal file
0
templates/element/Layout/submenu.php
Normal file
Reference in New Issue
Block a user