@extends('layout.main')
@section('content')

<style>
.previewImage{
    height: 150px;
    width: 110px;
    overflow:hidden;
    object-fit: contain;
}
</style>
<div class="row">
	<div class="col-md-12">
		<img src="{{asset('/images/logo.png')}}" class="" height="100px" />
	</div>
</div>
<hr>
<div class="row">
    <div class="col-md-12">
        <ol class="breadcrumb">
            <li><a href="{{url('/')}}">Home</a></li>
            <li class="active">My Cart</li>
        </ol>
    </div>
</div>

<div class="row">
    <div class="col-md-12">
        <h1>My Cart</h1>
        <hr>
    </div>
</div>

@if(count($row) > 0)

<div class="row">
    <div class="col-md-8">
       
        @foreach($row as $item)
              
            @if($item->Order == "Jersey")

                @define $itemOrder    = " (Jersey Only)"

            @elseif ($item->Order == "Shorts")

                @define $itemOrder = " (Shorts Only)"
            
            @else
          
                @define $itemOrder = " (w/ Shorts)"
            
            @endif
        
            <div style="border: 1px solid #e2e2e2; padding: 10px; margin-bottom: 10px;">
                <div class="row">
                    <div class="col-md-12">
                        <a class="btn btn-link pull-right" href="{{ url('removeitem') }}/{{ $item->Id }}"><span class="glyphicon glyphicon-remove"></span></a>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="table-responsive">
                            <table class="table">

                                <tr>
                                    <td rowspan="2" class="text-center"><img class="previewImage" src="http://{{ config('site_config.images_url')  }}/{{ $item->Image }} "></td>
                                    <td colspan="5">
                                        <h4>{{ $item->ProductName }} {{ $itemOrder }} <br>Price: ${{ $item->Price }}</h4>
                                    </td>
                                    <tr>
                                        <td >Name: <br> @if($item->Name != '') {{ $item->Name }} @else -- @endif </td>
                                        <td >Number : <br>{{ $item->Number }}</td>
                                        <td >Size: <br>{{ $item->Size }}</td>
                                        <td >Quantity: <br>{{ $item->Quantity }}</td>
                                    </tr>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        @endforeach
    </div>
   
    <div class="col-md-4" style="background-color: #f5f5f5;">
        <h4>Shipping</h4>
        <p>Ship to:</p>
        <p>{{ $array_address_book[0]->Fullname }}</p>
        <p>{{ $array_address_book[0]->Address }}, {{ $array_address_book[0]->State }}, {{ $array_address_book[0]->City }}, {{ $array_address_book[0]->ZipCode }}  <a href="{{ url('user') }}">[ Edit ]</a> </p>
        
        <hr> 
        <h3>Order Summary</h3>
        <hr class="hr-design">
        <h4 class="text-center">
            <b>Subtotal : </b> $ {{ $getSubtotal[0]->Subtotal }}
        </h4>
        <hr class="hr-design">
        <a href="{{ url('payment-method') }}" class="btn btn-primary btn-block" >Place Order</a><br>
        <br><br><br>
    </div>
</div>
@else
<div class="row">
    <div class="col-md-12">
        <h3 style="color:#d2d2d2;">Your cart is currently empty.</h3>
    </div>
</div>

@endif
@endsection
