first standalone plugin commit
This commit is contained in:
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>
|
||||
Reference in New Issue
Block a user