<?php $__env->startSection('title', 'لغو سفارش ' . $order->order_number); ?>

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

<div class="bread-crumb pt-3">
    <div class="container-fluid">
        <div class="content-box">
            <div class="container-fluid">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb mb-0">
                        <li class="breadcrumb-item"><a href="<?php echo e(route('home')); ?>" class="font-14 text-muted">خانه</a></li>
                        <li class="breadcrumb-item"><a href="<?php echo e(route('panel.index')); ?>" class="font-14 text-muted">پنل کاربری</a></li>
                        <li class="breadcrumb-item"><a href="<?php echo e(route('panel.orders.index')); ?>" class="font-14 text-muted">سفارش‌های من</a></li>
                        <li class="breadcrumb-item active main-color-one-color font-14" aria-current="page">لغو سفارش</li>
                    </ol>
                </nav>
            </div>
        </div>
    </div>
</div>

<div class="content">
    <div class="container-fluid">

        <div class="custom-filter d-lg-none d-block">
            <button class="btn btn-filter-float border-0 main-color-two-bg shadow-box px-4 rounded-3 position-fixed"
                style="z-index:999;bottom:80px;" type="button"
                data-bs-toggle="offcanvas" data-bs-target="#panelSideCanvas" aria-controls="panelSideCanvas">
                <i class="bi bi-list font-20 fw-bold text-white"></i>
                <span class="d-block font-14 text-white">منو</span>
            </button>
            <div class="offcanvas offcanvas-start" tabindex="-1" id="panelSideCanvas">
                <div class="offcanvas-header">
                    <h5 class="offcanvas-title">منو پنل</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
                </div>
                <div class="offcanvas-body">
                    <div class="panel-side">
                        <div class="content-box pb-0">
                            <div class="container-fluid">
                                <?php echo $__env->make('panel._sidebar', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="dashboard-panel">
            <div class="row gy-3">

                <div class="col-lg-3 d-lg-block d-none">
                    <div class="panel-side">
                        <div class="content-box pb-0">
                            <div class="container-fluid">
                                <?php echo $__env->make('panel._sidebar', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-lg-9">
                    <div class="content-box">
                        <div class="container-fluid">
                            <div class="title-panel mb-3 d-flex align-items-center justify-content-between flex-wrap gap-2">
                                <h6 class="font-16 mb-0">لغو سفارش <span dir="ltr"><?php echo e($order->order_number); ?></span></h6>
                                <a href="<?php echo e(route('panel.orders.show', $order)); ?>" class="btn btn-sm btn-outline-secondary rounded-3 font-12">
                                    بازگشت به جزئیات
                                </a>
                            </div>

                            <?php if($pending): ?>
                            <div class="alert alert-warning rounded-3 font-14">
                                درخواست لغو این سفارش در وضعیت <strong><?php echo e($pending->statusLabel()); ?></strong> است و در حال بررسی می‌باشد.
                            </div>
                            <?php elseif($error): ?>
                            <div class="alert alert-danger rounded-3 font-14 mb-0">
                                <?php echo e($error); ?>

                            </div>
                            <?php else: ?>
                                <?php if($errors->any()): ?>
                                <div class="alert alert-danger rounded-3 font-14">
                                    <ul class="mb-0 ps-3">
                                        <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $e): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <li><?php echo e($e); ?></li>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </ul>
                                </div>
                                <?php endif; ?>

                                <p class="text-muted font-13 mb-3">
                                    تاریخ سفارش: <strong><?php echo e($order->shamsi_date); ?></strong>
                                    — مبلغ: <strong><?php echo e(number_format($order->payable_amount)); ?> تومان</strong>
                                </p>

                                <form method="POST" action="<?php echo e(route('panel.orders.return.store', $order)); ?>" novalidate>
                                    <?php echo csrf_field(); ?>

                                    <div class="mb-3">
                                        <label class="form-label font-14" for="cancelReason">دلیل لغو سفارش <span class="text-danger">*</span></label>
                                        <select name="reason" id="cancelReason"
                                                class="form-select <?php $__errorArgs = ['reason'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                                            <option value="">انتخاب کنید...</option>
                                            <?php $__currentLoopData = $reasons; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $code => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($code); ?>" <?php if(old('reason') === $code): echo 'selected'; endif; ?>><?php echo e($label); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                        <?php $__errorArgs = ['reason'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <div class="invalid-feedback d-block"><?php echo e($message); ?></div>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                    </div>

                                    <div class="mb-4">
                                        <label class="form-label font-14" for="cancelDescription">توضیحات <span class="text-danger">*</span></label>
                                        <textarea name="description" id="cancelDescription" rows="5"
                                                  class="form-control <?php $__errorArgs = ['description'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                                  placeholder="لطفاً توضیحات خود را بنویسید..."><?php echo e(old('description')); ?></textarea>
                                        <?php $__errorArgs = ['description'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <div class="invalid-feedback d-block"><?php echo e($message); ?></div>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                    </div>

                                    <button type="submit" class="btn btn-secondary rounded-3 px-4">
                                        ثبت درخواست لغو
                                    </button>
                                </form>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>

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

<?php echo $__env->make('site.layouts.site-layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/louishop/public_html/engine/resources/views/panel/orders/return.blade.php ENDPATH**/ ?>