<?php $__env->startSection('page_title'); ?>
View Booking
<?php $__env->stopSection(); ?>


<?php $__env->startSection('page_body'); ?>

<?php echo e(Breadcrumbs::render('booking_detail',Crypt::encrypt($booking->id),(EF::showPlotFormat($plot)))); ?>


<?php if($booking->status == 'Unapprove'): ?>
 <?php echo $__env->make('booking.approve_booking', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

 <?php else: ?>

<?php ($label_list = EF::getWhiteLabel()); ?>
<div class="row">
  <div class="col-md-4 col-sm-12 " >
   <div class="card">
     <div class="card-header">
       <div class="card-title">
         <strong>Booking Information </strong>
       </div>
         <?php 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>
      <?php 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">

       <?php echo e(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"><?php echo e(ucwords(str_replace('_',' ',$label_list['total_amount']))); ?>: </label>
  </div>
  <div class="col-md-7  cls_alignment col-sm-6">
    <?php echo e(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"><?php echo e(ucwords(str_replace('_',' ',$label_list['size']))); ?>: </label>
  </div>
  <div class="col-md-7  cls_alignment col-sm-6">
    <?php echo e($booking->plot->size); ?>

  </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"><?php echo e(ucwords(str_replace('_',' ',$label_list['discount']))); ?>: </label>
  </div>
  <div class="col-md-7  cls_alignment col-sm-6">
   <?php echo e(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" ><?php echo e(ucwords(str_replace('_',' ',$label_list['feature_charges']))); ?>: </label>
  </div>
  <div class="col-md-7 cls_alignment col-sm-6">
    <?php echo e(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" ><?php echo e(ucwords(str_replace('_',' ',$label_list['agreed_amount']))); ?>: </label>
  </div>
  <div class="col-md-7  cls_alignment col-sm-6">
    <span class="badge badge-primary badge-bolder">
     <?php echo e(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 badge-bolder"> <?php echo e(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 badge-bolder">
     <?php echo e(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" ><?php echo e(ucwords(str_replace('_',' ',$label_list['booking_date']))); ?>: </label>
  </div>
  <div class="col-md-7 cls_alignment  col-sm-6">
   <?php echo e(EF::dateFormat($booking->created_at)); ?>

 </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" ><?php echo e(ucwords(str_replace('_',' ',$label_list['approve_date']))); ?>: </label>
  </div>
  <div class="col-md-7 cls_alignment  col-sm-6">
   <?php echo e(EF::dateFormat($booking->approve_date)); ?>

 </div>
</div>

<div class="cls_border-bottom"> </div>
</div>

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

</div>

<div class="card" >
 <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,
   '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),
   )
   ); ?>
 <?php if(Auth::user()->hasAnyPermission(['All','Update Customer'])): ?>
   <div class="card-options">
    <a href="#" class="btn btn-sm btn-primary ml-2" onclick="update(event,'<?php echo e(json_encode($user_data)); ?>','form_update_customer','md_update_customer')"> Edit </a>
  </div>
  <?php 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="<?php echo e(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">
    <?php echo e(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"><?php echo e($user->relation); ?>: </label>
  </div>
  <div class="col-md-7 cls_alignment col-sm-6">
    <?php echo e(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">Contact No: </label>
  </div>
  <div class="col-md-7  cls_alignment col-sm-6">
    <?php echo e($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">
    <?php echo e(EF::filterEmail($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 pr-4" >
   <?php echo e(($user->temp_address)); ?>

 </div>
</div>
<div class="cls_border-bottom"> </div>
</div>

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

</div>


<?php if(Auth::user()->hasAnyPermission(['All','View Booking Receipts'])): ?>
<div class="card " >
 <div class="card-header" style ="padding:1.3rem;">
   <div class="card-title" >
     <strong> Payment Receipts </strong>
   </div>



 </div>
 <div class ="card-body cls-clear-padding table-responsive">
   <div class="cls_border-bottom"> </div>

   <table class="table table-hover table-outline  table-vcenter text-nowrap card-table " id = "payment_receipts" style = "overflow-y: auto;">
    <thead>
      <tr>

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

      </tr>
    </thead>
    <tbody style = "  max-height:400px; overflow-y:auto;" >
     <?php $__currentLoopData = $payment_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php if($rows->status === "Reject"): ?>
          <tr style="background-color:#ffd2d2">
        <?php elseif($rows->status === "Approve"): ?>
          <tr style="background-color:#dcffb8">
        <?php else: ?>
          <tr style="background-color:#fdf7bf">
        <?php endif; ?>
   <!--    <td><?php echo e($loop->iteration); ?> </td> -->
      <?php if($rows->installment_id > 0): ?>
            <td><?php echo e($rows->installment->description); ?> </td>
      <?php elseif($rows->commission_id > 0): ?>
      <td><?php echo e($rows->commission->description); ?> </td>
      <?php else: ?>
      <td><?php echo e($rows->description); ?> </td>
      <?php endif; ?>


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

    </tr>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  </tbody>
</table>






</div>

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

</div>
<?php endif; ?>
</div>


<div class = "col-md-8 col-sm-12">
  <div class = "row">

    <?php echo $__env->make('installment.manage_installment', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>


    <?php echo $__env->make('commission.manage_commission', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>


    <?php echo $__env->make('booking.transfer_amount', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

    <?php echo $__env->make('payments.pending_payments', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

    <div id="modal_add_payment"> </div>
    <div id="modal_update_payment"> </div>

    <?php echo $__env->make('user.manage_nominee', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

    <?php echo $__env->make('booking.manage_document', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

  </div>
</div>

</div>
<?php endif; ?>

<?php $__env->stopSection(); ?>


<?php $__env->startSection('page_modal'); ?>
  <?php echo $__env->make('user.modals.add_nominee', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('user.modals.update_nominee', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('commission.modals.add_commission', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('commission.modals.update_commission', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('installment.modals.make_installment', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('installment.modals.update_installment', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('installment.modals.interval_installment', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php if(sizeof($installment_list) > 0): ?>
    <?php if($booking->installment_mode != 'One Time'): ?>
      <?php echo $__env->make('installment.modals.update_installment_mode', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php endif; ?>
  <?php endif; ?>

  <?php echo $__env->make('user.modals.add_dealer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('user.modals.add_employee', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('user.modals.update_customer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('booking.modals.update_booking', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('booking.modals.upload_booking_document', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
      <div id="modal_add_payment"> </div>
      <div id="modal_update_payment"> </div>
      <div id="modal_payment_voucher"> </div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_script'); ?>
<?php echo $__env->make('scripts.booking', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('scripts.payment', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>


<?php echo $__env->make('scripts.commission', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('scripts.user', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<?php echo $__env->make('scripts.onetime', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('scripts.installment', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('scripts.account', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>


<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/ubuntu/rebmgisplus/skylite/resources/views/booking/view_booking.blade.php ENDPATH**/ ?>