<?php include "layouts/menu.php"; ?>
<script>
	function autocomplet() {
	var min_length = 0; // min caracters to display the autocomplete
	var keyword = $('#did').val();
	if (keyword.length >= min_length) {
		$.ajax({
			url: 'ajax_area.php',
			type: 'POST',
			data: {keyword:keyword},
			success:function(data){
				$('#country_list_id').show();
				$('#country_list_id').html(data);
			}
		});
	} else {
		$('#country_list_id').hide();
	}
}
function set_item(item) {
	// change input value
	$('#did').val(item);
	// hide proposition list
	$('#country_list_id').hide();
}
	</script>
	 <script>
	function autocomp() {
	var min_length = 0; // min caracters to display the autocomplete
	var keyword = $('#didn').val();
	if (keyword.length >= min_length) {
		$.ajax({
			url: 'ajax_color.php',
			type: 'POST',
			data: {keyword:keyword},
			success:function(data){
				$('#dname').show();
				$('#dname').html(data);
			}
		});
	} else {
		$('#dname').hide();
	}
}

// set_item : this function will be executed when we select an item
function set_itemm(item) {
	// change input value
	$('#didn').val(item);
	// hide proposition list
	$('#dname').hide();
}
	</script>
 <script>
	function autocomplett() {
	var min_length = 0; // min caracters to display the autocomplete
	var keyword = $('#zxcvb').val();
	if (keyword.length >= min_length) {
		$.ajax({
			url: 'ajax_refreshvname.php',
			type: 'POST',
			data: {keyword:keyword},
			success:function(data){
				$('#qwertyu').show();
				$('#qwertyu').html(data);
			}
		});
	} else {
		$('#qwertyu').hide();
	}
}
// set_item : this function will be executed when we select an item
function set_itemmm(item) {
	// change input value
	$('#zxcvb').val(item);
	// hide proposition list
	$('#qwertyu').hide();
}
	</script>
 <script>
function add3()
{
var x = document.getElementById("1").value;
var y = document.getElementById("bba").value;
document.getElementById("1").value =(x*1)+(y*1);
}
</script>
 <script>
function interr()
{
var x = document.getElementById("5555").value;
var y = (x*1)/(12);
document.getElementById("2").value = (y).toFixed(2);
}
</script>

 <script>
function add11()
{
var x = document.getElementById("44").value;
var y = document.getElementById("33").value;
document.getElementById("1").value =(x*1)+(y*1);
}
</script>
  <script>
function add()
{
var x = document.getElementById("txt1").value;
var y = document.getElementById("txt2").value;
document.getElementById("tot").value =(x*1)+(y*1);
}
</script>
<script>
function add1()
{
var x1 = document.getElementById("1").value;
var y1 = document.getElementById("2").value;
var g = (x1*1)*(y1/100);
document.getElementById("txt2").value =Math.round(g);
//var y = (x*1)/(12);
//document.getElementById("2").value =Math.round(y);
}
</script>
<script>
function add2()
{
var x1 = document.getElementById("1").value;
var y1 = document.getElementById("3").value;
document.getElementById("txt1").value =parseInt((x1*1)/(y1*1));
var x = document.getElementById("txt1").value;
var y = document.getElementById("txt2").value;
document.getElementById("tot").value =(x*1)+(y*1);
}

function due()
{
var x = document.getElementById("txt1").value;
var y = document.getElementById("tot").value;
document.getElementById("txt2").value =(y*1)-(x*1);
}

function ddate()
{
	
	var x = 1; //or whatever offset
var CurrentDate = document.getElementById("hpdate").value;
document.getElementById("hpdate2").value = CurrentDate.setMonth(CurrentDate.getMonth() + x);
}

navigator.geolocation.getCurrentPosition();
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;

if (e.keyCode == 37)
   e.preventDefault();
   
</script>
<script>
$('body').on('keydown', 'input, select, textarea', function(e) {
    var self = $(this)
      , form = self.parents('form:eq(0)')
      , focusable
      , next
      ;
    if (e.keyCode == 13) {
        focusable = form.find('input,a,select,button,textarea').filter(':visible');
        next = focusable.eq(focusable.index(this)+1);
        if (next.length) {
            next.focus();
        } else {
            form.submit();
        }
        return false;
    }
});
</script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script>
    $(document).on("keypress", "input", function(e){
        if(e.which == 13){
         event.stopPropagation();
        event.preventDefault();
        $(this).next("input").focus();
        }
    }); </script>
  <!--  page-wrapper -->
         <div class="right_col" role="main">
      <h5 class="page-header  alert alert-danger">New Registration For Auto Due Loan</h5>   
            <div class="row">
                <div class="col-lg-12">
                    <!-- Form Elements -->
                    <div class="panel panel-default">
                        
                        <div class="panel-body">
                            <div class="row">
                               
                                   <?php
								   $hpl=$_REQUEST['hpl'];
								   $qry=mysqli_query($conn, "select * from customerdetails where hpl='$hpl'");
						$n=mysqli_num_rows($qry);
						$row = mysqli_fetch_array($qry);
						 ?>
						
  <form role="form" name="form1" id="form1" method="post" action="save.php" enctype="multipart/form-data">
	<div id="wizard" class="form_wizard wizard_horizontal">
                      <ul class="wizard_steps">
                        <li>
                          <a href="#step-1">
                            <span class="step_no">1</span>
                            <span class="step_descr">
                                              Customer & Vehicle Details<br />
                                              <small>Customer</small>
                                          </span>
                          </a>
                        </li>
                        <li>
                          <a href="#step-2">
                            <span class="step_no">2</span>
                            <span class="step_descr">
                                              Loan Details<br />
                                              <small>Loan</small>
                                          </span>
                          </a>
                        </li>
                        <li>
                          <a href="#step-3">
                            <span class="step_no">3</span>
                            <span class="step_descr">
                                              Co-Applicant & Guarantor<br />
                                              <small>Details</small>
                                          </span>
                          </a>
                        </li>
                       
                      </ul>  <?php	$qry11=mysqli_query($conn, "select * from customerdetails where mfin='$mfin' order by id DESC");
						$n11=mysqli_num_rows($qry11);
						if($n11==0)
						{
							$rty11 = 1;
						}
						else
					    {
						$row11=mysqli_fetch_array($qry11);
						
						$sss11 = $row11['hpl'];
							$hpdate11 = $row11['hpdate'];
						$rtyy11 = $sss11 + 1;
						$rty11 = $rtyy11;
						} ?>
                       <div id="step-1">					
  <div class="col-lg-3">
       <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Phone Number <font color="red">*</font></label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="pno" name="pno" value="" onkeyup(getUsers(this)) required placeholder="Eg: 9876543210">
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>
   
   <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Account No *</label>
     <input style="text-transform:uppercase"  type="text" class="form-control" id="email" onchange="uch()" name="hpl" value="<?php echo $row11['hpl'];?>" placeholder="E.g 1008" required>
      <input style="text-transform:uppercase" type="hidden" class="form-control" id="email" onchange="uch()" name="hplt" value="<?php echo $row11['hplt'];?>" placeholder="E.g 1008" required>
<span class="glyphicon glyphicon-pencil form-control-feedback"></span> 
 </div>
 
 <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >GEO CODE House</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="geo"  name="geo" value="<?php echo $row11['geo'];?>" placeholder="E.g 1008" required>
<span class="glyphicon glyphicon-pencil form-control-feedback"></span> 
 </div>
  <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >GEO CODE Work</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="geow"  name="geow" value="<?php echo $row11['geow'];?>" placeholder="E.g 1008" required>
<span class="glyphicon glyphicon-pencil form-control-feedback"></span> 
 </div>
  <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Name *</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="name" style="text-transform:uppercase" name="name" value="<?php echo $row11['name'];?>" placeholder="Name">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
   <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Co - Applicant Name</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" style="text-transform:uppercase" name="sbname" value="<?php echo $row11['sbname'];?>" placeholder="Name">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div> 
     
    <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Father's Name</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="fname" name="fname" onkeyup(getUsers1(this)) value="<?php echo $row11['fname'];?>" placeholder="Name">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
  
     <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Mother's Name</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="mname" value="<?php echo $row11['mname'];?>" placeholder="Name">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
    <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Spouse Name</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" style="text-transform:uppercase" name="hname" value="<?php echo $row11['hname'];?>" placeholder="Name">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
  <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Address</label>
 <input style="text-transform:uppercase" type="text" class="form-control" id="address" name="address" value="<?php echo $row11['address'];?>" placeholder="Line 1">
 <input style="text-transform:uppercase" type="text" class="form-control" id="address1" name="address1" value="<?php echo $row11['address1'];?>" placeholder="Line 2">
 <input style="text-transform:uppercase" type="text" class="form-control" id="address2" name="address2" value="<?php echo $row11['address2'];?>" placeholder="Line 3 + Pincode"> 

  <span class="glyphicon glyphicon-home form-control-feedback"></span>
  </div>

     
  
  
  </div>
  <div class="col-lg-3">
    <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Land Mark</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="lmark" name="lmark" value="<?php echo $row11['lmark'];?>" placeholder="">
 <span class="glyphicon glyphicon-home form-control-feedback"></span>
  </div>
   <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >House Own/Rent</label>
      <select style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="bba" value="<?php echo $row11['bba'];?>" placeholder="">
	  <option><?php echo $row11['bba'];?></option>
	  <option>Own House</option><option>Own by Family Member</option>
	  <option>Rent House</option><option>Hostel/Mansion</option></select>
 <span class="glyphicon glyphicon-home form-control-feedback"></span>
  </div>

  
  <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Spouse's Phone No</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="pnoresi" value="<?php echo $row11['pnoresi'];?>" placeholder="Eg: 9876543210">
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>
      <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Alternate Phone 1</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="pnof" value="<?php echo $row11['pnof'];?>" placeholder="Eg: 9876543210">
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>
    <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Alternate Phone  2</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="pnom" value="<?php echo $row11['pnom'];?>" placeholder="Eg: 9876543210">
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>
    <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Alternate Phone  3</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="pnos" value="<?php echo $row11['pnos'];?>" placeholder="Eg: 9876543210">
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>
   <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Office PhoneNo</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="pnooffice" value="<?php echo $row11['pnooffice'];?>" placeholder="Eg: 9876543210">
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>
  <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Office Address</label>
 <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="oaddress" value="<?php echo $row11['oaddress'];?>" placeholder="Line 1">
 <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="oaddress1" value="<?php echo $row11['oaddress1'];?>" placeholder="Line 2">
 <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="oaddress2" value="<?php echo $row11['oaddress2'];?>" placeholder="Line 3">
  <span class="glyphicon glyphicon-home form-control-feedback"></span>
  </div>
  
  
  
  </div>

<div class="col-lg-3">
    
     <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Area</label>
     <select style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="model" value="<?php echo $row11['model'];?>" placeholder="Eg : 2016">
<option><?php echo $row111['model'];?></option>
<?php $sql111 = mysqli_query($conn, "select * from marea order by name asc");
while($row111 = mysqli_fetch_array($sql111)) { ?>
<option><?php echo $row111['name']; ?></option>
<?php } ?>
</select>
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>
    
 <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Sub-Area</label>
      <select style="text-transform:uppercase" type="text" class="form-control" id="didd" name="area" value="<?php echo $row11['area'];?>" placeholder="Area">
<option><?php echo $row112['area'];?></option>
<?php $sql112 = mysqli_query($conn, "select * from msarea order by name asc");
while($row112 = mysqli_fetch_array($sql112)) { ?>
<option><?php echo $row112['name']; ?></option>
<?php } ?>
</select>
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>
   <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Profession Details</label>
      <textarea cols="3" style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="profession" value="<?php echo $row11['profession'];?>" placeholder="Job - Net Salary"></textarea>
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>	
  <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Son/Daughter Details</label>
      <textarea cols="3" style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="sonn" value="" placeholder="Son/Daughter Name School/College Details"><?php echo $row11['sonn'];?></textarea>
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>
	
   <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Date of Birth</label>
      <input style="text-transform:uppercase" type="date" class="form-control" id="inputPassword3" name="dob" value="<?php echo date('Y-m-d',strtotime($row11['dob']));?>" placeholder="">
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>
	 <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Govt ID</label>
      <input readonly type="text" class="form-control" id="inputPassword3" name="gi1" value="Aadhar" placeholder="">
	  
    <span class="glyphicon glyphicon-plane form-control-feedback"></span>
	
		<input style="text-transform:uppercase" type="text" class="form-control" id="1" name="g1"  value="<?php echo $row11['g1'];?>" placeholder="Govt ID No" >

    </div>
		    <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Govt ID</label>
      <select type="text" class="form-control" id="inputPassword3" name="gi2" value="<?php echo $row11['gi2'];?>" placeholder="">
	  
    <span class="glyphicon glyphicon-plane form-control-feedback"></span>
	<option><?php echo $row11['gi2'];?></option>
	<?php 
$qry=mysqli_query($conn, "select * from mgovt");
	while($row112=mysqli_fetch_array($qry))
						{ ?> <option><?php echo $row112['name'];?></option>
						<?php } ?> </select>
		<input style="text-transform:uppercase" type="text" class="form-control" id="1" name="g2"  value="<?php echo $row11['g2'];?>" placeholder="Govt ID No" >

    </div>	    <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Govt ID</label>
      <select type="text" class="form-control" id="inputPassword3" name="gi3" value="<?php echo $row11['gi3'];?>" placeholder="">
	  
    <span class="glyphicon glyphicon-plane form-control-feedback"></span>
	<option><?php echo $row11['gi3'];?></option>
	<?php 
$qry=mysqli_query($conn, "select * from mgovt");
	while($row112=mysqli_fetch_array($qry))
						{ ?> <option><?php echo $row112['name'];?></option>
						<?php } ?> </select>
		<input style="text-transform:uppercase" type="text" class="form-control" id="1" name="g3"  value="<?php echo $row11['pno'];?>" placeholder="Govt ID No" >

    </div>
	
   <div class="form-group has-success has-feedback">
    <label for="inputEmail3" >Upload Image</label>
    <input style="text-transform:uppercase" type="file" id="exampleInputFile" name="uimg" >
    <img src='user/<?php echo $row11['uimg'];?>' width='200' height='200'>
    <p class="help-block">Upload Passport size Photo here.</p>
	<span class="glyphicon glyphicon-cloud-upload form-control-feedback"></span>
  </div> 
	  </div>
	  
	      <input style="text-transform:uppercase" type="hidden" class="form-control" id="inputEmail3" name="vno" value="TN " placeholder="E.g TN 21 S 2676">

       <input style="text-transform:uppercase" type="hidden" class="form-control" id="zxcvb" name="vname" value=""  onkeyup="autocomplett()" placeholder="Vehicle Name">

      
      <input style="text-transform:uppercase" type="hidden" class="form-control" id="inputPassword3" name="bbd" value="" placeholder="">

      <input style="text-transform:uppercase" type="hidden" class="form-control" id="didna" name="color" value="" onkeyup="autocompa()" placeholder="E.g RED">

	 <div class="col-lg-3">
  
    <div class="form-group has-error has-feedback">
    <label for="inputPassword3" >Bank A/C Holder Name</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="eno" name="eno" value="<?php echo $row11['eno'];?>"  placeholder="">
	 
    <span class="glyphicon glyphicon-tint form-control-feedback"></span>
	</div>
   <div class="form-group has-error has-feedback">
    <label for="inputPassword3" >Bank Name</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="holdd" value="<?php echo $row11['holdd'];?>" placeholder="">
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>
	
	 <div class="form-group has-error has-feedback">
    <label for="inputPassword3" >Branch Name</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="cno" name="cno" value="<?php echo $row11['cno'];?>"  placeholder="">
	
    <span class="glyphicon glyphicon-tint form-control-feedback"></span>
	</div>
	  <div class="form-group has-error has-feedback">
    <label for="inputPassword3" >IFSC Code</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="idate" value="<?php echo $row11['idate'];?>" placeholder="">
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>
  
      <input style="text-transform:uppercase" type="hidden" class="form-control" id="inputPassword3" name="uname" value="" placeholder="">
 
  
	
      <input style="text-transform:uppercase" type="hidden" class="form-control" id="rctype" name="rctype" value=""  placeholder="">

  
      <input style="text-transform:uppercase" type="hidden" class="form-control" id="inputPassword3" name="hch" value="" placeholder="">
<div class="form-group has-error has-feedback">
    <label for="inputPassword3" >Customer Type</label>
      <select style="text-transform:uppercase" type="text" class="form-control" id="custype" name="custype" value=""  placeholder="">
          <option><?php echo $row11['custype'];?></option>
	<option>Hot</option> <option>Cold</option></select>
    <span class="glyphicon glyphicon-tint form-control-feedback"></span>
	</div>
   
  
  
      <input style="text-transform:uppercase" type="hidden" class="form-control" id="inputPassword3" name="doo" value="" placeholder="">
 
  <div class="form-group has-error has-feedback">
    <label for="inputEmail3" >Upload Image</label>
    <input style="text-transform:uppercase" type="file" id="exampleInputFile" name="imgveh" >
     <img src='user/<?php echo $row11['imgveh'];?>' width='200' height='200'>
    <p class="help-block">Upload 1st Info Sheet 1stPage here.</p>
	<span class="glyphicon glyphicon-cloud-upload form-control-feedback"></span>
  </div> 
   <div class="form-group has-error has-feedback">
    <label for="inputEmail3" >Upload Image</label>
    <input style="text-transform:uppercase" type="file" id="exampleInputFile" name="imgveh5" >
    <img src='user/<?php echo $row11['imgveh5'];?>' width='200' height='200'>
    <p class="help-block">Upload 1st Info Sheet 2nd Page here.</p>
	<span class="glyphicon glyphicon-cloud-upload form-control-feedback"></span>
  </div> 
    

	</div></div>
                      <div id="step-2">
	
  <div class="col-lg-4">

      <input style="text-transform:uppercase" type="hidden" class="form-control" id="vval" name="vehval" value="0" placeholder="">
 
      <input style="text-transform:uppercase" type="hidden" class="form-control" id="downn" name="downpay" value="0" onkeyup="down()" placeholder="">
  
   <div class="form-group has-error has-feedback">
    <label for="inputPassword3">Loan Amount</label>
    <input type="text" class="form-control" id="hp1" name="hpamount" placeholder="H.P Amount" value="<?php echo $row11['hpamount'];?>" onkeyup="calculateLedger()" />
    <span class="glyphicon glyphicon-usd form-control-feedback"></span>
</div>

<div class="form-group has-error has-feedback">
    <label for="inputPassword3">Interest Rate (%)</label>
    <input type="text" class="form-control" id="interestRate" name="inter2" value="<?php echo $row11['inter2'];?>" placeholder="E.g. 20%" onkeyup="calculateLedger()" />
    <span class="glyphicon glyphicon-usd form-control-feedback"></span>
</div>

<div class="form-group has-error has-feedback">
    <label for="inputPassword3">Due Days</label>
    <input type="text" class="form-control" id="duemnt3" name="duemnt" value="<?php echo $row11['duemnt'];?>" placeholder="Due Days" onkeyup="calculateLedger()" />
    <span class="glyphicon glyphicon-time form-control-feedback"></span>
</div>

<div class="form-group has-error has-feedback">
    <label for="txt1">Principle Part</label>
    <input readonly type="text" class="form-control" id="txt1" name="dueamt" value="<?php echo $row11['dueamt'];?>" placeholder="Principle Amount" />
    <span class="glyphicon glyphicon-usd form-control-feedback"></span>
</div>

<div class="form-group has-error has-feedback">
    <label for="txt2">Interest Part</label>
    <input readonly type="text" class="form-control" id="txt2" name="interest" value="<?php echo $row11['interest'];?>" placeholder="Interest Amount" />
    <span class="glyphicon glyphicon-usd form-control-feedback"></span>
</div>

<div class="form-group has-error has-feedback">
    <label for="inputPassword3">Total Due Amount</label>
    <input type="text" class="form-control" id="tot" name="total" value="<?php echo $row11['total'];?>" placeholder="Total Amount" onkeyup=" due()" />
    <span class="glyphicon glyphicon-usd form-control-feedback"></span>
</div>

<div class="form-group has-error has-feedback">
    <label for="inputPassword3">Total Collect Amount</label>
    <input type="text" class="form-control" id="tots" name="dealer" value="<?php echo $row11['dealer'];?>" placeholder="Total Dues" />
    <span class="glyphicon glyphicon-usd form-control-feedback"></span>
</div>

<script>
function calculateLedger() {
    var loanAmount = parseFloat(document.getElementById('hp1').value) || 0;
    var interestRate = parseFloat(document.getElementById('interestRate').value) / 100 || 0;
    var dueDays = parseFloat(document.getElementById('duemnt3').value) || 0;
    
    // Calculate Principle and Interest
    var principlePart = loanAmount / dueDays || 0;
    var interestPart = (loanAmount * interestRate) / dueDays || 0;

    // Total Due is the sum of Principle and Interest
    var totalDueAmount = principlePart + interestPart;

    // Set values to respective fields
    document.getElementById('txt1').value = principlePart.toFixed(0);  // Principle
    document.getElementById('txt2').value = interestPart.toFixed(0);   // Interest
    document.getElementById('tot').value = totalDueAmount.toFixed(0);  // Total Due Amount

    // Calculate Total Collect Amount (for example, you mentioned 12,000)
    var totalCollectAmount = loanAmount + 2000; // Adding fixed 2000 as an example
    document.getElementById('tots').value = totalCollectAmount.toFixed(0);  // Total collect amount
}

function due()
{
var x = document.getElementById("txt1").value;
var y = document.getElementById("tot").value;
document.getElementById("txt2").value =(y*1)-(x*1);
}
</script>
	
  </div>
    <div class="col-lg-4">
        
         <div class="form-group has-error has-feedback">
    <label for="inputPassword3" class="control-label">Loan Date</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="hpdate"   name="hpdate" value="<?php echo $row11['hpdate'];?>" onchange="dchange()"  Onkeyup="ddd()" placeholder="H.P Date" onfocus="insertDate(this,'DD-MM-YYYY')">
 <span class="glyphicon glyphicon-calendar form-control-feedback"></span>
    </div>
<div class="form-group has-error has-feedback">
    <label for="inputPassword3" class="control-label">Due Date</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="hpdate2"  name="hpdate2" value="<?php echo $row11['hpdate2'];?>" placeholder="Due Date" onclick="dchange()" >
 <span class="glyphicon glyphicon-calendar form-control-feedback"></span>
    </div>


      <input style="text-transform:uppercase" type="hidden" class="form-control" name="hlamt" value="" >
 
      <input style="text-transform:uppercase" type="hidden" class="form-control" name="hlreturn" value="" >
       <input style="text-transform:uppercase" type="hidden" class="form-control" name="mfin55" value="<?php echo $mfin; ?>" >
  
 <input style="text-transform:uppercase" type="hidden" class="form-control" name="irr" value="" >
 
    

      

      <input style="text-transform:uppercase" type="hidden" class="form-control" id="dealeramt" name="dealeramt" onkeyup="deall()" value="0" placeholder="Dealer Amount" >
 
</div>
 
   <div class="col-lg-4">
     <div class="form-group has-error has-feedback">
    <label for="inputPassword3" >Pay mode</label>
      <select type="text" class="form-control" id="pmode" name="pmode" value="">
          <option><?php echo $row11['pmode'];?></option>
	  <option>Cash A/c</option>
	<?php $abank = mysqli_query($conn, "select * from ledger where under='Bank Accounts'");
	while($bbank = mysqli_fetch_array($abank)) { ?>
	<option><?php echo $bbank['ledger']; ?></option>
	<?php } ?>
	  </select>
   <span class="glyphicon glyphicon-usd form-control-feedback"></span>
  </div>
  
  <div class="form-group has-error has-feedback">
    <label for="inputPassword3" >Bank transaction ID</label>
  <input type="text" class="form-control" id="inputPassword3" name="bname" value="<?php echo $row11['bname'];?>" placeholder="Broker Name">
   <span class="glyphicon glyphicon-usd form-control-feedback"></span>
  </div>
  
  
  
   <div class="form-group has-error has-feedback">
    <label for="inputPassword3" >Net_Payable</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="netp" name="netamt" value="<?php echo $row11['netamt'];?>">
   <span class="glyphicon glyphicon-usd form-control-feedback"></span>
  </div>
   
      <input type="hidden" class="form-control" id="pmode2" name="pmode2" value="">
	
      <input style="text-transform:uppercase" type="hidden" class="form-control" id="chqamt" name="chqamt" value="">

      <input style="text-transform:uppercase" type="hidden" class="form-control" id="inputPassword3" name="pwd" value="" placeholder="">

		 <div class="form-group has-error has-feedback">
    <label for="inputPassword3" >Documentation Charge</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="gfjghgf" name="document" onkeyup="deall()" value="<?php echo $row11['document'];?>"   placeholder="Documentation Charge" >
  <span class="glyphicon glyphicon-usd form-control-feedback"></span>
  </div>

      <input style="text-transform:uppercase" type="hidden" class="form-control" id="txtgh3" name="bcommission"  value="" placeholder="Boker Commission" >

 	 <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Remarks</label>
      <textarea  style="text-transform:uppercase" class="form-control" rows="3" cols="3" name="remarks" value="" placeholder=""><?php echo $row11['remarks'];?></textarea>
    <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div> 

 </div>





 </div>
                      <div id="step-3">
					
  <div class="col-lg-3">
   <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Co - Applicant Name</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="cobname" value="<?php echo $row11['cobname'];?>" placeholder="Co - Applicant Name">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
  
		
  <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Co - Applicant FATHER'S Name</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="cofname" value="<?php echo $row11['cofname'];?>" placeholder="Co - Applicant Name">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
    <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Co - Applicant Address</label>
   <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="co" value="<?php echo $row11['co'];?>" placeholder="Line 1">
 <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="co01" value="<?php echo $row11['co01'];?>" placeholder="Line 2">
 <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="co02" value="<?php echo $row11['co02'];?>" placeholder="Line 3"> 
    <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
   <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Co - Applicant LANDMARK</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="TTT" name="coaland"  value="<?php echo $row11['coaland'];?>" placeholder="Boker Commission" >
   <span class="glyphicon glyphicon-usd form-control-feedback"></span>
  </div>
    <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Co - Applicant Work Address</label>
	 <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="cow" value="<?php echo $row11['cow'];?>" placeholder="Line 1">
 <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="cow01" value="<?php echo $row11['cow01'];?>" placeholder="Line 2">
 <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="cow02" value="<?php echo $row11['cow02'];?>" placeholder="Line 3"> 
 
    <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
   </div>
      
	
	  

  <div class="col-lg-3">
  
  <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Co - Applicant Phone</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="cobpno" value="<?php echo $row11['cobpno'];?>" placeholder="Co - Applicant Phone">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
    <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Co - Applicant Phone</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="cobpno11" value="<?php echo $row11['cobpno11'];?>" placeholder="Co - Applicant Phone">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
	 <div class="form-group has-warning has-feedback">
    <label for="inputEmail3" >Upload Image</label>
    <input style="text-transform:uppercase" type="file" id="exampleInputFile" name="img" >
     <img src='user/<?php echo $row11['img'];?>' width='200' height='200'>
    <p class="help-block">Upload Co - Applicant Passport size Photo here.</p>
	<span class="glyphicon glyphicon-cloud-upload form-control-feedback"></span>
  </div> 
    	    <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Co - Applicant Govt ID</label>
       <input readonly type="text" class="form-control" id="inputPassword3" name="bi1" value="Aadhar" placeholder="">
	  
    <span class="glyphicon glyphicon-plane form-control-feedback"></span>

		<input style="text-transform:uppercase" type="text" class="form-control" id="1" name="b1"  value="<?php echo $row11['b1'];?>" placeholder="Govt ID No" >

    </div>
		    <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Co - Applicant Govt ID</label>
      <select type="text" class="form-control" id="inputPassword3" name="bi2" value="<?php echo $row11['bi2'];?>" placeholder="">
	  
    <span class="glyphicon glyphicon-plane form-control-feedback"></span>
	<option>Select</option>
	<?php 
$qry=mysqli_query($conn, "select * from mgovt");
	while($row112=mysqli_fetch_array($qry))
						{ ?> <option><?php echo $row112['name'];?></option>
						<?php } ?> </select>
		<input style="text-transform:uppercase" type="text" class="form-control" id="1" name="b2"  value="<?php echo $row11['b2'];?>" placeholder="Govt ID No" >

    </div>	    
	<div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Co - Applicant Govt ID</label>
      <select type="text" class="form-control" id="inputPassword3" name="bi3" value="<?php echo $row11['bi3'];?>" placeholder="">
	  
    <span class="glyphicon glyphicon-plane form-control-feedback"></span>
	<option>Select</option>
	<?php 
$qry=mysqli_query($conn, "select * from mgovt");
while($row112=mysqli_fetch_array($qry)) 
{ ?> <option><?php echo $row112['name'];?></option>
<?php } ?> </select>
<input style="text-transform:uppercase" type="text" class="form-control" id="1" name="b3"  value="<?php echo $row11['b3'];?>" placeholder="Govt ID No" >
    </div>	   
   <input style="text-transform:uppercase" type="hidden" class="form-control" id="balance"  name="nnamef" value="<?php echo $row11['nnamef'];?>" placeholder=""  onclick="sum()">
</div>   

  <div class="col-lg-3">
  <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Guarantor Name</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="cobname2" value="<?php echo $row11['cobname2'];?>" placeholder="Co - Applicant Name">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
  <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Guarantor FATHER'S Name</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="cofname2" value="<?php echo $row11['cofname2'];?>" placeholder="Co - Applicant Name">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
	
    <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Guarantor Address</label>
     <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="co2" value="<?php echo $row11['co2'];?>" placeholder="Line 1">
 <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="co201" value="<?php echo $row11['co201'];?>" placeholder="Line 2">
 <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="co202" value="<?php echo $row11['co202'];?>" placeholder="Line 3"> 
    <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div> 
   <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Co - Applicant LANDMARK</label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="TTT" name="coaland2"  value="<?php echo $row11['coaland2'];?>" placeholder="Boker Commission" >
   <span class="glyphicon glyphicon-usd form-control-feedback"></span>
  </div>
  <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Guarantor Work Address</label>
      <textarea  style="text-transform:uppercase" class="form-control" rows="5" cols="5" name="cow2" value="<?php echo $row11['cow2'];?>" placeholder=""></textarea>
    <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div> 
	
	 </div>
	 
  <div class="col-lg-3">
  	<div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Guarantor Phone </label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="cobpno2" value="<?php echo $row11['cobpno2'];?>" placeholder="Co - Applicant Phone">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
  <div class="form-group has-warning has-feedback">
    <label for="inputPassword3" >Guarantor Phone2 </label>
      <input style="text-transform:uppercase" type="text" class="form-control" id="inputPassword3" name="cobpno22" value="<?php echo $row11['cobpno22'];?>" placeholder="Co - Applicant Phone">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
   <div class="form-group has-warning has-feedback">
    <label for="inputEmail3" >Upload Image</label>
    <input style="text-transform:uppercase" type="file" id="exampleInputFile" name="img2" >
    <img src='user/<?php echo $row11['img2'];?>' width='200' height='200'>
    <p class="help-block">Upload Guarantor Passport size Photo here.</p>
	<span class="glyphicon glyphicon-cloud-upload form-control-feedback"></span>
  </div> 
    	    <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Guarantor Govt ID</label>
       <input readonly type="text" class="form-control" id="inputPassword3" name="bbi1" value="Aadhar" placeholder="">
	  
    <span class="glyphicon glyphicon-plane form-control-feedback"></span>

		<input style="text-transform:uppercase" type="text" class="form-control" id="1" name="bb1"  value="<?php echo $row11['bb1'];?>" placeholder="Govt ID No" >

    </div>
		    <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Guarantor Govt ID</label>
      <select type="text" class="form-control" id="inputPassword3" name="bbi2" value="<?php echo $row11['bbi2'];?>" placeholder="">
	  
    <span class="glyphicon glyphicon-plane form-control-feedback"></span>
	<option>Select</option>
	<?php 
$qry=mysqli_query($conn, "select * from mgovt");
	while($row112=mysqli_fetch_array($qry))
						{ ?> <option><?php echo $row112['name'];?></option>
						<?php } ?> </select>
		<input style="text-transform:uppercase" type="text" class="form-control" id="1" name="bb2"  value="<?php echo $row11['bb2'];?>" placeholder="Govt ID No" >

    </div>	    
	<div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Guarantor Govt ID</label>
      <select type="text" class="form-control" id="inputPassword3" name="bbi3" value="<?php echo $row11['bbi3'];?>" placeholder="">
	  
    <span class="glyphicon glyphicon-plane form-control-feedback"></span>
	<option>Select</option>
	<?php 
$qry=mysqli_query($conn, "select * from mgovt");
while($row112=mysqli_fetch_array($qry)) 
{ ?> <option><?php echo $row112['name'];?></option>
<?php } ?> </select>
<input style="text-transform:uppercase" type="text" class="form-control" id="1" name="bb3"  value="<?php echo $row11['bb3'];?>" placeholder="Govt ID No" >
    </div>	   
</div> 

   </div>
                    
  <input style="text-transform:uppercase" type="hidden" class="form-control" id="lat" name="lat" value="" onclick="getLocation()" placeholder="">
  <input style="text-transform:uppercase" type="hidden" class="form-control" id="lang" name="lang" value="" placeholder="" >
   
   <input style="text-transform:uppercase" type="hidden" class="form-control" id="scode" name="scodee" value="<?php echo $code; ?>" placeholder="" >
   
</form>
    </div>
   
</div> 
</div>
</div></div>
</div></div></div><?php include "layouts/footer2.php"; ?>
 <script src="vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->

    <!-- NProgress -->

    <script src="vendors/jQuery-Smart-Wizard/js/jquery.smartWizard.js"></script>
    <!-- Custom Theme Scripts -->
    <script src="build/js/custom.min.js"></script>
</body></html>
