  @php($label_list = EF::getWhiteLabel())
  <div class ="row">

<div class="col-md-4 col-sm-12">
<div class="card" style="height:433px;">
 <div class="card-header">
   <div class="card-title">
     <strong>Customer Information </strong>
   </div>

   @php($user_data = [])
   @php(
   $user_data = array(
   'user_id'              => Crypt::encrypt($user->id),
   'full_name'            => $user->name,
   'father_name'          => $user->fname,
   'dob'                  => str_replace('1970-01-01','',date('Y-m-d',strtotime($user->dob))),
   'cnic'                 => ($user->cnic),
   'email'                => $user->email,
   'passport'             => $user->passport,
   'other_contact'        => $user->other_contact,


   'contact'              => $user->contact,
   'relation'             => $user->relation,
   'gender'               => $user->gender,
   'nationality'          => $user->nationality,
   'occupation'           => $user->occupation,
   'temporary_address'    => $user->temp_address,
   'permanent_address'    => $user->per_address,
   'user_image'           => $user->dp,
   'branch'               => trim($user->branch->code.' '.$user->branch->name),
   )
   )
@if(Auth::user()->hasAnyPermission(['All','Update Customer']))
   <div class="card-options">
    <a href="#" class="btn btn-sm btn-primary ml-2" onclick="update(event,'{{json_encode($user_data)}}','form_update_customer','md_update_customer')"> Edit </a>
  </div>
  @endif


</div>
<div class ="card-body cls-clear-padding">
    <br>

  <div class = "row">
    <div class="col-md-4 col-sm-4 col-xs-4 col-lg-4">

    </div>
    <div class="col-md-4 col-sm-4 col-xs-4 col-lg-4">
    <center> <img class="rounded image_padding img-fluid " src="{{EF::getFile($user->dp)}}" width="75%" alt="Customer Image"> </center>

   </div>



   <div class="col-md-4 col-sm-4 col-xs-4 col-lg-4">

   </div>

 </div>

<br>
 <div class="row">
  <div class="col-md-5 cls_alignment col-sm-6">
    <label class="  form-label">Name: </label>
  </div>
  <div class="col-md-7 cls_alignment col-sm-6">
    {{ucfirst($user->name)}}
  </div>
</div>
<div class="cls_border-bottom"> </div>
<div class="row">
  <div class="col-md-5 cls_alignment  col-sm-6">
    <label class=" form-label">Father Name: </label>
  </div>
  <div class="col-md-7 cls_alignment col-sm-6">
    {{ucfirst($user->fname)}}
  </div>
</div>
<div class="cls_border-bottom"> </div>
<div class="row">
  <div class="col-md-5 cls_alignment  col-sm-6">
    <label class=" form-label">CNIC: </label>
  </div>
  <div class="col-md-7 cls_alignment col-sm-6">
    {{ucfirst($user->cnic)}}
  </div>
</div>

<div class="cls_border-bottom"> </div>
<div class="row">
  <div class="col-md-5 cls_alignment col-sm-6">
    <label class="form-label">Contact No: </label>
  </div>
  <div class="col-md-7  cls_alignment col-sm-6">
    {{$user->contact}}
  </div>
</div>

<div class="cls_border-bottom"> </div>
<div class="row">
  <div class="col-md-5 cls_alignment col-sm-6">
    <label class="form-label">Email: </label>
  </div>
  <div class="col-md-7 cls_alignment col-sm-6">
    {{$user->email}}
  </div>
</div>
<div class="cls_border-bottom"> </div>
<div class="row">
  <div class="col-md-5  cls_alignment col-sm-6">
    <label class="form-label" >Address: </label>
  </div>
  <div class="col-md-7 cls_alignment col-sm-6">
   {{ $user->temp_address}}
 </div>
</div>

</div>

<div class="card-status  card-status-left bg-blue">
</div>

</div>
</div>
  <div class="col-md-4 col-sm-12">
   <div class="card">
     <div class="card-header">
       <div class="card-title">
         <strong>Booking Information </strong>
       </div>
         @if(Auth::user()->hasAnyPermission(['All','Update Booking']))
       <div class="card-options">
        <a data-toggle="modal" data-target="#md_update_booking" href="#" class="btn btn-sm btn-primary ml-2"> Edit </a>
      </div>
      @endif
    </div>
    <div class ="card-body cls-clear-padding">
     <div class="cls_border-bottom"> </div>
     <div class="row">

      <div class="col-md-5 cls_alignment col-sm-6">
        <label class="form-label">Booking Details: </label>
      </div>
      <div class="col-md-7 cls_alignment col-sm-6">

       {{EF::showPlotFormat($plot)}}

     </div>
   </div>
   <div class="cls_border-bottom"> </div>
   <div class="row">
    <div class="col-md-5 cls_alignment col-sm-6">
      <label class="form-label">Category: </label>
    </div>
    <div class="col-md-7  cls_alignment col-sm-6">
     {{$plot->category}}
   </div>
 </div>

 <div class="cls_border-bottom"> </div>
 <div class="row">
  <div class="col-md-5  cls_alignment col-sm-6">
    <label class="form-label">{{ucwords(str_replace('_',' ',$label_list['total_amount']))}}: </label>
  </div>
  <div class="col-md-7  cls_alignment col-sm-6">
    {{EF::numberFormat($booking->rate_per_marla)}}
  </div>
</div>

<div class="cls_border-bottom"> </div>
<div class="row">
  <div class="col-md-5 cls_alignment col-sm-6">
    <label class="form-label">{{ucwords(str_replace('_',' ',$label_list['discount']))}}: </label>
  </div>
  <div class="col-md-7  cls_alignment col-sm-6">
   {{EF::numberFormat($booking->discount)}}
 </div>
</div>
<div class="cls_border-bottom"> </div>
<div class="row">
  <div class="col-md-5 cls_alignment col-sm-6">
    <label class="form-label" >{{ucwords(str_replace('_',' ',$label_list['feature_charges']))}}: </label>
  </div>
  <div class="col-md-7 cls_alignment col-sm-6">
    {{EF::numberFormat($booking->feature_charges)}}
  </div>
</div>
<div class="cls_border-bottom"> </div>
<div class="row">
  <div class="col-md-5  cls_alignment col-sm-6">
    <label class="form-label" >{{ucwords(str_replace('_',' ',$label_list['agreed_amount']))}}: </label>
  </div>
  <div class="col-md-7  cls_alignment col-sm-6">
    <span class="badge badge-primary">
     {{EF::numberFormat($booking->agreed_amount)}}
   </span>
 </div>
</div>
<div class="cls_border-bottom"> </div>
@php($balance_detail = $booking->getBalanceDetail($booking->id))

<div class="row">
  <div class="col-md-5  cls_alignment col-sm-6">
    <label class="form-label" >Received Amount: </label>
  </div>
  <div class="col-md-7  cls_alignment col-sm-6 ">
    <span class="badge badge-success"> {{EF::numberFormat($balance_detail['debit'])}}
    </span>
  </div>
</div>
<div class="cls_border-bottom"> </div>

<div class="row">
  <div class="col-md-5  cls_alignment col-sm-6">
    <label class="form-label" >Balance Amount: </label>
  </div>
  <div class="col-md-7  cls_alignment col-sm-6">
    <span class="badge badge-danger">
     {{EF::numberFormat($balance_detail['credit'])}}
   </span>
 </div>
</div>
<div class="cls_border-bottom"> </div>
<div class="row">
  <div class="col-md-5  cls_alignment col-sm-6">
    <label class="form-label" >{{ucwords(str_replace('_',' ',$label_list['booking_date']))}}: </label>
  </div>
  <div class="col-md-7 cls_alignment  col-sm-6">
   {{EF::dateFormat($booking->created_at)}}
 </div>
</div>
<div class="cls_border-bottom"> </div>
</div>

<div class="card-status  card-status-left bg-blue">
</div>
</div>
</div>
<div class="col-md-4 col-sm-12">
<div class="card " style="height:433px;">
 <div class="card-header">
   <div class="card-title" >
     <strong> Payment Receipts </strong>
   </div>



 </div>
 <div class ="card-body cls-clear-padding">
   <div class="cls_border-bottom"> </div>
   <table class="table table-hover table-outline table-vcenter text-nowrap card-table">
    <thead>
      <tr>

        <th>Sr #</th>
        <th>Description</th>
        <th>Amount</th>
        <th>Action</th>

      </tr>
    </thead>
    <tbody>
     @foreach($payment_list as $rows)
     <tr>
      <td>{{$loop->iteration}} </td>
      @if($rows->installment_id > 0)
      <td>{{$rows->installment->description}} </td>

      @elseif($rows->commission_id > 0)
      <td>{{$rows->commission->description}} </td>

      @else
      <td>{{$rows->description}} </td>

      @endif
      <td>{{EF::numberFormat($rows->amount)}} </td>
      <td>     <a target="_blank"  href="{{route('document.paymentreceipt',['id' => Crypt::encrypt($rows->id)])}}"><i class="dropdown-icon fa fa-print "></i>View</a>   </td>

    </tr>
    @endforeach
  </tbody>
</table>





</div>

<div class="card-status  card-status-left bg-blue">
</div>

</div>
</div>
</div>
