<?php $__env->startSection('content'); ?>

    <div class="dashboard_main">
        <div class="factor_sec mx-auto">
            <div class="dashboard_main_container_style  mx-auto">
                <h5 class="dashboard_main_container_style_header">سفارشات شما</h5>
                <div
                    class="alert alert-info  m-1 mb-2 <?php if( $errors->any() || session()->has('status')): ?> <?php else: ?> d-none <?php endif; ?> "
                    role="alert">
                    <?php if($errors->any()): ?>
                        <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php echo e($error); ?><br>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                    <?php if(session()->has('status')): ?>
                        <?php echo e(session('status')); ?>

                    <?php endif; ?>
                </div>
                <div class="table_custom mx-auto">
                    <?php if($orders->count() > 0): ?>
                        <table>
                            <caption class="d-none">سفارشات مربوطه</caption>
                            <thead>
                            <tr>
                                <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 = $orders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td data-label="کد پیگیری" class="persianumber">
                                        <?php echo e($order->code); ?>

                                    </td>
                                    <td data-label="عنوان">
                                        <?php echo e($order->service->name); ?>

                                    </td>
                                    <td data-label="زمان ثبت" class="persianumber">
                                        <?php echo e($order->created_at); ?>

                                    </td>
                                    <td data-label="(تومان)هزینه" class="persianumber">
                                        <?php echo e($order->price == 0 ? 'توافقی' : $order->price); ?>

                                    </td>
                                    <td data-label="وضعیت سفارش">
                                        <?php echo e($order->getStatusForShowUsers()); ?>

                                    </td>
                                    <td data-label="عملیات">
                                        <?php if( $order->status == \Mehrab\OrderService\Models\OrderService::WAITING_PAYMENT): ?>
                                            <a href="<?php echo e(route('panel.order_factor',$order->id)); ?>"
                                               class="btn btn-outline-info btn-sm">
                                                پرداخت

                                            </a>

                                        <?php elseif(in_array($order->status,[\Mehrab\OrderService\Models\OrderService::DONE,\Mehrab\OrderService\Models\OrderService::DONE_AND_WAITING_FEEDBACK_FOR_EXPERT])): ?>
                                            <a href="<?php echo e(route('panel.order_factor',$order->id)); ?>"
                                               class="btn btn-outline-info btn-sm">
                                                فاکتور
                                            </a>
                                        <?php else: ?>
                                            -
                                        <?php endif; ?>

                                        <?php if($order->status == \Mehrab\OrderService\Models\OrderService::DONE_AND_WAITING_FEEDBACK_FOR_EXPERT): ?>
                                            <a href="#"
                                               onclick="feedbackToExpert(event,'<?php echo e(route('panel.rate',$order->id)); ?>')"
                                               class="btn btn-outline-info btn-sm">
                                                فیدبک
                                            </a>
                                        <?php endif; ?>
                                        <?php if($order->getCanUserCancelOrder()): ?>
                                            <a href="#"
                                               onclick="cancelOrderByUser(event,'<?php echo e(route('panel.cancel',$order->id)); ?>')"
                                               class="btn btn-outline-danger btn-sm">
                                                لغو سفارش
                                            </a>
                                        <?php endif; ?>

                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php else: ?>
                                <div class="alert alert-primary" role="alert">
                                    سفارشی ثبت نشده است !
                                </div>
                            <?php endif; ?>
                            </tbody>
                        </table>
                </div>
                <?php echo e($orders->appends(request()->query())->links()); ?>


            </div>

        </div>


    </div>

<?php $__env->stopSection(); ?>

<?php echo $__env->make("Front::Layout.Panel.master", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\newer\Modules\Mehrab\Front\Providers/../Resources/Views//Panel/orders.blade.php ENDPATH**/ ?>