<?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">لیست سفارشات خدمات</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">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">سفارشات خدمات</h3>
                </div>
                <!-- /.card-header -->
                <div class="card-body p-0">
                    <div class="alert alert-success col-md-11 mx-auto mt-2 d-none" role="alert" id="alertDelUser">
                        سفارش خدمات با موفقیت حذف گردید
                    </div>

                    <div class="mx-auto my-3 d-flex">
                        <button type="button" class="btn btn-primary mx-auto btn-sm" data-toggle="modal"
                                data-target="#exampleModalCenter">
                            جست و جو
                        </button>
                    </div>

                    <div class="tableSection bg-light smSmall p-0 pr-sm-4 pl-sm-4 pt-sm-4 pb-0 table-responsive">
                        <table class="table table-striped text-center ">
                            <thead>
                            <tr>
                                <th scope="col">ID</th>
                                <th scope="col">کد سفارش</th>

                                <th scope="col">خدمت مد نظر</th>

                                <th scope="col">هزینه</th>
                                <th scope="col">تاریخ ثبت</th>
                                <th scope="col">موعد انجام</th>
                                <th scope="col">وضعیت</th>
                                <th scope="col">عملیات</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php $__currentLoopData = $orderServices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php if(auth()->id() == $order->operator_id || auth()->id() == $order->team_leader_id || auth()->id() == $order->expert_id || auth()->user()->hasAnyPermission([\Mehrab\RolePermission\Models\Permission::PERMISSION_SUPER_ADMIN,\Mehrab\RolePermission\Models\Permission::PERMISSION_ACCESS_ALL_ORDER_SERVICE,\Mehrab\RolePermission\Models\Permission::PERMISSION_ORDER_SERVICE_FACTOR])): ?>
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any([\Mehrab\RolePermission\Models\Permission::PERMISSION_ORDER_SERVICE_OPERATOR , \Mehrab\RolePermission\Models\Permission::PERMISSION_TEAM_LEADER,\Mehrab\RolePermission\Models\Permission::PERMISSION_EXPERT,\Mehrab\RolePermission\Models\Permission::PERMISSION_ACCESS_ALL_ORDER_SERVICE,\Mehrab\RolePermission\Models\Permission::PERMISSION_ORDER_SERVICE_FACTOR])): ?>
                                        <?php if(!$order->getCheckInQueueTeamLeader() && auth()->user()->hasPermissionTo(\Mehrab\RolePermission\Models\Permission::PERMISSION_TEAM_LEADER)): ?>
                                            <?php if($order->status != \Mehrab\OrderService\Models\OrderService::CANCELED): ?>
                                            <tr id="tr<?php echo e($order->id); ?>">
                                                <th scope="row" class="small"><?php echo e($order->id); ?></th>
                                                <th scope="row" class="small"><?php echo e($order->code); ?></th>




                                                <td class="small"><?php echo e($order->service->name); ?></td>

                                                <td class="small"><?php echo e($order->price); ?></td>
                                                <td class="small"><?php echo e($order->created_at); ?></td>
                                                <td class="small"><?php echo e($order->time_todo); ?><span
                                                        class="text-danger d-block"><?php echo app('translator')->get($order->getTimeToDoStatus()); ?></span>
                                                </td>
                                                <td class="small">در صف</td>
                                                <td class="d-flex justify-content-around">
                                                   -
                                                </td>
                                            </tr>
                                                <?php endif; ?>
                                        <?php else: ?>
                                            <tr id="tr<?php echo e($order->id); ?>">
                                                <th scope="row" class="small"><?php echo e($order->id); ?></th>
                                                <th scope="row" class="small"><?php echo e($order->code); ?></th>




                                                <td class="small"><?php echo e($order->service->name); ?></td>

                                                <td class="small"><?php echo e($order->getPrice()); ?></td>
                                                <td class="small"><?php echo e($order->created_at); ?></td>
                                                <td class="small"><?php echo e($order->time_todo); ?><span
                                                        class="text-danger d-block"><?php echo app('translator')->get($order->getTimeToDoStatus()); ?></span>
                                                </td>
                                                <td class="small"><?php echo app('translator')->get($order->status); ?></td>
                                                <td class="d-flex justify-content-around">
                                                    <a class="btn btn-sm btn-primary"
                                                       href="<?php echo e(route('order_service.show',$order->id)); ?>" title="مشاهده">
                                                        <i class="fa fa-eye text-light"></i>
                                                    </a>
                                                    <a class="btn btn-sm btn-info"
                                                       href="<?php echo e(route('order_details.show',$order->id)); ?>" title="خلاصه سفارش">
                                                        <i class="fa fa-bars text-light"></i>
                                                    </a>
                                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any([\Mehrab\RolePermission\Models\Permission::PERMISSION_ORDER_SERVICE_FACTOR,\Mehrab\RolePermission\Models\Permission::PERMISSION_SUPER_ADMIN])): ?>
                                                        <?php if($order->status == \Mehrab\OrderService\Models\OrderService::WAITING_PAYMENT || $order->status == \Mehrab\OrderService\Models\OrderService::CHECK_FACTOR): ?>
                                                            <a class="btn btn-sm <?php echo e($order->status == \Mehrab\OrderService\Models\OrderService::CHECK_FACTOR ? 'btn-danger' : 'btn-warning'); ?> "
                                                               href="<?php echo e(route('set_factor_index',$order->id)); ?>" title="فاکتور">
                                                                <i class="fa fa-newspaper-o text-light"></i>
                                                            </a>
                                                        <?php endif; ?>
                                                    <?php endif; ?>
                                                </td>
                                            </tr>

                                        <?php endif; ?>
                                    <?php endif; ?>
                                <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                    <?php echo e($orderServices->appends(request()->query())->links()); ?>

                </div>
                <!-- /.card-body -->
            </div>

            <!-- Modal -->
            <div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog"
                 aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
                <div class="modal-dialog modal-dialog-centered" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title" id="exampleModalLongTitle"></h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <div class="modal-body">
                            <form>
                                <div class="form-group row">
                                    <label for="inputPassword3" class="col-sm-2 col-form-label">از تاریخ</label>
                                    <div class="col-sm-10">
                                        <input type="text" name="start_day" value="<?php echo e(request()->start_day); ?>" class="form-control" id="inputPassword3" placeholder="1400-06-08">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="inputPassword3" class="col-sm-2 col-form-label">تا تاریخ</label>
                                    <div class="col-sm-10">
                                        <input type="text" name="end_day" value="<?php echo e(request()->end_day); ?>" class="form-control" id="inputPassword3" placeholder="1400-07-09">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="inputPassword3" class="col-sm-2 col-form-label">وضعیت</label>
                                    <div class="col-sm-10">
                                        <select class="form-control" name="status">
                                            <option selected value="">انتخاب</option>
                                            <option <?php echo e(request()->status == \Mehrab\OrderService\Models\OrderService::DONE? 'selected' : ''); ?> value="<?php echo e(\Mehrab\OrderService\Models\OrderService::DONE); ?>">اتمام</option>
                                            <option <?php echo e(request()->status == \Mehrab\OrderService\Models\OrderService::CANCELED? 'selected' : ''); ?> value="<?php echo e(\Mehrab\OrderService\Models\OrderService::CANCELED); ?>">کنسل شده</option>
                                            <option <?php echo e(request()->status == \Mehrab\OrderService\Models\OrderService::SUSPENDED? 'selected' : ''); ?> value="<?php echo e(\Mehrab\OrderService\Models\OrderService::SUSPENDED); ?>">تعلیق</option>
                                            <option <?php echo e(request()->status == \Mehrab\OrderService\Models\OrderService::WAITING_PAYMENT? 'selected' : ''); ?> value="<?php echo e(\Mehrab\OrderService\Models\OrderService::WAITING_PAYMENT); ?>">در انتظار پرداخت</option>
                                            <option <?php echo e(request()->status == \Mehrab\OrderService\Models\OrderService::CHECK_FACTOR? 'selected' : ''); ?> value="<?php echo e(\Mehrab\OrderService\Models\OrderService::CHECK_FACTOR); ?>">ارجاع فاکتور</option>
                                            <option <?php echo e(request()->status == \Mehrab\OrderService\Models\OrderService::ACCEPT_EXPERT? 'selected' : ''); ?> value="<?php echo e(\Mehrab\OrderService\Models\OrderService::ACCEPT_EXPERT); ?>">پذیرش متخصص</option>
                                            <option <?php echo e(request()->status == \Mehrab\OrderService\Models\OrderService::DOING? 'selected' : ''); ?> value="<?php echo e(\Mehrab\OrderService\Models\OrderService::DOING); ?>">در حال انجام</option>
                                            <option <?php echo e(request()->status == \Mehrab\OrderService\Models\OrderService::PENDING_EXPERT? 'selected' : ''); ?> value="<?php echo e(\Mehrab\OrderService\Models\OrderService::PENDING_EXPERT); ?>">متخصص</option>
                                            <option <?php echo e(request()->status == \Mehrab\OrderService\Models\OrderService::PENDING_TEAM_LEADER? 'selected' : ''); ?> value="<?php echo e(\Mehrab\OrderService\Models\OrderService::PENDING_TEAM_LEADER); ?>">سرتیم</option>
                                            <option <?php echo e(request()->status == \Mehrab\OrderService\Models\OrderService::PENDING_OPERATOR? 'selected' : ''); ?> value="<?php echo e(\Mehrab\OrderService\Models\OrderService::PENDING_OPERATOR); ?>">اپراتور</option>
                                            <option <?php echo e(request()->status == \Mehrab\OrderService\Models\OrderService::DONE_AND_WAITING_FEEDBACK_FOR_EXPERT? 'selected' : ''); ?> value="<?php echo e(\Mehrab\OrderService\Models\OrderService::DONE_AND_WAITING_FEEDBACK_FOR_EXPERT); ?>">اتمام بدون فیدبک</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="inputPassword3" class="col-sm-2 col-form-label">خدمت</label>
                                    <div class="col-sm-10">
                                        <input type="text" name="service" value="<?php echo e(request()->service); ?>" class="form-control" id="inputPassword3">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="inputPassword3" class="col-sm-4 col-form-label">کد سفارش</label>
                                    <div class="col-sm-8">
                                        <input type="text" name="code" value="<?php echo e(request()->code); ?>" class="form-control" id="inputPassword3">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="inputPassword3" class="col-sm-6 col-form-label small sm">موبایل سفارش دهنده</label>
                                    <div class="col-sm-6">
                                        <input type="text" name="mobile" value="<?php echo e(request()->mobile); ?>" class="form-control" id="inputPassword3" placeholder="مثلا : 09121231232">
                                    </div>
                                </div>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(\Mehrab\RolePermission\Models\Permission::PERMISSION_ORDER_SERVICE_FACTOR,\Mehrab\RolePermission\Models\Permission::PERMISSION_ACCESS_ALL_ORDER_SERVICE)): ?>
                                <div class="form-group row">
                                    <label for="inputPassword3" class="col-sm-6 col-form-label small sm">متخصص مربوطه</label>
                                    <div class="col-sm-6">
                                        <input type="text" name="expert_id" value="<?php echo e(request()->expert_id); ?>" class="form-control" id="inputPassword3" placeholder="مثلا : 14">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="inputPassword3" class="col-sm-6 col-form-label small sm">اپراتور مربوطه</label>
                                    <div class="col-sm-6">
                                        <input type="text" name="operator_id" value="<?php echo e(request()->operator_id); ?>" class="form-control" id="inputPassword3" placeholder="مثلا : 14">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="inputPassword3" class="col-sm-6 col-form-label small sm">سرتیم مربوطه</label>
                                    <div class="col-sm-6">
                                        <input type="text" name="team_leader_id" value="<?php echo e(request()->team_leader_id); ?>" class="form-control" id="inputPassword3" placeholder="مثلا : 14">
                                    </div>
                                </div>
                                <?php endif; ?>
                                <div class="form-group row float-left">
                                    <div class="col-sm-10 ">
                                        <button type="submit" class="btn btn-primary mx-auto">جست و جو</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </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') == 'updated'): ?>
         <?php $__env->slot('linkScript'); ?>
            <script>
                Swal.fire({
                    icon: 'success',
                    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:\xampp\htdocs\newer\Modules\Mehrab\OrderService\Providers/../Resources/Views//Admin/list_order_service.blade.php ENDPATH**/ ?>
