<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('frontend.template-1.breadcrumb.breadcrumb', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    <div class="dashboard-section pt-120">
        <img alt="image" src="<?php echo e(asset('frontend/images/bg/section-bg.png')); ?>" class="img-fluid section-bg-top">
        <img alt="image" src="<?php echo e(asset('frontend/images/bg/section-bg.png')); ?>" class="img-fluid section-bg-bottom">
        <div class="container">
            <div class="row g-4">
                <div class="col-lg-3">
                    <?php echo $__env->make('frontend.template-1.customer.sidenav', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                </div>
                <div class="col-lg-9">
                    <!-- table title-->
                    <div class="table-title-area">
                        <h3><?php echo e($title ?? ''); ?></h3>
                        <form action="" method="get">
                            <select id="order-category" name="filter" onchange="this.form.submit()">
                                <option value="5"><?php echo e(translate('Show: Last 05 Order')); ?></option>
                                <option value="10"><?php echo e(translate('Show: Last 10 Order')); ?></option>
                                <option value="15"><?php echo e(translate('Show: Last 15 Order')); ?></option>
                                <option value="20"><?php echo e(translate('Show: Last 20 Order')); ?></option>
                            </select>
                        </form>
                    </div>

                    <!-- table -->
                    <div class="table-wrapper">
                        <table class="eg-table order-table table mb-0">
                            <thead>
                                <tr>
                                    <th><?php echo e(translate('Order ID')); ?></th>
                                    <th><?php echo e(translate('Product Name')); ?></th>
                                    <th><?php echo e(translate('Quantity')); ?></th>
                                    <th><?php echo e(translate('Price')); ?></th>
                                    <th><?php echo e(translate('Order Date')); ?></th>
                                    <th><?php echo e(translate('Status')); ?></th>
                                    <th><?php echo e(translate('Action')); ?></th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php if($purchases->count() > 0): ?>
                                    <?php $__currentLoopData = $purchases; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $purchase): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <td data-label="Order ID"><?php echo e($purchase->id); ?></td>
                                            <td data-label="Product Name"><?php echo e($purchase->products->getTranslation('name')); ?>

                                            </td>
                                            <td data-label="Quantity"><?php echo e($purchase->quantity); ?></td>
                                            <td data-label="Price"><?php echo e(currency_symbol() . $purchase->amount); ?></td>
                                            <td data-label="Order Date"><?php echo e(dateFormat($purchase->created_at)); ?></td>
                                            <td data-label="Status">
                                                <span
                                                    class="<?php if($purchase->status == 1): ?> text-primary <?php elseif($purchase->status == 3 || $purchase->status == 7): ?> text-red <?php elseif($purchase->status == 4 || $purchase->status == 6): ?> text-green <?php elseif($purchase->status == 5): ?> text-warning <?php endif; ?>">
                                                    <?php if($purchase->status == 1): ?>
                                                        <?php echo e(translate('Processing')); ?>

                                                    <?php elseif($purchase->status == 3): ?>
                                                        <?php echo e(translate('Cancelled')); ?>

                                                    <?php elseif($purchase->status == 4): ?>
                                                        <?php echo e(translate('Completed')); ?>

                                                    <?php elseif($purchase->status == 5): ?>
                                                        <?php echo e(translate('On hold')); ?>

                                                    <?php elseif($purchase->status == 6): ?>
                                                        <?php echo e(translate('Delivered')); ?>

                                                    <?php elseif($purchase->status == 7): ?>
                                                        <?php echo e(translate('Refunded')); ?>

                                                    <?php endif; ?>
                                                </span>
                                            </td>
                                            <td data-label="Action">
                                                <button
                                                    class="eg-btn action-btn <?php if($purchase->status == 1): ?> blue <?php elseif($purchase->status == 4 || $purchase->status == 6): ?> green <?php elseif($purchase->status == 3 || $purchase->status == 7): ?> red <?php elseif($purchase->status == 5): ?> orange <?php endif; ?>"><a
                                                        href="<?php echo e(route('customer.order.details', $purchase->id)); ?>"><img
                                                            alt="image"
                                                            src="<?php echo e(asset('frontend/images/icons/aiction-icon.svg')); ?>"></a></button>
                                            </td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php else: ?>
                                    <tr>
                                        <td colspan="6">
                                            <h5 class="data-not-found"><?php echo e(translate('No Data Found')); ?></h5>
                                        </td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>

                    <!-- pagination area -->
                    <div class="table-pagination">
                        <p> <?php echo e(translate('Showing')); ?> <?php echo e($purchases->firstItem()); ?> to <?php echo e($purchases->lastItem()); ?>

                            <?php echo e(translate('of total')); ?>

                            <?php echo e($purchases->total()); ?> <?php echo e(translate('entries')); ?></p>
                        <?php echo $purchases->links('vendor.pagination.custom'); ?>

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

<?php echo $__env->make('frontend.template-1.partials.master', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\ServBay\www\bidout-application\resources\views/frontend/template-1/customer/purchase.blade.php ENDPATH**/ ?>