Current File : //home/tradevaly/public_html/resources/views/user/pages/order/cancel.blade.php
@extends('user.ayaan.master')
@push('title','Cancel Orders')
@push('style')
    
@endpush

@section('content')
<div class="container-fluid">
  <div class="row">
    <div class="col-md-12">
      <div class="card">
        <div class="card-header card-header-info card-header-icon">
          <h4 class="card-title">Cancel Orders</h4>
        </div>
        <div class="card-body">
          <div class="table-responsive">
            <table class="table">
              <thead>
                <tr>
                  <th class="text-center">#</th>
                  <th>Order Number</th>
                  <th>Quantity</th>
                  <th>Total Amount</th>
                  <th>Status</th>
                  <th>Payment Type</th>
                  <th>Payment Status</th>
                  <th>Order Date</th>
                </tr>
              </thead>
              <tbody>
                  @forelse($orders as $order)
                    <tr>
                        <td>{{$loop->iteration}}</td>
                        <td>
                            <a href="{{route('user.order.view',$order->order_id)}}">{{$order->order_id}}</a>
                        </td>
                        <td>{{App\Models\OrderItem::where('order_id',$order->order_id)->where('vendor_id',auth()->id())->sum('quantity')}}</td>
                        <td>{{$order->total_amount - $order->total_discount}}</td>
                        <td>
                            @if($order->orderItem->status == "new")
                            <p class="bg-primary rounded-pill text-center text-white" style="width: 100px;" >{{$order->orderItem->status}}</p>
                            @elseif($order->orderItem->status == "pending")
                            <p class="bg-warning rounded-pill text-center text-white" style="width: 100px;" >{{$order->orderItem->status}}</p>
                            @elseif($order->orderItem->status == "cancel")
                            <p class="bg-danger rounded-pill text-center text-white" style="width: 100px;" >{{$order->orderItem->status}}</p>
                            @elseif($order->orderItem->status == "delevered")
                            <p class="bg-success rounded-pill text-center text-white" style="width: 100px;" >Compleate</p>
                            @endif
                        </td>
                        <td >{{$order->order->payment_type}}</td>
                        <td >
                            @if($order->order->payment_status == "paid")
                            <p class="bg-success rounded-pill text-center text-white" style="width: 100px;" >{{$order->order->payment_status}}</p>
                            @elseif($order->order->payment_status == "returned" || $order->order->payment_status == "Failed")
                            <p class="bg-danger rounded-pill text-center text-white" style="width: 100px;" >{{$order->order->payment_status}}</p>
                            @else
                            <p class="bg-warning rounded-pill text-center text-white" style="width: 100px;" >{{$order->order->payment_status}}</p>
                            @endif
                        </td>
                        <td >{{$order->created_at->format('d-m-Y')}}</td>
                    </tr>
                 @empty
                    <tr>
                        <td colspan="6" style="text-align: center;"><strong class="text-danger">No Orders</strong></td>
                    </tr>
                 @endforelse
              </tbody>
            </table>
          </div>
        </div>
        <div class="card-footer">
            {{$orders->links()}}
        </div>
      </div>
  </div>
</div>
@stop

@push('script')
   
@endpush