@extends('layouts.app')
@section('content')
<div class="dashboard">
    <div class="admin-header">
        <div class="uk-grid">
            <div class="uk-width-1-1@m">
                <h1>{{$title}}</h1>
            </div>
        </div>
    </div>
</div>
<div class="uk-margin uk-width-1-1 uk-margin-auto uk-card uk-card-default uk-card-body small-padding">
    <div class="uk-text-center customer-dashboard">
        <h2>Latest Opportunities</h2>
        <p>No Buy or Sell Request to See</p>
        <div class="uk-margin">
            <a class="uk-button uk-button-primary buy-request-btn" href="{{url('create-buyer-request')}}"><i class="fa-regular fa-plus uk-margin-small-right"></i> Add Buy Request</a> <a class="uk-button uk-button-primary sell-request-btn" href="{{url('create-seller-request')}}"><i class="fa-regular fa-plus uk-margin-small-right"></i> Add Sell Request</a>
        </div>
    </div>    
    <hr>
    <p>Buy Request</p>
    <div class="uk-grid-match uk-grid-small uk-child-width-1-3@m" uk-grid>
        @if(isset($buyerRequest) && count($buyerRequest) > 0)
        @foreach($buyerRequest as $request)
        <div>
            <div class="buyer-request-card">
                <div class="uk-grid-small" uk-grid>
                    <div class="uk-width-1-1">
                        <p class="white-bg">ID <b>#B{{$loop->iteration}}</b></p>
                    </div>
                    <div class="uk-width-1-2">
                        <p>Province</p>
                        <h4>{{$request->province}}</h4>
                    </div>
                    <div class="uk-width-1-2">
                        <p>Location</p>
                        <h4>{{$request->location}}</h4>
                    </div>
                    <div class="uk-width-1-4">
                        <p>Beds</p>
                        <h4>{{$request->bedrooms}}</h4>
                    </div>
                    <div class="uk-width-1-4">
                        <p>Baths</p>
                        <h4>{{$request->bathrooms}}</h4>
                    </div>
                    <div class="uk-width-expand uk-text-left uk-text-center@xl">
                        <p>Type of House</p>
                        <h4>{{$request->type_of_house}}</h4>
                    </div>
                    <div class="uk-width-1-1">
                        <p>Price Range</p>
                    </div>
                    <div class="uk-width-1-2 uk-margin-remove">
                        <h4><span>Min</span> {{'$'.$request->min_price_range}}</p>
                    </div>
                    <div class="uk-width-1-2 uk-margin-remove">
                        <h4><span>Max</span> {{'$'.$request->max_price_range}}</p>
                    </div>
                </div>
            </div>
        </div>
        @endforeach
        @else
          <p>No request found.</p>
        @endif
    </div>
    <hr>
    <p>Sell Request</p>
    <div class="uk-grid-match uk-grid-small uk-child-width-1-3@m" uk-grid>
        @if(isset($sellerRequest) && count($sellerRequest) > 0)
        @foreach($sellerRequest as $request)
        <div>
            <div class="seller-request-card">
                <div class="uk-grid-small" uk-grid>
                    <div class="uk-width-1-1">
                        <p class="white-bg">ID <b>#S{{$loop->iteration}}</b></p>
                    </div>
                    <div class="uk-width-1-2">
                        <p>Province</p>
                        <h4>{{$request->province}}</h4>
                    </div>
                    <div class="uk-width-1-2">
                        <p>Location</p>
                        <h4>{{$request->location}}</h4>
                    </div>
                    <div class="uk-width-1-4">
                        <p>Beds</p>
                        <h4>{{$request->bedrooms}}</h4>
                    </div>
                    <div class="uk-width-1-4">
                        <p>Baths</p>
                        <h4>{{$request->bathrooms}}</h4>
                    </div>
                    <div class="uk-width-expand uk-text-left uk-text-center@xl">
                        <p>Type of House</p>
                        <h4>{{$request->type_of_house}}</h4>
                    </div>
                    <div class="uk-width-1-1">
                        <p>Price Range</p>
                    </div>
                    <div class="uk-width-1-2 uk-margin-remove">
                        <h4><span>Min</span> {{'$'.$request->min_price_range}}</p>
                    </div>
                    <div class="uk-width-1-2 uk-margin-remove">
                        <h4><span>Max</span> {{'$'.$request->max_price_range}}</p>
                    </div>
                </div>
            </div>
        </div>
        @endforeach
        @else
          <p>No request found.</p>
        @endif
    </div>
</div>    
@endsection