<?php $__env->startSection('css'); ?>
    <link href="https://api.mapbox.com/mapbox-gl-js/v2.8.2/mapbox-gl.css" rel="stylesheet">
    
    


    
    
    

    <style>
        #lang_buttons {
            width: 90%;
            margin: 0 auto;
        }
        .button {
            display: inline-block;
            position: relative;
            cursor: pointer;
            width: 20%;
            padding: 8px;
            border-radius: 3px;
            margin-top: 10px;
            font-size: 12px;
            text-align: center;
            color: #fff;
            background: #ee8a65;
            font-family: sans-serif;
            font-weight: bold;
        }
    </style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="side-title">
        <h3><?php echo e($head ?? ''); ?></h3>
    </div>

    <div class="border-item">
        <form class="form-row add_consulting_from" method="get" action="<?php echo e($action); ?>" enctype="multipart/form-data" autocomplete="off">
            <?php echo csrf_field(); ?>
                <div class="form-group col">
                    <label><?php echo e(meta('type', $lang) ?? __('documentationRequests.type')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e(__('documentationRequests.'.$documentationRequest->type)); ?>'/>
                </div>
                <div class="form-group col">
                    <label><?php echo e(meta('documentation_type_id', $lang) ?? __('documentationRequests.documentation_type_id')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($documentationType ? $documentationType->name : ''); ?>'/>
                </div>
                <?php if($city): ?>
                    <div class="form-group col">
                        <label><?php echo e(meta('city_id', $lang) ?? __('documentationRequests.city_id')); ?> </label>
                        <input readonly class="form-control bg-white" value='<?php echo e($city->name); ?>'/>
                    </div>
                <?php endif; ?>

                <?php if($documentationRequest->lat && $documentationRequest->lng): ?>
                    <div class="form-group col-lg-12">
                        <div style="border:0; height: 400px; width: 100%" class="map" id="map"></div>
                        <ul id="lang_buttons">
                            <li id="button-ar" class="button"><?php echo e(__('main.arabic')); ?></li>
                            
                            
                            
                            
                        </ul>
                    </div>
                <?php endif; ?>

                <div class="form-group col-lg-12">
                    <label><?php echo e(meta('address', $lang) ?? __('documentationRequests.address')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($documentationRequest->address); ?>'/>
                </div>
                <div class="form-group col-lg-4">
                    <label><?php echo e(meta('user_name', $lang) ?? __('documentationRequests.user_name')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($documentationRequest->user_name); ?>'/>
                </div>
                <div class="form-group col-lg-4">
                    <label><?php echo e(meta('user_phone', $lang) ?? __('documentationRequests.user_phone')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($documentationRequest->user_phone); ?>'/>
                </div>
                <div class="form-group col-lg-4">
                    <label><?php echo e(meta('user_email', $lang) ?? __('documentationRequests.user_email')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($documentationRequest->user_email); ?>'/>
                </div>
                <div class="form-group col-lg-4">
                    <label><?php echo e(meta('documentation_date', $lang) ?? __('documentationRequests.documentation_date')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($documentationRequest->documentation_date); ?>'/>
                </div>
                <div class="form-group col-lg-4">
                    <label><?php echo e(meta('documentation_time', $lang) ?? __('documentationRequests.documentation_time')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($documentationRequest->documentation_time); ?>'/>
                </div>
                <div class="form-group col-lg-4">
                    <label><?php echo e(meta('pay_way', $lang) ?? __('documentationRequests.pay_way')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e(__('documentationRequests.'.($documentationRequest->pay_way ?? 'coupon_discount'))); ?>'/>
                </div>
                <div class="form-group col-lg-6">
                    <label><?php echo e(meta('total', $lang) ?? __('documentationRequests.total')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($documentationRequest->total); ?>'/>
                </div>
                <div class="form-group col-lg-6">
                    <label><?php echo e(meta('status', $lang) ?? __('documentationRequests.status')); ?> </label>

                        <select name="status" id="status" class="form-control">
                            <option value=""><?php echo e(meta('status', $lang) ?? __('documentationRequests.status')); ?></option>
                            <option <?php echo e(($documentationRequest->status ?? null) == 'being_documented' ? 'selected' : ''); ?> value="being_documented"><?php echo e(__('documentationRequests.being_documented')); ?></option>
                            <option <?php echo e(($documentationRequest->status ?? null) == 'documented' ? 'selected' : ''); ?> value="documented"><?php echo e(__('documentationRequests.documented')); ?></option>
                        </select>



                </div>

                <div class="form-group col-lg-12">
                    <label><?php echo e(meta('notes', $lang) ?? __('documentationRequests.notes')); ?> </label>
                    <textarea cols="30" rows="10" readonly class="form-control bg-white"><?php echo e($documentationRequest->notes ?? ""); ?></textarea>
                </div>


            <div class="text-center mt-5 col-12">
                <button class="butn add_consulting_button"><span><?php echo e(__('dashboard.save')); ?></span></button>
            </div>
        </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>
        var route_prefix = "<?php echo e(url(config('lfm.prefix'))); ?>";
        var url = "<?php echo e(url('/')); ?>/",
            currentLanguage = "<?php echo e($lang); ?>",
            inputName = '';
    </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/lib/toastr.min.js')); ?>"></script>


    <script src='https://api.mapbox.com/mapbox-gl-js/v2.8.2/mapbox-gl.js'></script>
    
    
    
    <script src="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v5.0.0/mapbox-gl-geocoder.min.js"></script>

    
    
    
    
    



    <script>
        let latitude = "<?php echo e($documentationRequest->lat); ?>",
            longitude = "<?php echo e($documentationRequest->lng); ?>";



            if(latitude && longitude){
                mapboxgl.accessToken = 'pk.eyJ1IjoibGVnYWxvZ2FpbCIsImEiOiJjbDM3NXF2Nm8xdXBoM2JwOWMyZ2Zua3o2In0.MVzxl1JEKwb-V9z5unrOwQ';

                const map = new mapboxgl.Map({
                    container: 'map',
                    style: 'mapbox://styles/mapbox/streets-v11',
                    center: [46, 25],
                    zoom: 4
                });

                const marker = new mapboxgl.Marker({
                    draggable: false
                }).setLngLat([longitude, latitude]).addTo(map);

                mapboxgl.setRTLTextPlugin(
                    'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js',
                    null,
                    true // Lazy load the plugin
                );


                document.getElementById('lang_buttons').addEventListener('click', (event) => {
                    const language = event.target.id.substr('button-'.length);
                    // Use setLayoutProperty to set the value of a layout property in a style layer.
                    // The three arguments are the id of the layer, the name of the layout property,
                    // and the new property value.
                    map.setLayoutProperty('country-label', 'text-field', [
                        'get',
                        `name_${language}`
                    ]);
                });
            }

    </script>

    <script>
        $('.add_consulting_button').click(async function (e) {
            e.preventDefault();

            let form = $('.add_consulting_from'),
                data = new FormData(form[0]),
                url = form.attr('action'),
                method = form.attr('method');

            const response=await ajax({
                url,
                data,
                dataType: 'json',
                method
            });

            if (response.url){
                toasterSuccess(response.message);
                setTimeout(function () {
                    window.location.href = response.url;
                }, 100)
            }

            if (response.errors){
                toasterError(response.errors);
            }


        });
    </script>

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




<?php echo $__env->make('admin.layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/balyomhost/public_html/legal/resources/views/admin/documentation_requests/form.blade.php ENDPATH**/ ?>