<?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="post" action="<?php echo e($action); ?>" enctype="multipart/form-data" autocomplete="off">
            <?php if($documentation ?? ''  && $documentation->id): ?>
                <?php echo method_field('PUT'); ?>
            <?php endif; ?>
            <?php echo csrf_field(); ?>

                <div class="form-group col-lg-6">
                    <label><?php echo e(meta('documentation_date', $local) ?? __('documentations.documentation_date')); ?> </label>
                    <input type="date" class="form-control" name="documentation_date" placeholder="<?php echo e(meta('documentation_date', $local) ?? __('documentations.documentation_date')); ?>" value='<?php echo e($documentation->documentation_date ?? ""); ?>'/>
                </div>
                <div class="form-group col-lg-6">
                    <label><?php echo e(meta('documentation_time', $local) ?? __('documentations.documentation_time')); ?> </label>
                    <input type="time" class="form-control" name="documentation_time" placeholder="<?php echo e(meta('documentation_time', $local) ?? __('documentations.documentation_time')); ?>" value='<?php echo e($documentation->documentation_time ?? ""); ?>'/>
                </div>

                <div class="card col-md-12 mb-3">
                    <div class="card-header">
                        <h3><?php echo e(__('documentations.type')); ?></h3>
                    </div>
                    <div class="card-body row justify-content-around">
                        <div class="col-md-2">
                            <div class="custom-control custom-checkbox mb-2">
                                <input type="radio" <?php echo e(($documentation->type ?? null) == 'inside_office' ? 'checked' : ''); ?> value="inside_office" class="custom-control-input" id="inside_office" name="type">
                                <label class="custom-control-label" for="inside_office"> <?php echo e(__('documentations.inside_office')); ?></label>
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="custom-control custom-checkbox mb-2">
                                <input type="radio" <?php echo e(($documentation->type ?? null) == 'outside_office' ? 'checked' : ''); ?> value="outside_office" class="custom-control-input" id="outside_office" name="type">
                                <label class="custom-control-label" for="outside_office"> <?php echo e(__('documentations.outside_office')); ?></label>
                            </div>
                        </div>
                    </div>
                </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($local); ?>",
            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>

        $('.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');

            $('.discount_dates_input').each(function () {
                if ($(this).prop('checked') === false){
                    data.append('discount_dates[]', 0);
                    data.append('discount_percentage[]', 'empty');
                } else {
                    data.append('discount_dates[]', 1);
                    let inputSibling = $(this).siblings('.discount_percentage');
                    data.append('discount_percentage[]', inputSibling.val());

                }});


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

            if (response.url){
                window.location.href = response.url;
            }

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


        });

        $(document).on('click', '.active_hall' , async function (e) {
            e.preventDefault();
            let url = $(this).data('href'),
                method = 'get';

            const response=await ajax({
                url,
                dataType: 'json',
                method,
            });
            if (response.message) {
                $(this).children('i').toggleClass('fa-check text-success fa-times text-danger')

            }
        });
    </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\legal\resources\views/admin/documentations/form.blade.php ENDPATH**/ ?>