

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

<div class="card">
   <div class="card-header d-flex justify-content-between align-items-center">
       <h5 class="mb-0">All Orders</h5>
       
   </div>

   <div class="card-body">
       <!-- Filter Form -->
       <form method="GET" class="row g-2 mb-3">
           <div class="col-md-4">
               <input type="text" name="search" class="form-control"
                  value="<?php echo e(request('search')); ?>" placeholder="Search">
           </div>
           <div class="col-md-4">
               <select name="category" class="form-control">
                   <option value="">All Categories</option>
                   <option value="delevered">Delevered</option>
                   <option value="cancle">Cancle</option>
                   <option value="pending">Pending</option>
                
               </select>
           </div>
           
           <div class="col-md-4">
               <button class="btn btn-secondary w-100">Filter</button>
           </div>
       </form>

       <!-- Products Table -->
       <div class="table-responsive">
           <table class="table table-bordered align-middle">
               <thead class="table-light">
                   <tr>
                       <th width="30"><input type="checkbox" class="check-all"></th>
                       <th>Name</th>
                       <th>Shipping Address</th>
                       <th>Price</th>
                       <th>Payment Status</th>
                       <th>Payment type</th>
                       <th>Status</th>
                       <th>Order Date</th>
                       <th class="text-end">Action</th>
                   </tr>
               </thead>
               <tbody>
                   <?php $__currentLoopData = $allorder; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $Order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                   <tr>
                       <td><input type="checkbox" class="check-one" value="<?php echo e($Order->id); ?>"></td>
                       
                       <td>
                           <strong><?php echo e($Order->user->first_name); ?> <?php echo e($Order->user->last_name); ?></strong><br>
                       </td>

                       <td>
                           <strong> <?php echo e($Order->shipping_address['name'] ?? ''); ?></strong><br>
                           <small class="text-muted">email: <?php echo e($Order->shipping_address['email'] ?? ''); ?></small>
                           <br>
                           <small class="text-muted">address: <?php echo e($Order->shipping_address['address'] ?? ''); ?></small>
                           <br>
                           <small class="text-muted"> <?php echo e($Order->shipping_address['city'] ?? ''); ?>

                            <?php echo e($Order->shipping_address['state'] ?? ''); ?>

                            <?php echo e($Order->shipping_address['country'] ?? ''); ?>

                           </small>
                           <br>
                           <small class="text-muted">Phone: <?php echo e($Order->shipping_address['phone']); ?></small>
                       </td>

                       <td>Rs <?php echo e(number_format($Order->grand_total, 2)); ?></td>

                       <td>
                           <strong><?php echo e($Order->payment_status); ?></strong>
                       </td>

                       <td>
                           <strong><?php echo e($Order->payment_type); ?></strong>
                       </td>

                       
                       <td>
                           <?php if($Order->delivery_status == 'delivered'): ?>
                                 <span class="badge bg-success">Delivered</span>

                           <?php elseif($Order->delivery_status == 'cancelled'): ?>
                                 <span class="badge bg-danger">Cancelled</span>

                           <?php else: ?>
                                 <span class="badge bg-warning">Pending</span>
                           <?php endif; ?>
                        
                      </td>

                       <td>
                           <strong><?php echo e(\Carbon\Carbon::createFromTimestamp($Order->date)->format('d M Y h:i A')); ?></strong><br>
                       </td>

                       
                       <td class="text-end">
                          <a href="<?php echo e(route('admin.Order.detail', $Order->id)); ?>" class="btn btn-sm btn-outline-primary rounded-pill px-3">
                             <i class="las la-eye"></i> Detail
                         </a>

                         <a href="#" class="btn btn-sm btn-outline-success rounded-pill px-3 ms-1">
                            <i class="las la-check-circle"></i> Make Delivered
                         </a>
                        </td>
                   </tr>
                   <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
               </tbody>
           </table>
       </div>

       <!-- Pagination -->
       <div class="mt-3">
           <?php echo e($allorder->links()); ?>

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

<?php $__env->startPush('script'); ?>

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

<?php echo $__env->make('Admin.layout.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\wamp64\www\ecommerce\resources\views/admin/partials/order/allorder.blade.php ENDPATH**/ ?>