<?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($consulting ?? ''  && $consulting->id): ?>
                <?php echo method_field('PUT'); ?>
            <?php endif; ?>
            <?php echo csrf_field(); ?>

                <div class="form-group col-lg-3">
                    <label><?php echo e(meta('consulting_date', $local) ?? __('consultings.consulting_date')); ?> </label>
                    <input type="date" class="form-control" name="consulting_date" placeholder="<?php echo e(meta('consulting_date', $local) ?? __('consultings.consulting_date')); ?>" value='<?php echo e($consulting->consulting_date ?? ""); ?>'/>
                </div>
                <div class="form-group col-lg-3">
                    <label><?php echo e(meta('consulting_time', $local) ?? __('consultings.consulting_time')); ?> </label>
                    <input type="time" class="form-control" name="consulting_time" placeholder="<?php echo e(meta('consulting_time', $local) ?? __('consultings.consulting_time')); ?>" value='<?php echo e($consulting->consulting_time ?? ""); ?>'/>
                </div>
                <div class="form-group col-lg-3">
                    <label><?php echo e(meta('price', $local) ?? __('consultings.price')); ?> </label>
                    <input type="number" class="form-control" name="price" placeholder="<?php echo e(meta('price', $local) ?? __('consultings.price')); ?>" value='<?php echo e($consulting->price ?? ""); ?>'/>
                </div>
                <div class="form-group col-lg-3">
                    <label><?php echo e(meta('status', $local) ?? __('consultings.status')); ?> </label>
                    <select name="status" id="status" class="form-control">
                        <option value=""><?php echo e(meta('status', $local) ?? __('consultings.status')); ?></option>
                        <option <?php echo e(($consulting->status ?? null) == '1' ? 'selected' : ''); ?> value="1"><?php echo e(__('consultings.active')); ?></option>
                        <option <?php echo e(($consulting->status ?? null) == '0' ? 'selected' : ''); ?> value="0"><?php echo e(__('consultings.not_active')); ?></option>
                    </select>
                </div>

                <div class="card col-md-12 mb-3">
                    <div class="card-header">
                        <h3><?php echo e(__('consultings.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(($consulting->type ?? null) == 'urgent' ? 'checked' : ''); ?> value="urgent" class="custom-control-input" id="urgent" name="type">
                                <label class="custom-control-label" for="urgent"> <?php echo e(__('consultings.urgent')); ?></label>
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="custom-control custom-checkbox mb-2">
                                <input type="radio" <?php echo e(($consulting->type ?? null) == 'appointment' ? 'checked' : ''); ?> value="appointment" class="custom-control-input" id="appointment" name="type">
                                <label class="custom-control-label" for="appointment"> <?php echo e(__('consultings.appointment')); ?></label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="card col-md-12 mb-3">
                    <div class="card-header">
                        <h3><?php echo e(__('consultings.way')); ?></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(($consulting->way ?? null) == 'phone' ? 'checked' : ''); ?> value="phone" class="custom-control-input" id="phone" name="way">
                                <label class="custom-control-label" for="phone"> <?php echo e(__('consultings.phone')); ?></label>
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="custom-control custom-checkbox mb-2">
                                <input type="radio" <?php echo e(($consulting->way ?? null) == 'zoom' ? 'checked' : ''); ?> value="zoom" class="custom-control-input" id="zoom" name="way">
                                <label class="custom-control-label" for="zoom"> <?php echo e(__('consultings.zoom')); ?></label>
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="custom-control custom-checkbox mb-2">
                                <input type="radio" <?php echo e(($consulting->way ?? null) == 'office' ? 'checked' : ''); ?> value="office" class="custom-control-input" id="office" name="way">
                                <label class="custom-control-label" for="office"> <?php echo e(__('consultings.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();
            $(this).prop('disabled', true);

            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){
                window.location.href = response.url;
            }

            if (response.errors){
                $(this).prop('disabled', true);
                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 C:\wamp64\www\legal\resources\views/admin/consultings/form.blade.php ENDPATH**/ ?>