default_city.php
78 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package VikAppointments |
| 4 | * @subpackage core |
| 5 | * @author E4J s.r.l. |
| 6 | * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved. |
| 7 | * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL |
| 8 | * @link https://vikwp.com |
| 9 | */ |
| 10 | |
| 11 | // No direct access |
| 12 | defined('ABSPATH') or die('No script kiddies please!'); |
| 13 | |
| 14 | $city = $this->city; |
| 15 | |
| 16 | $vik = VAPApplication::getInstance(); |
| 17 | |
| 18 | ?> |
| 19 | |
| 20 | <!-- CITY NAME - Text --> |
| 21 | |
| 22 | <?php echo $vik->openControl(JText::translate('VAPMANAGECITY1') . '*'); ?> |
| 23 | <input type="text" name="city_name" class="input-xxlarge input-large-text required" value="<?php echo $city->city_name; ?>" size="40" id="vapcity" /> |
| 24 | <?php echo $vik->closeControl(); ?> |
| 25 | |
| 26 | <!-- CITY 2 CODE - Text --> |
| 27 | |
| 28 | <?php echo $vik->openControl(JText::translate('VAPMANAGECITY2')); ?> |
| 29 | <input type="text" name="city_2_code" value="<?php echo $city->city_2_code; ?>" size="20" maxlength="2" /> |
| 30 | <?php echo $vik->closeControl(); ?> |
| 31 | |
| 32 | <!-- CITY 3 CODE - Text --> |
| 33 | |
| 34 | <?php echo $vik->openControl(JText::translate('VAPMANAGECITY3')); ?> |
| 35 | <input type="text" name="city_3_code" value="<?php echo $city->city_3_code; ?>" size="20" maxlength="3" /> |
| 36 | <?php echo $vik->closeControl(); ?> |
| 37 | |
| 38 | <!-- LATITUDE - Number --> |
| 39 | |
| 40 | <?php echo $vik->openControl(JText::translate('VAPMANAGECITY4')); ?> |
| 41 | <input class="city-latlng" type="number" name="latitude" value="<?php echo $city->latitude; ?>" size="40" id="vap-city-latitude" /> |
| 42 | <?php echo $vik->closeControl(); ?> |
| 43 | |
| 44 | <!-- LONGITUDE - Number --> |
| 45 | |
| 46 | <?php echo $vik->openControl(JText::translate('VAPMANAGECITY5')); ?> |
| 47 | <input class="city-latlng" type="number" name="longitude" value="<?php echo $city->longitude; ?>" size="40" id="vap-city-longitude" /> |
| 48 | <?php echo $vik->closeControl(); ?> |
| 49 | |
| 50 | <!-- PUBLISHED - Checkbox --> |
| 51 | |
| 52 | <?php |
| 53 | $yes = $vik->initRadioElement('', '', $city->published == 1); |
| 54 | $no = $vik->initRadioElement('', '', $city->published == 0); |
| 55 | |
| 56 | echo $vik->openControl(JText::translate('VAPMANAGECITY6')); |
| 57 | echo $vik->radioYesNo('published', $yes, $no, false); |
| 58 | echo $vik->closeControl(); |
| 59 | ?> |
| 60 | |
| 61 | <script> |
| 62 | |
| 63 | (function($) { |
| 64 | 'use strict'; |
| 65 | |
| 66 | $(function() { |
| 67 | $('.city-latlng').on('change', () => { |
| 68 | changeCityLatLng($('#vap-city-latitude').val(), $('#vap-city-longitude').val()); |
| 69 | }); |
| 70 | |
| 71 | $('#vapcity').on('change', function() { |
| 72 | evaluateCoordinatesFromCity($(this).val()); |
| 73 | }); |
| 74 | }); |
| 75 | })(jQuery); |
| 76 | |
| 77 | </script> |
| 78 |