<?php $__env->startSection('content'); ?>
<div class="side-title">
    <h3><?php echo e(meta('new', $lang) ?? $head ?? ''); ?></h3>
</div>
<div class="border-item">
    <form class="form-row" method="post" action="<?php echo e($action); ?>">
        <?php if($location ?? ''  && $location->id): ?>
            <?php echo method_field('PUT'); ?>
        <?php endif; ?>
        <?php echo csrf_field(); ?>
        <?php $__currentLoopData = $languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="form-group col-lg-6">
            <label><?php echo e(meta('name', $language->local) ?? __('locations.name')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('name_'.$language->local) ? 'is-invalid' : ''); ?>" name="name_<?php echo e($language->local); ?>" placeholder="<?php echo e(meta('name', $language->local) ?? __('locations.name')); ?>" value='<?php echo e(old("name_{$language->local}", $location[$language->local]->name ?? "")); ?>'/>
        </div>
        <div class="form-group col-lg-6">
            <label><?php echo e(__('locations.address')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('address_'.$language->local) ? 'is-invalid' : ''); ?>" name="address_<?php echo e($language->local); ?>" placeholder="<?php echo e(meta('address', $language->local) ?? __('locations.address')); ?>" value='<?php echo e(old("address_{$language->local}", $location[$language->local]->address ?? "")); ?>'/>
        </div>
                <div class="form-group col-lg-6">
                    <label><?php echo e(__('locations.box')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>
                    <input type="text" class="form-control <?php echo e($errors->has('box_'.$language->local) ? 'is-invalid' : ''); ?>" name="box_<?php echo e($language->local); ?>" placeholder="<?php echo e(meta('box', $language->local) ?? __('locations.box')); ?>" value='<?php echo e(old("box_{$language->local}", $location[$language->local]->box ?? "")); ?>'/>
                </div>
                <div class="form-group col-lg-6">
                    <label><?php echo e(__('locations.slug')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>
                    <input type="text" class="form-control <?php echo e($errors->has('slug_'.$language->local) ? 'is-invalid' : ''); ?>" name="slug_<?php echo e($language->local); ?>" placeholder="<?php echo e(meta('slug', $language->local) ?? __('locations.slug')); ?>" value='<?php echo e(old("slug_{$language->local}", $location[$language->local]->slug ?? "")); ?>'/>
                </div>
                <div class="form-group col-lg-6">
                    <label><?php echo e(__('locations.meta_description')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>
                    <input type="text" class="form-control <?php echo e($errors->has('meta_description_'.$language->local) ? 'is-invalid' : ''); ?>" name="meta_description_<?php echo e($language->local); ?>" placeholder="<?php echo e(meta('meta_description', $language->local) ?? __('locations.meta_description')); ?>" value='<?php echo e(old("meta_description_{$language->local}", $location[$language->local]->meta_description ?? "")); ?>'/>
                </div>

                <div class="form-group col-lg-6">
                    <label><?php echo e(__('locations.keywords')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>
                    <input type="text" class="form-control <?php echo e($errors->has('keywords_'.$language->local) ? 'is-invalid' : ''); ?>" name="keywords_<?php echo e($language->local); ?>" placeholder="<?php echo e(meta('keywords', $language->local) ?? __('locations.keywords')); ?>" value='<?php echo e(old("keywords_{$language->local}", $location[$language->local]->keywords ?? "")); ?>'/>
                </div>

                <div class="form-group col-lg-12 hotel_details">
                    <label><?php echo e(meta('description', $language->local) ?? __('hotels.description')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>
                    <textarea name="description_<?php echo e($language->local); ?>" class="form-control my-editor <?php echo e($errors->has('description_'.$language->local) ? 'is-invalid' : ''); ?>" placeholder="<?php echo e(meta('description', $language->local) ?? __('hotels.description')); ?>"><?php echo e(old("description_{$language->local}", $location[$language->local]->description ?? "")); ?></textarea>
                </div>

            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


        <div class="form-group col-lg-4">
            <label><?php echo e(__('locations.phone')); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('phone') ? 'is-invalid' : ''); ?>" name="phone" placeholder="<?php echo e(__('locations.phone')); ?>" value='<?php echo e(old("phone", $location->phone ?? "")); ?>'/>
        </div>

        <div class="form-group col-lg-4">
            <label><?php echo e(__('locations.fax')); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('fax') ? 'is-invalid' : ''); ?>" name="fax" placeholder="<?php echo e(__('locations.fax')); ?>" value='<?php echo e(old("fax", $location->fax ?? "")); ?>'/>
        </div>

        <div class="form-group col-lg-4">
            <label><?php echo e(__('locations.email')); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('email') ? 'is-invalid' : ''); ?>" name="email" placeholder="<?php echo e(__('locations.email')); ?>" value='<?php echo e(old("email", $location->email ?? "")); ?>'/>
        </div>

        <div class="form-group col-lg-6">
            <label><?php echo e(__('locations.latitude')); ?> </label>
            <input type="text" id="lat" class="form-control <?php echo e($errors->has('latitude') ? 'is-invalid' : ''); ?>" name="latitude" placeholder="<?php echo e(__('locations.latitude')); ?>" value='<?php echo e(old("latitude", $location->latitude ?? "")); ?>'/>
        </div>

        <div class="form-group col-lg-6">
            <label><?php echo e(__('locations.longitude')); ?> </label>
            <input type="text" id="lng" class="form-control <?php echo e($errors->has('longitude') ? 'is-invalid' : ''); ?>" name="longitude" placeholder="<?php echo e(__('locations.longitude')); ?>" value='<?php echo e(old("longitude", $location->longitude ?? "")); ?>'/>
        </div>

        <div class="form-group col-lg-12">
            <input type="text" class="form-control addresspicker_map" id="addresspicker_map" />
            <div id="map" style="width:100%;margin:auto; height:300px;"></div>
        </div>
        
            <div class="border-item photos col-md-12 other_image_container">
                <div class="row">
                    <?php if(count($images)): ?>
                        <?php $__currentLoopData = $images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $photo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="col-md-4">
                                <div class="items">
                                    <div class="img">
                                        <a href="<?php echo e(asset($photo ?? '')); ?>" data-fancybox="gallery"><img src="<?php echo e(asset($photo ?? '')); ?>" alt=""></a>
                                    </div>
                                    <input type="hidden" name="images[]" value="<?php echo e($photo->image ?? ""); ?>">
                                    <a href="#" class="close"><i class="fas fa-times"></i></a>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                </div>
                <div class="text-center">
                    <input id="other_image_thumbnail" class="other_image_thumbnail" type="hidden"/>
                    <div class="clearfix"></div>
                    <span id="add">
                    <a id="lfm" data-width="" data-cache="article_gallery" data-input=".other_image_thumbnail" data-preview="" data-show="" data-hide="" class="lfm add">
                        Add New Item
                    </a>
                </span>
                </div>
            </div>
        

        <?php if(!in_array($currentUserInfo->role, ['contributor'])): ?>
        <div class="text-center mt-5 col-12">
            <button class="butn"><span><?php echo e(__('dashboard.save')); ?></span></button>
        </div>
        <?php endif; ?>
    </form>
</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('inner_js'); ?>
    <!-- Editor JS files -->
        <script src="<?php echo e(asset('/assets/admin/js/lib/tinymce.min.js')); ?>"></script>
    
    <script>
        let route_prefix = "<?php echo e(url(config('lfm.prefix'))); ?>",
            url = "<?php echo e(url('/')); ?>/",
            currentLanguage = "<?php echo e($lang); ?>",
            imagePath = "<?php echo e(asset('')); ?>";
    </script>
    <script src="<?php echo e(asset('assets/admin/js/editor.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/js/lfm.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/js/locations.js')); ?>"></script>


    <!-- STOP TILL BUY becaue of ADV -->

<script type="text/javascript">
    var google_api_key = "AIzaSyB9cRhktIiFviUN5DxYhFHIfrHp7WKfBD0"
    var lang_abbr = "ar"
</script>


<script src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;libraries=places&key=AIzaSyB9cRhktIiFviUN5DxYhFHIfrHp7WKfBD0"></script>

<script src="<?php echo e(asset('assets/admin/js/lib/jquery.ui.addresspicker.js')); ?>"></script>
<script src="<?php echo e(asset('assets/admin/js/map.js')); ?>"></script>
<script type="text/javascript">

</script>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\wamp64\www\modules\resources\views/admin/locations/form.blade.php ENDPATH**/ ?>