<?php ($label_list = EF::getWhiteLabel()); ?>
<div class="modal fade" id="md_update_booking" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <?php echo e(Form::open(array('route' => 'booking.update', 'id' => 'form_update_booking', 'class' => 'cls_from'))); ?>

  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Edit Booking</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true"></span>
        </button>
      </div>
      <div class="modal-body">
       
        <div class="card">

           <div class="card-header">
               <div class = "col-md-5">
    <strong class="strong-margin">CUSTOMER DETAILS</strong>
     </div>
              <div class = "col-md-6">
               
   
     </div>
             <div class = "col-md-1">
           <img src = "<?php echo e(asset('assets/images/icons/userinformation.png')); ?>"/>
               
   
     </div>
           </div>
           <div class="card-body  form-fieldset">
            <div class = "row">
                   <div class="col-sm-6">
                       <label class="label-color"> CNIC: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*"><?php echo e($errors->first('customer_cnic',":message")); ?></small>
            <div class="input-group mb-3">
             
              <?php echo e(Form::Text('customer_cnic',$user->cnic, ['class' => 'form-control form-control-sm  cls_cnic', 'placeholder' => 'Customer Cnic #' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','readonly' => 'true'])); ?>

            </div>
          </div>

          <div class="col-sm-6">
               <label class="label-color"> Name: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
           
              <?php echo e(Form::Text('customer_name',$user->name, ['class' => 'form-control form-control-sm  ', 'placeholder' => 'Name' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'readonly' => 'true'])); ?>

            </div> 

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

        <div class="card">
           <div class="card-header">
              <div class = "col-md-5">
    <strong class="strong-margin">BOOKING DETAILS</strong>
     </div>
              <div class = "col-md-6">
               
   
     </div>
             <div class = "col-md-1">
           <img src = "<?php echo e(asset('assets/images/icons/booking.png')); ?>"/>
               
   
     </div>
             
           </div>
           <div class="card-body form-fieldset">
            <div class= "row">
                    <div class="col-sm-4">
                         <label class="label-color"> <?php echo e(ucwords(str_replace('_',' ',$label_list['file']))); ?> # <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value=""><?php echo e($errors->first($label_list['file'],":message")); ?></small>

            <div class="input-group mb-3">
            
              <?php echo e(Form::Text($label_list['file'],$booking->file_number, ['class' => 'form-control form-control-sm  cls_required', 'placeholder' => 'File # ' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'readonly'=> true])); ?>

            </div>    
          </div>
          
          <div class="col-sm-4">
               <label class="label-color"> <?php echo e(ucwords(str_replace('_',' ',$label_list['reference']))); ?> #</label>
            <small class="form-errors pull-right req" value=""><?php echo e($errors->first($label_list['reference'],":message")); ?></small>

            <div class="input-group mb-3">
           
              <?php echo e(Form::Text($label_list['reference'],$booking->reference_number, ['readonly' => 'true','class' => 'form-control form-control-sm  cls_required reference', 'placeholder' => 'Reference # ' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])); ?>

            </div>    
          </div>

          <div class="col-sm-4">
               <label class="label-color"> <?php echo e(ucwords(str_replace('_',' ',$label_list['booking_date']))); ?>: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*"><?php echo e($errors->first($label_list['booking_date'],":message")); ?></small>

            <div class="input-group mb-3">
             
              <?php echo e(Form::Date($label_list['booking_date'],date('Y-m-d',strtotime($booking->created_at)), ['class' => 'form-control form-control-sm  cls_date', 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])); ?>

            </div>    
          </div>

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

                <div class="card">
                 <div class="card-header">
                  <div class = "col-md-5">
    <strong class="strong-margin"><?php echo e(ucwords(str_replace('_',' ',$label_list['plot']))); ?> DETAILS</strong>
     </div>
              <div class = "col-md-6">
               
   
     </div>
             <div class = "col-md-1">
           <img src = "<?php echo e(asset('assets/images/icons/branchinformation.png')); ?>"/>
               
   
     </div>
                 </div>
                 <div class="card-body  form-fieldset">
                  <div class = "row">
                     <div class="col-sm-4">
              <label class="label-color"><?php echo e(ucwords(str_replace('_',' ',$label_list['branch']))); ?>: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*"><?php echo e($errors->first($label_list['branch'],":message")); ?></small>

            <div class="input-group mb-3">
           
              <?php if($booking->status == 'Unapprove'): ?>
                    <?php echo $__env->make('layouts.common.branch', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    
              <?php else: ?>
                <input type="hidden" name="<?php echo e($label_list['branch']); ?>" value="<?php echo e(Crypt::encrypt($booking->branch_id)); ?>">
                    <input class="form-control form-control-sm" type="text" readonly="" value="<?php echo e($booking->branch->name); ?>">
              <?php endif; ?>
            </div>    
          </div>

          <div class="col-sm-4">
                 <label class="label-color"> <?php echo e(ucwords(str_replace('_',' ',$label_list['plot']))); ?>: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*"><?php echo e($errors->first($label_list['plot'],":message")); ?></small>

            <div class="input-group mb-3">
              
               <?php if($booking->status == 'Unapprove'): ?>
               <select name="<?php echo e($label_list['plot']); ?>" class="fstdropdown-select form-control form-control-sm  cls_selection plot_list"  onChange = "getPlotInfo(event,this)">

                
               
                  <option value="<?php echo e(Crypt::encrypt($plot->id)); ?>" selected="true"><?php echo e($plot->plot_id); ?> <?php echo e($plot->category); ?></option>
                  <?php $__currentLoopData = $plot_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                  <option  value="<?php echo e(Crypt::encrypt($rows->id)); ?>" ><?php echo e($rows->plot_id); ?> <?php echo e($rows->category); ?></option>
                
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  

                
              
              
              </select>
              <?php else: ?>
              <select readonly="true" name="<?php echo e($label_list['plot']); ?>" class="form-control form-control-sm  cls_selection plot_list"  onChange = "getPlotInfo(event,this)">

                
               
                  <option value="<?php echo e(Crypt::encrypt($plot->id)); ?>" selected="true"><?php echo e($plot->plot_id); ?> <?php echo e($plot->category); ?></option>
                

                
              
              
              </select>
              <?php endif; ?>
            </div>    
          </div>
          
             <div class="col-sm-4">
              <label class="label-color"><?php echo e(ucwords(str_replace('_',' ',$label_list['type']))); ?>: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*"><?php echo e($errors->first($label_list['type'],":message")); ?></small>

            <div class="input-group mb-3">
            <?php if($booking->status == 'Unapprove'): ?>

            <input value="<?php echo e($plot->type); ?>" class="form-control form-control-sm type" type="text" readonly="" name="<?php echo e($label_list['type']); ?>" placeholder="<?php echo e(ucwords(str_replace('_',' ',$label_list['type']))); ?>">
             
              

              
               <?php else: ?>
                <input type="hidden" name="<?php echo e($label_list['type']); ?>" value="<?php echo e(Crypt::encrypt($booking->plot->type)); ?>">
                    <input class="form-control form-control-sm" type="text" readonly="" value="<?php echo e($booking->plot->type); ?>">
              <?php endif; ?>
              
            </div>    
          </div>
                    <div class="col-sm-4">
              <label class="label-color"><?php echo e(ucwords(str_replace('_',' ',$label_list['category']))); ?>: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*"><?php echo e($errors->first($label_list['category'],":message")); ?></small>

            <div class="input-group mb-3">
            <?php if($booking->status == 'Unapprove'): ?>

            <input value="<?php echo e($plot->category); ?>" class="form-control form-control-sm category" type="text" readonly="" name="<?php echo e($label_list['category']); ?>" placeholder="<?php echo e(ucwords(str_replace('_',' ',$label_list['category']))); ?>">

             

              
               <?php else: ?>
                <input type="hidden" name="<?php echo e($label_list['type']); ?>" value="<?php echo e(Crypt::encrypt($booking->plot->type)); ?>">
                    <input class="form-control form-control-sm" type="text" readonly="" value="<?php echo e($booking->plot->type); ?>">
              <?php endif; ?>
              
            
          
            </div>    
          </div>

         
            
            <div class="col-sm-4">
                 <label class="label-color"><?php echo e(ucwords(str_replace('_',' ',$label_list['size']))); ?> : <i style = "color:red;">*</i></label>

            <div class="input-group mb-3">
                          <?php echo e(Form::Text($label_list['size'], $plot->size, ['class' => 'form-control form-control-sm  cls_date size','readonly' => 'true' , 'placeholder' => 'Size' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])); ?>

            </div>    
          </div>
                <div class="col-sm-4">
                   <label class="label-color"><?php echo e(ucwords(str_replace('_',' ',$label_list['total_amount']))); ?>: </label>
            <small class="form-errors pull-right req" value=""><?php echo e($errors->first($label_list['total_amount'],":message")); ?></small>

            <div class="input-group mb-3">
         
              <?php echo e(Form::Text($label_list['total_amount'],$plot->rate, ['class' => 'form-control form-control-sm cls_required rate' , 'placeholder' => 'Total Price' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'onkeyup' => 'calculateAgreed()','readonly'=>'true'])); ?>

            </div>    
          </div>
            
            
         <div class="col-sm-4">
             <label class="label-color"> <?php echo e(ucwords(str_replace('_',' ',$label_list['feature_charges']))); ?>:</label>
            <small class="form-errors pull-right req" value=""><?php echo e($errors->first($label_list['feature_charges'],":message")); ?></small>

            <div class="input-group mb-3">
                         

                 <input placeholder="Feature Charges" value="<?php echo e($plot->featurecharges); ?>" type="text" name="<?php echo e($label_list['feature_charges']); ?>" class="form-control form-control-sm   cls_required feature_charges" onkeyup="calculateAgreed()" readonly >
            </div>    
          </div>
         <div class="col-sm-8">
              <label class="label-color"><?php echo e(ucwords(str_replace('_',' ',$label_list['feature_description']))); ?>:</label>
            <div class="input-group mb-3">
            
              <?php echo e(Form::Text($label_list['feature_description'],$plot->feature_description, ['class' => 'form-control form-control-sm   feature_description','readonly' => 'true' , 'placeholder' => 'Feature Description' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default' , 'onkeyup' => 'calculateAgreed()'])); ?>

            </div>    
          </div>

           <div class="col-sm-4">
               <label class="label-color"> <?php echo e(ucwords(str_replace('_',' ',$label_list['discount']))); ?>:</label>
            <small class="form-errors pull-right req" value=""><?php echo e($errors->first($label_list['discount'],":message")); ?></small>

            <div class="input-group mb-3">
            
            


                 <input placeholder="Discount" value="<?php echo e($booking->discount); ?>" type="text" name="<?php echo e($label_list['discount']); ?>" class="form-control form-control-sm   cls_required discount" onkeyup="calculateAgreed()" <?php if($booking->status != "Unapprove"): ?> readonly <?php endif; ?> >
            </div>    
          </div>

          <div class="col-sm-8">
               <label class="label-color"> Discount In Words:</label>
            <div class="input-group mb-3">
             
              <?php echo e(Form::Text('',EF::numberToWords($booking->discount), ['class' => 'form-control form-control-sm  discount_inwords','readonly' => 'true' , 'placeholder' => 'Discount In Words' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default' , 'onkeyup' => 'calculateAgreed()'])); ?>

            </div>    
          </div>


             <div class="col-sm-4">
                 <label class="label-color"> <?php echo e(ucwords(str_replace('_',' ',$label_list['agreed_amount']))); ?> :<i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value=""><?php echo e($errors->first($label_list['agreed_amount'],":message")); ?></small>

            <div class="input-group mb-3">
          
              <?php echo e(Form::Text($label_list['agreed_amount'], $booking->agreed_amount, ['class' => 'form-control form-control-sm  agreed_amount', 'readonly' => 'true' , 'placeholder' => 'Agreed Amount' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'onkeyup' => 'calculateAgreed()'])); ?>

            </div>    
          </div>

          <div class="col-sm-8">
               <label class="label-color"> Agreed Amount In Words: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
           
              <?php echo e(Form::Text('',EF::numberToWords($booking->agreed_amount), ['class' => 'form-control form-control-sm  agreed_inwords','readonly' => 'true' , 'placeholder' => 'Agreed Amount In Words' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'onkeyup' => 'calculateAgreed()'])); ?>

            </div>    
          </div>


                <div class="col-sm-12">
                     <label class="label-color"><?php echo e(ucwords(str_replace('_',' ',$label_list['remarks']))); ?> :</label>
                  <?php echo e(Form::Textarea($label_list['remarks'],$booking->remarks, ['class' => 'form-control form-control-sm ', 'placeholder' => 'Remarks' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','rows' => 2])); ?>

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

             
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <input type="hidden" name="booking_id" value="<?php echo e(Crypt::encrypt($booking->id)); ?>">
        <button type="submit" class="btn btn-primary cls_submit" content="update booking">Update</button>
      </div>
    </div>
  </div>
  <?php echo e(Form::close()); ?>

</div>

   


<?php /**PATH /var/www/skylite/resources/views/booking/modals/update_booking.blade.php ENDPATH**/ ?>