
<?php $__env->startSection('title','Application Form'); ?>
<?php $__env->startSection('main'); ?>
<h1 class="text-center">Application Form</h1>
<div class="container mt-3">
   <form action="<?php echo e(url('/Application/add')); ?>" method="post">
      <?php echo csrf_field(); ?>
      <div class="row g-1  mb-3">
         <div class="col-1">
            <input type="text" class="form-control  rounded-0" value="<?php echo e(old('projectid')); ?>" name="projectid" id="projectid" placeholder="Project ID" >
         </div>
         <div class="col-3">
            <select class="form-control rounded-0  m-bot15" id="project_name" name="project_name">
               <option value="<?php echo e(old('project_name')); ?>" selected>
                  <?php if(old('project_name')== null): ?>
                  Select Your Project
                  <?php else: ?>
                  <?php echo e(old('project_name')); ?>

                  <?php endif; ?>
               </option>
               <?php $__currentLoopData = $projectdata; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
               <option data-id="<?php echo e($data->id); ?>" value="<?php echo e($data->project_name); ?>"><?php echo e($data->project_name); ?></option>
               <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
            <span class="text-danger">
               <?php $__errorArgs = ['projectid'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
               <p>Please select your Project</p>
               <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </span>
         </div>
         <div class="col-4">
            <select class="form-select rounded-0" name="category">
               <option value="<?php echo e(old('category')); ?>" selected><?php echo e(old('category') ?? '--Select Your Category'); ?> </option>
               <option value="Lower Ground">Lower Ground</option>
               <option value="Upper Ground">Upper Ground</option>
               <option value="Mezzanine">Mezzanine</option>
               <option value="1st Floor">1st Floor</option>
               <option value="2nd Floor">2nd Floor</option>
               <option value="3rd Floor">3rd Floor</option>
               <option value="4th Floor">4th Floor</option>
               <option value="5th Floor">5th Floor</option>
               <option value="Roof">Roof</option>
               <option value="Ground">Ground</option>
               <option value="Basement">Basement</option>
            </select>
            <span class="text-danger">
               <?php $__errorArgs = ['category'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
               <p>Please select your category</p>
               <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </span>
         </div>
         <div class="col-4">
            <select class="form-select rounded-0" name="unit_type" aria-label="Default select example">
               <option value="<?php echo e(old('unit_type')); ?>" selected><?php echo e(old('unit_type') ?? '--Select Your UNIT Type'); ?> </option>
               <option value="SHOP">SHOP</option>
               <option value="FLAT">FLAT</option>
               <option value="OFFICE">OFFICE</option>
               <option value="HALL">HALL</option>
            </select>
            <span class="text-danger">
               <?php $__errorArgs = ['unit_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
               <p>Please select your unit_type</p>
               <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </span>
         </div>
      </div>
      <div class="row  g-1  mb-3">
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" value="<?php echo e(old('unit_no')); ?>" name="unit_no" placeholder="Unit No" >
            <span class="text-danger">
               <?php $__errorArgs = ['unit_no'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
               <p>Please select your unit_no</p>
               <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </span>
         </div>
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" value="<?php echo e(old('customer_name')); ?>" name="customer_name" placeholder="Customer Name">
            <span class="text-danger">
               <?php $__errorArgs = ['customer_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
               <p>Please select your customer_name</p>
               <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </span>
         </div>
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" value="<?php echo e(old('customer_father_name')); ?>" name="customer_father_name" placeholder="S/O - W/O - D/O">
         </div>
      </div>
      <div class="row g-1 mb-3">
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" value="<?php echo e(old('customer_address')); ?>" name="customer_address" placeholder="Address" >
         </div>
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" name="customer_phone" value="<?php echo e(old('customer_phone')); ?>" placeholder="Phone No">
         </div>
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" value="<?php echo e(old('customer_mobile')); ?> " name="customer_mobile" placeholder="Mobile No">
         </div>
      </div>
      <div class="row g-1 mb-3">
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" value="<?php echo e(old('cnid')); ?> " name="cnic" placeholder="CNIC" >
         </div>
         <div class="col-4">
            <input type="date" class="form-control  rounded-0" name="date_of_booking"  value="<?php echo e(now()->format('Y-m-d')); ?>" placeholder="Date Of Booking">
         </div>
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" name="booking" value="<?php echo e(old('booking')); ?>" placeholder="Booking Amount">
         </div>
      </div>
      <div class="row g-1 mb-3">
         <div class="col-4">
            <input type="date" class="form-control  rounded-0" name="installment_start"  value="<?php echo e(now()->format('Y-m-d')); ?>" placeholder="Installment Date" >
         </div>
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" name="installment" value="<?php echo e(old('installment')); ?>" placeholder="Instalment Amount">
         </div>
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" name="total_cost" value="<?php echo e(old('total_cost')); ?>" placeholder="Total Cost">
         </div>
      </div>
      <h5 class="text-center mb-3">Nominees</h5>
      <div class="row g-1 mb-3">
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" name="nominee_name" value="<?php echo e(old('nominee_name')); ?>" placeholder="Nominees Name" >
         </div>
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" name="s_d_f" value="<?php echo e(old('s_d_f')); ?>" placeholder="S/O - W/O - D/O">
         </div>
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" name="nominee_cnic" value="<?php echo e(old('nominee_cnic')); ?>" placeholder="CNIC">
         </div>
      </div>
      <div class="row g-1 mb-3">
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" name="nominee_mobile" value="<?php echo e(old('nominee_mobile')); ?>" placeholder="Mobile No" >
         </div>
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" name="nominee_address" value="<?php echo e(old('nominee_address')); ?>"  placeholder="Address">
         </div>
         <div class="col-4">
            <input type="text" class="form-control  rounded-0" name="relation" value="<?php echo e(old('relation')); ?>"  placeholder="relation">
         </div>
      </div>
      <div class="row g-5 mb-3">
         <div class="col-4"></div>
         <div class="col-auto form-check">
            <input class="form-check-input" type="checkbox" value="<?php echo e(old('cancelled')); ?>" name="cancelled" >
            <label class="form-check-label" for="flexCheckDefault">
            Cancelled
            </label>
         </div>
         <div class="col-auto form-check">
            <input class="form-check-input" type="checkbox" value="<?php echo e(old('vacant')); ?>" name="vacant" >
            <label class="form-check-label" for="flexCheckChecked">
            Vacant
            </label>
         </div>
         <div class="col-auto form-check">
            <input class="form-check-input" type="checkbox" value="<?php echo e(old('removed')); ?>" name="removed">
            <label class="form-check-label" for="flexCheckChecked">
            Remove
            </label>
         </div>
      </div>
      <div class="row">
         <div class="col-4"></div>
         <div class="d-grid col-2">
            <button class="btn btn-success" type="submit">Save/Close</button>
         </div>
         
         <div class="d-grid col-2">            
            <button class="btn btn-primary" onclick="relocate_home()" type="button">Cancel/Close</button>
         </div>
        
      </div>
   </form>
</div>
<script>
    function relocate_home()
{
     location.href = "/home";
} 
   $('#project_name').change(function(){
       
       var selected = $(this).find('option:selected');    
       var projectid = selected.data('id');
       $('#projectid').val( projectid );
       
   });
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/tahakash/public_html/resources/views/Application/add.blade.php ENDPATH**/ ?>