@extends('backend.layouts.master')

@section('title','Lead Information')

@section('main-content')
<div class="card">
<h5 class="card-header">Leads Information Page
   <div class="float-right">
   <a href="{{route('leads.index')}}" class="btn btn-primary btn-sm float-left mr-1" style="height:30px; width:30px;border-radius:50%" data-toggle="tooltip" title="Go Back" data-placement="bottom"><i class="fas fa-arrow-left"></i></a>
   </div>
  </h5>
  <div class="card-body">
  @if($lead)
  
    <section class="confirmation_part section_padding">
      <div class="order_boxes">
        <div class="row">
          <div class="col-lg-12 col-lx-12">
            <div class="shipping-info">
              <h4 class="text-center pb-4">Lead Information</h4>
              <table class="table">
                    <tr class="">
                        <td>Name</td>
                        <td> : {{$lead->name}}</td>
                    </tr>
                    <tr class="">
                        <td>Email</td>
                        <td> : {{ $lead->email }}</td>
                    </tr>
                    <tr class="">
                        <td>Phone</td>
                        <td> : {{ $lead->phone }}</td>
                    </tr>
                    <tr class="">
                        <td>IP Address</td>
                        <td> : {{ $lead->ip }}</td>
                    </tr>
                    <tr class="">
                        <td>City</td>
                        <td> : {{ $lead->city }}</td>
                    </tr>
                    <tr>
                        <td>Region</td>
                        <td> : {{ $lead->region }}</td>
                    </tr>
                    <tr>
                        <td>Country</td>
                        <td> : {{ $lead->country }}</td>
                    </tr>
                    <tr>
                        <td>URL</td>
                        <td> : {{ $lead->url }}</td>
                    </tr>
                    <tr>
                        <td>Created At</td>
                        <td> : {{ date('d M Y', strtotime($lead->created_at)) }}</td>
                    </tr>
              </table>
            </div>
          </div>
        </div>
      </div>
    </section>

    @if (count($lead->leadData) > 0)
      <div class="shipping-info">
        <h4 class="text-center p-4">Lead Data</h4>
        <table class="table table-striped table-hover">
          <tbody>
          @foreach ($lead->leadData as $data)
            <tr>
                <td>{{$data->id}}</td>
                <td>{{$data->lead_key}}</td>
                <td>{{$data->lead_value}}</td>
            </tr>
          @endforeach
          </tbody>
        </table>
      </div>
    @endif

  @endif

  </div>
</div>
@endsection

@push('styles')
<style>
    .order-info,.shipping-info{
        background:#ECECEC;
        padding:20px;
    }
    .order-info h4,.shipping-info h4{
        text-decoration: underline;
    }

</style>
@endpush
