
<?php $__env->startSection('title', 'Home'); ?>


<?php $__env->startSection('content'); ?>
<div class="container">
    <div class="row">
        <div class="col-md-4">
          <ul class="list-group">
            <li class="list-group-item"><a href="<?php echo e(route('home')); ?>">My Orders</a></li>
          </ul>
        </div>
        <div class="col-md-8">
          <div class="row">
            <div class="col-xl-12 col-lg-12">
              <div class="card shadow mb-4">
                <!-- Card Header - Dropdown -->
                <div class="card-body">
                  <div class=" pb-2">
                    <div class="inner-bg table-responsive">
                      <div class="element-title mb-2">
                        <h4 class="mb-4">All Orders</h4>
                      </div>
                      <table class="cart-table table border" width="100%">
                        <thead>
                          <tr>
                            <th>Order ID </th>
                            <th>Amount</th>
                            <th>Status</th>
                            <th>Action</th>
                          </tr>
                        </thead>
                        <tbody>
                          <?php if(auth()->user()->orders->count() > 0): ?>
                          <?php $__currentLoopData = auth()->user()->orders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                          <tr>
                            <td><?php echo e("CH00".$order->id); ?></td>
                            <td><?php echo e($order->amount); ?></td>
                            <td><span class="<?php if($order->status == 'FAILED' || $order->status == 'CANCELLED'): ?> failed <?php elseif($order->status == 'PAID'): ?> paid <?php elseif($order->status == 'COD' || $order->status == 'UNPAID'): ?> pending <?php endif; ?>"><?php echo e($order->status); ?></span></td>
                            <td>
                              <form method="POST" action="<?php echo e(route('order.cancel', $order)); ?>">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('put'); ?>
                                <button class="btn btn-danger btn-sm">Cancel</button>
                              </form>
                            </td>
                          </tr>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          <?php else: ?>
                          <tr>
                            <td colspan="4">No Orders</td>
                          </tr>
                          <?php endif; ?>
                        </tbody>
                      </table>
                    </div>
                  </div>
                </div>
                <!-- Area -->
              </div>
            </div>
          </div>          
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\chittar\resources\views/home.blade.php ENDPATH**/ ?>