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