<?php if (isset($component)) { $__componentOriginalfcbcb094a4e25784fc05a845b0fe2686439b0eb5 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\AdminPanelLayout::class, []); ?>
<?php $component->withName('admin-panel-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('title'); ?>
        تعریف سوالات خدمت
     <?php $__env->endSlot(); ?>
     <?php $__env->slot('main'); ?>
        <!-- Checked checkbox -->
        <div class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1 class="m-0 text-dark">ایجاد سوالات خدمت : <?php echo e($service->name); ?></h1>
                    </div><!-- /.col -->
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-left">

                            <li class="breadcrumb-item">مدیریت سوالات</li>
                            <li class="breadcrumb-item active">ایجاد سوالات خدمت</li>
                        </ol>
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.container-fluid -->
        </div>
        <section class="content mt-sm-3 d-flex flex-column justify-content-around">
            <div class="card p-0 card-primary col-md-7 mx-auto mb-4">
                <div class="card-header">
                    <h3 class="card-title small">ایجاد سوالات جدید</h3>
                </div>
                <!-- /.card-header -->
                <!-- form start -->
                <form class="mt-3 p-2" action="<?php echo e(route('service.question_store',$service->id)); ?>" method="post">
                    <?php echo csrf_field(); ?>
                    <div class="form-group">
                        <input type="text" name='question' class="form-control" id="question"
                               placeholder="متن سوال ..." value="<?php echo e(old('question')); ?>" required>
                        <?php $__errorArgs = ['question'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid">
                            <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                        </div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <div class="form-check pr-4">
                        <input class="form-check-input" type="radio" name="type" id="typeCheckbox"
                               value="radio" checked>
                        <label class="form-check-label text-muted" for="typeCheckbox">
                            نوع سوال radio button باشد
                        </label>
                    </div>
                    <div class="form-check pr-4 mb-sm-3 mt-sm-2">
                        <input class="form-check-input" type="radio" name="type" id="typeRadioBtn"
                               value="checkbox">
                        <label class="form-check-label text-muted" for="typeRadioBtn">
                            نوع سوال checkbox باشد
                        </label>
                    </div>
                    <?php $__errorArgs = ['type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <div class="invalid">
                        <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                    </div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    <?php for($i = 0 ; $i < 10 ; $i++ ): ?>
                        <div class="form-group">
                            <input type="text" name='options[]' class="form-control" id="option.<?php echo e($i); ?>"
                                   placeholder="گزینه <?php echo e($i); ?>" value="<?php echo e(old('options.'.$i)); ?>" <?php echo e($i==0 ? 'required' : ''); ?> >
                            <?php $__errorArgs = ['option.'.$i];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="invalid">
                                <p class="text-danger" style="font-size: 0.8rem;padding-right: 0.2rem"><?php echo e($message); ?></p>
                            </div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                    <?php endfor; ?>
                    <button type="submit" class="btn btn-primary btn-block mt-3">ثبت</button>
                </form>
            </div>
            <div class="d-md-flex flex-wrap justify-content-around mb-2">
                <?php if($service->questions): ?>
                    <?php $__currentLoopData = $service->questions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <ul class="list-group mb-2 col-5" id="<?php echo e($item->id); ?>">
                            <li class="list-group-item active"><?php echo e($item->content); ?></li>
                            <?php $__currentLoopData = $item->children; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $child): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <li class="list-group-item">
                                    <?php if($item->type == 'checkbox'): ?>
                                        <div class="form-check">
                                            <input class="form-check-input" type="checkbox" value="" id="defaultCheck1">
                                            <label class="form-check-label" for="defaultCheck1">
                                                <?php echo e($child->content); ?>

                                            </label>
                                        </div>
                                    <?php else: ?>
                                        <div class="form-check">
                                            <input class="form-check-input" type="radio" name="exampleRadios"
                                                   id="exampleRadios1" value="option1" checked>
                                            <label class="form-check-label" for="exampleRadios1">
                                                <?php echo e($child->content); ?>

                                            </label>
                                        </div>
                                    <?php endif; ?>
                                    <div class="float-left">
                                        <form class="form-inline d-flex justify-content-end">
                                            <label class="sr-only" for="price_<?php echo e($child->id); ?>">هزینه :</label>
                                            <input type="text" class="form-control  mr-sm-2 col-3" id="price_<?php echo e($child->id); ?>" placeholder="هزینه" value="<?php echo e($child->price == 0 ? '' : $child->price); ?>">
                                            <button type="submit" onclick="questionPrice(event,'<?php echo e(route('service.question_price',$child->id)); ?>',<?php echo e($child->id); ?>)" class="btn btn-outline-primary mr-2">ثبت</button>
                                        </form>
                                    </div>
                                </li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <li class="list-group-item">
                                <form class="form-inline d-flex justify-content-center">
                                    <label class="sr-only" for="priority_<?php echo e($item->id); ?>">اولویت :</label>
                                    <input type="text" class="form-control  mr-sm-2 col-5" id="priority_<?php echo e($item->id); ?>" placeholder="اولویت نمایش سوال" value="<?php echo e($item->priority); ?>">
                                    <button type="submit" onclick="questionPriority(event,'<?php echo e(route('service.question_priority',$item->id)); ?>',<?php echo e($item->id); ?>)" class="btn btn-outline-primary mr-2 col-5 mr-2">ثبت</button>
                                </form>
                            </li>
                            <li class="list-group-item">
                                <span class="btn btn-outline-danger btn-block"
                                      onclick="deleteQuestionField(event,'<?php echo e(route('service.question_delete',[$service->id,$item->id])); ?>',<?php echo e($item->id); ?>)">
                                    حذف این سوال
                                </span>
                            </li>
                        </ul>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
            </div>
        </section>
     <?php $__env->endSlot(); ?>
    <?php if(session()->get('status') == 'created'): ?>
         <?php $__env->slot('linkScript'); ?>
            <script>
                Swal.fire({
                    icon: 'success',
                    text: 'ایجاد توضیحات با موفقیت انجام شد',
                })
            </script>
         <?php $__env->endSlot(); ?>
    <?php endif; ?>
    <?php if(session()->get('status') == 'deleted'): ?>
         <?php $__env->slot('linkScript'); ?>
            <script>
                Swal.fire({
                    icon: 'success',
                    text: 'حذف توضیحات با موفقیت انجام شد',
                })
            </script>
         <?php $__env->endSlot(); ?>
    <?php endif; ?>
    <script>
        // CKEDITOR.replace( 'question' );
    </script>
    <?php if(session()->get('status') == 'done'): ?>
         <?php $__env->slot('linkScript'); ?>
            <script>
                Swal.fire({
                    icon: 'success',
                    text: 'ویرایش جزئیات سفارش با موفقیت انجام شد',
                })
            </script>
         <?php $__env->endSlot(); ?>
    <?php endif; ?>
    <?php if(session()->get('status') == 'failed'): ?>
         <?php $__env->slot('linkScript'); ?>
            <script>
                Swal.fire({
                    icon: 'error',
                    text: 'ویرایش جزئیات  با خطا مواجه شد',
                })
            </script>
         <?php $__env->endSlot(); ?>
    <?php endif; ?>
 <?php if (isset($__componentOriginalfcbcb094a4e25784fc05a845b0fe2686439b0eb5)): ?>
<?php $component = $__componentOriginalfcbcb094a4e25784fc05a845b0fe2686439b0eb5; ?>
<?php unset($__componentOriginalfcbcb094a4e25784fc05a845b0fe2686439b0eb5); ?>
<?php endif; ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php /**PATH C:\wamp64\www\newer\Modules\Mehrab\Service\Providers/../Resources/Views//Admin/question_service.blade.php ENDPATH**/ ?>
