<?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_refresh.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_sname.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_refreshq.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>
  <div class="right_col" role="main">
            <div class="row">
                 <!-- page header -->
                <div class="col-lg-12">
				
                    <h1 class="page-header  alert alert-info">Pay Due for vehicle Loans</h1>
                </div>
                <!--end page header -->
            </div>
            <div class="row">
                <div class="col-lg-12">
				<a href="getuserdue.php"><button class="btn btn-primary">View</button></a>&nbsp;&nbsp;
                    <!-- Form Elements -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Give HPL / Vehicle Name /Customer Name
                        </div>
                        <div class="panel-body">
                            <div class="row">
   <div class="alert alert-info">Welcome Register Here - Due</div>
   <form name="form1" class="form-horizontal" method="post" action="" enctype="multipart/form-data">
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">HPL</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="hpl" value="" placeholder="E.g 1008" required>
    </div>
  </div>	
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-primary" name="s3">Search It</button>
    </div>
  </div>
      <div class="alert alert-success">
	  <?php
								if(isset($_POST['s3']))
								{
									extract($_POST);
									$qry=mysqli_query($conn, "select * from customerdetails where mfin='$mfin' &&  hpl=$hpl");
									$n=mysqli_num_rows($qry);
									$qry2=mysqli_query($conn, "select * from net where mfin='$mfin' &&  hpl=$hpl");
									$nq=mysqli_num_rows($qry2);	
									$qryyy=mysqli_query($conn, "SELECT * FROM sizzing where mfin='$mfin' &&  hpl=$hpl");
									$n3=mysqli_num_rows($qryyy);		
									if($n==0)
									{
										echo "Invalid Number";
									}
									elseif($n3==1)
									{
										echo " Vechicle Sizzied.";
									}
									elseif($nq==0)
									{
									$row=mysqli_fetch_array($qry);
										$hid=$row['hpl'];
										header("location:register.php?hpl=$hpl");
										
									}
									else
									{
										echo "Account Clossed";
									}
								}
							?>
	  </div>
</form>
<form name="form2" class="form-horizontal" method="post" action="" enctype="multipart/form-data">
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Vehicle No</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="zxcvb" name="vno" value="" placeholder="E.g TN 80 S4567"  onkeyup="autocomplett()" required>
	  <ul id="qwertyu"></ul>
    </div>
  </div>	
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-success" name="s4">Search It</button>
    </div>
  </div>
      <div class="alert alert-success">
	  <?php
								if(isset($_POST['s4']))
								{
									extract($_POST);
									$qry=mysqli_query($conn, "select * from customerdetails where mfin='$mfin' &&  vno='$vno'");
									$n=mysqli_num_rows($qry);
									$qryyy=mysqli_query($conn, "SELECT * FROM sizzing where mfin='$mfin' &&  hpl=$hpl");
									$n3=mysqli_num_rows($qryyy);
									
									if($n==0)
									{
										echo "Invalid Number";
									}
									else
									{
										while($row=mysqli_fetch_array($qry))
										{
										$hpl=$row['hpl']; }
										$qry2=mysqli_query($conn, "select * from net where mfin='$mfin' &&  hpl=$hpl");
									$nq=mysqli_num_rows($qry2);	
									if($n==0)
									{
										echo "Invalid Number";
									}
									elseif($nq==0)
									{
										header("location:register.php?hpl=$hpl");
									}
									else { echo "Account Clossed"; }
									}
								}
							?>
	  </div>
</form>
<form name="form3" class="form-horizontal" method="post" action="" enctype="multipart/form-data">
   <div class="form-group">
    <label for="search" class="col-sm-2 control-label">Name</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="didn" name="name" value="" placeholder="E.g SELVAPRABU" onkeyup="autocomp()" required>
	  <ul id="dname"></ul>
    </div>
  </div>	
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-warning" name="s5">Search It</button>
    </div>
  </div>
      <div class="alert alert-success">
	  <?php
								if(isset($_POST['s5']))
								{
									extract($_POST);
									$qry=mysqli_query($conn, "select * from customerdetails where mfin='$mfin' &&  name='$name'");
									$n=mysqli_num_rows($qry);
									
									if($n==0)
									{
										echo "Invalid Number";
									}
									else
									{
									while($row=mysqli_fetch_array($qry))
										{
										$hpl=$row['hpl']; }
										$qry2=mysqli_query($conn, "select * from net where mfin='$mfin' &&  hpl=$hpl");
									$nq=mysqli_num_rows($qry2);	
									if($n==0)
									{
										echo "Invalid Number";
									}
									elseif($nq==0)
									{
										header("location:register.php?hpl=$hpl");
									}
									else 
						{  echo "Account Clossed";  }
									}
								}
							?>
	  </div>
	   
</form>
<form name="form4" class="form-horizontal" method="post" action="" enctype="multipart/form-data">
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Phone Number</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="did" name="pno" value="" placeholder="E.g 9843362020"  onkeyup="autocomplet()" required>
	  <ul id="country_list_id"></ul>
    </div>
  </div>	
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-danger" name="s5">Search It</button>
    </div>
  </div>
      <div class="alert alert-success">
	  <?php
								if(isset($_POST['s5']))
								{
									extract($_POST);
									$qry=mysqli_query($conn, "select * from customerdetails where mfin='$mfin' &&  pno='$pno'");
									$n=mysqli_num_rows($qry);
									
									if($n==0)
									{
										echo "Invalid Number";
									}
									else
									{
									while($row=mysqli_fetch_array($qry))
										{
										$hpl=$row['hpl']; }
										$qry2=mysqli_query($conn, "select * from net where mfin='$mfin' &&  hpl=$hpl");
									$nq=mysqli_num_rows($qry2);	
									if($n==0)
									{
										echo "Invalid Number";
									}
									elseif($nq==0)
									{
										header("location:register.php?hpl=$hpl");
									}
									else 
						{  echo "Account Clossed";  }
									}
								}
							?>
	  </div>
	   
</form>
</div>
</div></div>
</div></div></div> <?php include "layouts/footer.php"; ?></body></html>
