![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/medad.corals.io/storage/framework/views/ |
<?php $__env->startSection('content_header'); ?> <?php $__env->startComponent('components.content_header'); ?> <?php $__env->slot('page_title'); ?> <?php echo e($title_singular); ?> <?php $__env->endSlot(); ?> <?php $__env->slot('breadcrumb'); ?> <?php echo e(Breadcrumbs::render('address_location_create_edit')); ?> <?php $__env->endSlot(); ?> <?php echo $__env->renderComponent(); ?> <?php $__env->stopSection(); ?> <?php $__env->startSection('content'); ?> <?php echo \Illuminate\View\Factory::parentPlaceholder('content'); ?> <?php $__env->startComponent('components.box'); ?> <?php echo CoralsForm::openForm($location); ?> <div class="row"> <div class="col-md-4"> <?php echo CoralsForm::text('name','Utility::attributes.location.name',true); ?> <?php echo CoralsForm::text('slug','Utility::attributes.location.slug',false, $location->slug, ['help_text'=>'Utility::attributes.location.slug_help']); ?> <?php echo CoralsForm::text('address','Utility::attributes.location.address', true,null,['onFocus'=>'geolocate()','id'=>'_autocomplete','autocomplete'=>'off','placeholder'=>'Utility::attributes.location.address_placeholder']); ?> <?php echo CoralsForm::text('lat','Utility::attributes.location.lat',true); ?> <?php echo CoralsForm::text('long','Utility::attributes.location.long',true); ?> </div> <div class="col-md-4"> <?php echo CoralsForm::text('zip','Utility::attributes.location.zip', false, null,['id'=>'_postal_code']); ?> <?php echo CoralsForm::text('city','Utility::attributes.location.city', false, null,['id'=>'_locality']); ?> <?php echo CoralsForm::text('state','Utility::attributes.location.state', false, null,['id'=>'_administrative_area_level_1']); ?> <?php echo CoralsForm::text('country','Utility::attributes.location.country', false, null,['id'=>'_country']); ?> </div> <div class="col-md-4"> <?php $locationTypes = \Settings::get('utility_location_types',[]); ?> <?php echo CoralsForm::select('module','Utility::attributes.tag.module', \Utility::getUtilityModules()); ?> <?php echo CoralsForm::radio('status','Corals::attributes.status', true, trans('Corals::attributes.status_options')); ?> <?php echo CoralsForm::select('type', 'Utility::attributes.location.type', $locationTypes , false); ?> <?php echo CoralsForm::select('parent_id','Utility::attributes.location.parent', \Address::getLocationsList(), false, null, [], 'select2'); ?> <?php echo CoralsForm::textarea('description','Utility::attributes.location.description'); ?> <?php echo CoralsForm::customFields($location, 'col-md-12'); ?> </div> </div> <div class="row"> <div class="col-md-12"> <?php echo CoralsForm::formButtons(); ?> </div> </div> <?php echo CoralsForm::closeForm($location); ?> <?php echo $__env->renderComponent(); ?> <?php $__env->startComponent('components.box'); ?> <div id="map" style="height: 500px;"> </div> <?php echo $__env->renderComponent(); ?> <?php $__env->stopSection(); ?> <?php $__env->startSection('js'); ?> <script> var placeSearch, autocomplete; var componentForm = { _locality: 'long_name', _administrative_area_level_1: 'long_name', _country: 'long_name', _postal_code: 'short_name' }; function initAutocomplete() { initMap(); // Create the autocomplete object, restricting the search to geographical // location types. autocomplete = new google.maps.places.Autocomplete( /** @type {!HTMLInputElement} */(document.getElementById('_autocomplete')), { types: ['geocode'], }); // When the user selects an address from the dropdown, populate the address // fields in the form. autocomplete.addListener('place_changed', fillInAddress); } function fillInAddress() { // Get the place details from the autocomplete object. var place = autocomplete.getPlace(); for (var component in componentForm) { document.getElementById(component).value = ''; document.getElementById(component).disabled = false; } document.getElementById('lat').value = place.geometry.location.lat(); document.getElementById('long').value = place.geometry.location.lng(); // Get each component of the address from the place details // and fill the corresponding field on the form. for (var i = 0; i < place.address_components.length; i++) { var addressType = place.address_components[i].types[0]; if (componentForm["_" + addressType]) { var val = place.address_components[i][componentForm["_" + addressType]]; if (addressType === 'administrative_area_level_1') { $("#_" + "administrative_area_level_1").val(val).trigger("change"); } else { document.getElementById("_" + addressType).value = val; } } } initMap(); } // Bias the autocomplete object to the user's geographical location, // as supplied by the browser's 'navigator.geolocation' object. function geolocate() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function (position) { var geolocation = { lat: position.coords.latitude, lng: position.coords.longitude }; var circle = new google.maps.Circle({ center: geolocation, radius: position.coords.accuracy }); autocomplete.setBounds(circle.getBounds()); }); } } var googleSrc = 'https://maps.googleapis.com/maps/api/js?key=<?php echo e(\Settings::get('utility_google_address_api_key')); ?>&libraries=places&callback=initAutocomplete'; document.write('<script src="' + googleSrc + '" async defer><\/script>'); function stopEnterKey(event) { if ((event.keyCode === 13)) { return false; } } function initMap() { var lat = parseFloat(document.getElementById('lat').value); var long = parseFloat(document.getElementById('long').value); if (isNaN(lat) || isNaN(long)) { return; } var latLng = {lat: lat, lng: long}; var map = new google.maps.Map(document.getElementById('map'), { zoom: 4, center: latLng }); var marker = new google.maps.Marker({ position: latLng, map: map, }); } $(document).ready(function () { document.onkeypress = stopEnterKey; }); </script> <?php $__env->stopSection(); ?> <?php echo $__env->make('layouts.crud.create_edit', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/corals/medad.corals.io/Corals/modules/Utility/resources/views/address/locations/create_edit.blade.php ENDPATH**/ ?>