Merge branch 'release-2.140.115'
[feisty_meow.git] / production / example_apps / zippy_maps / src / Template / Locations / distance.ctp
diff --git a/production/example_apps/zippy_maps/src/Template/Locations/distance.ctp b/production/example_apps/zippy_maps/src/Template/Locations/distance.ctp
new file mode 100644 (file)
index 0000000..76f7b12
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/**
+  * @var \App\View\AppView $this
+  */
+?>
+<nav class="large-3 medium-4 columns" id="actions-sidebar">
+    <ul class="side-nav">
+        <li class="heading"><?= __('Actions') ?></li>
+        <li><?= $this->Html->link(__('List Locations'), ['action' => 'index']) ?></li>
+    </ul>
+</nav>
+<div class="locations form large-9 medium-8 columns content">
+    <?= $this->Form->create('DistanceCalculator') ?>
+    <fieldset>
+        <legend><?= __('Calculate Distance') ?></legend>
+        <?php
+                       echo $this->Form->control('from._ids', [
+               'type' => 'select',
+               'options' => $locationsFrom,
+               'value' => $fromId,
+                       ]);
+                       
+                       if ($fromAddress !== null) {
+                               echo $this->Form->control('from-address', [
+                                       'type' => 'textarea',
+                                       'rows' => 1,
+                                       'default' => $fromAddress,
+                                       'disabled' => 'disabled'
+                               ]);                             
+                       }
+            
+                       echo $this->Form->control('to._ids', [
+               'type' => 'select',
+               'options' => $locationsTo,
+               'value' => $toId,
+                       ]);
+
+                       if ($toAddress !== null) {
+                               echo $this->Form->control('to-address', [
+                                       'type' => 'textarea',
+                                       'rows' => 1,
+                                       'default' => $toAddress,
+                                       'disabled' => 'disabled'
+                               ]);                             
+                       }
+                       
+                       echo $this->Form->control('distance', [
+                               'type' => 'textarea',
+                               'rows' => 1,
+                               'default' => $distanceCalculated,
+                               'disabled' => 'disabled'
+                       ]);
+                                   
+        ?>
+    </fieldset>
+    <?= $this->Form->button(__('Calculate')) ?>
+    <?= $this->Form->end() ?>
+</div>