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

                <div class="form-group col-lg-2">
                    <label><?php echo e(meta('consulting_id', $local) ?? __('activeConsultings.consulting_id')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($activeConsulting->id ?? ""); ?>'/>
                </div>
                <div class="form-group col-lg-4">
                    <label><?php echo e(meta('user_name', $local) ?? __('activeConsultings.user_name')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($activeConsulting->user_name ?? ""); ?>'/>
                </div>
                <div class="form-group col-lg-3">
                    <label><?php echo e(meta('user_phone', $local) ?? __('activeConsultings.user_phone')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($activeConsulting->user_phone ?? ""); ?>'/>
                </div>
                <div class="form-group col-lg-3">
                    <label><?php echo e(meta('user_email', $local) ?? __('activeConsultings.user_email')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($activeConsulting->user_email ?? ""); ?>'/>
                </div>
                <div class="form-group col-lg-3">
                    <label><?php echo e(meta('pay_way', $local) ?? __('activeConsultings.pay_way')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e(__('activeConsultings.'.($activeConsulting->pay_way ?? 'coupon_discount')) ?? ""); ?>'/>
                </div>
                <div class="form-group col-lg-3">
                    <label><?php echo e(meta('consulting_type', $local) ?? __('activeConsultings.consulting_type')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e(__('activeConsultings.'.$activeConsulting->consulting_type) ?? ""); ?>'/>
                </div>
                <div class="form-group col-lg-3">
                    <label><?php echo e(meta('consulting_date', $local) ?? __('activeConsultings.consulting_date')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($activeConsulting->consulting_date ?? ""); ?>'/>
                </div>
                <div class="form-group col-lg-3">
                    <label><?php echo e(meta('consulting_time', $local) ?? __('activeConsultings.consulting_time')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($activeConsulting->consulting_time ?? ""); ?>'/>
                </div>
                <div class="form-group col-lg-6">
                    <label><?php echo e(meta('total', $local) ?? __('activeConsultings.total')); ?> </label>
                    <input readonly class="form-control bg-white" value='<?php echo e($activeConsulting->total ?? ""); ?>'/>
                </div>
                <div class="form-group col-lg-6">
                    <label><?php echo e(meta('status', $local) ?? __('activeConsultings.status')); ?> </label>
                    <select name="status" id="status" class="form-control">
                        <option value=""><?php echo e(meta('status', $local) ?? __('activeConsultings.status')); ?></option>
                        <option <?php echo e(($activeConsulting->status ?? null) == 'active' ? 'selected' : ''); ?> value="active"><?php echo e(__('activeConsultings.active')); ?></option>
                        <option <?php echo e(($activeConsulting->status ?? null) == 'finished' ? 'selected' : ''); ?> value="finished"><?php echo e(__('activeConsultings.finished')); ?></option>
                    </select>
                </div>
                <div class="form-group col-lg-12">
                    <label><?php echo e(meta('consulting_subject', $local) ?? __('activeConsultings.consulting_subject')); ?> </label>
                    <textarea cols="30" rows="10" readonly class="form-control bg-white"><?php echo e($activeConsulting->consulting_subject ?? ""); ?></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($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/active_consultings/form.blade.php ENDPATH**/ ?>