@extends('frontend.layout.app')

@section('content')

<section class="pt-4 mb-4">
    <div class="container">
        <div class="row">
            <div class="col-lg-3 text-center ">
                <h1 class="fw-600 h4">Home/My Orders</h1>
            </div>
            <div class="col-lg-9">
                <ul class="breadcrumb bg-transparent p-0 justify-content-center justify-content-lg-end">
                    <li class="breadcrumb-item opacity-50">
                        <a class="text-reset" href="{{ route('home') }}">Home</a>
                    </li>
                    <li class="text-dark fw-600 breadcrumb-item">
                        <a class="text-reset" href="">My Returns</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</section>


<div class="py-3 py-md-5 bg-light">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <div class="shopping-cart">

                        <div class="cart-header d-none d-sm-none d-mb-block d-lg-block">
                            <div class="row">
                                <div class="col-md-4">
                                    <h4 style="font-weight: bold">Products</h4>
                                </div>
                                <div class="col-md-2">
                                    <h4 style="font-weight: bold">Price</h4>
                                </div>
                                <div class="col-md-2">
                                    <h4 style="font-weight: bold">Order Date</h4>
                                </div>
                                <div class="col-md-2">
                                    <h4 style="font-weight: bold"> Status</h4>
                                </div>
                                <div class="col-md-2">
                                    <h4 style="font-weight: bold">Shipping Type</h4>
                                </div>
                            </div>
                        </div>
                       
                       @forelse($myorders as $key => $order)
                       @php
                           $product = \App\Models\Product::find($order['product_id']);
                       @endphp
                       <div class="cart-item borderlist">
                            <div class="row">
                                <div class="col-md-4 my-auto">
                                <a href="">
                                        <label class="product-name">
                                            <img src="{{ asset('/storage/'.$product->thumbnail_img) }}" style="width: 50px; height: 50px" alt="">
                                            {{ $product->name }}
                                        </label>
                                    </a>
                                </div>
                                <div class="col-md-2 my-auto">
                                <label class="price">Rs:{{ number_format($order['price'],2) }}/-  </label>
                                </div>
                                <div class="col-md-2 col-4 my-auto">
                                <label class="Date">{{date('d-m-Y', strtotime($order['created_at'])) }}  </label>
                                </div>
                                <div class="col-md-2 col-4 my-auto">
                                 <label class="price">{{ $order['delivery_status'] }}  </label>
                                </div>
                                <div class="col-md-2 col-4 my-auto">
                                <label class="price">{{ $order['shipping_type'] }}  </label>
                                </div>
                             </div>
                        </div>        
                       
                        @empty
                        <div class="cart-item borderlist">
                            <div class="row">
                                <div class="col-md-12 my-auto" style="text-align: center;">
                                  <span >No Record Found</span>     
                                 </div>
                            </div>
                        </div>
                        @endforelse
                        
                        
                    </div>
                   
                    
                </div>
            </div> 
        </div>
</div>
@endsection