<?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">
                <div class="col-lg-12">
				
                    <!-- Form Elements -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                          Re-Print
                        </div>
                        <div class="panel-body">
                            <div class="row">

   <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">RCPT No.</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="hpl" value="" placeholder="E.g 1008" required>
    </div>
  </div>
  <?php $sqll = mysqli_query($conn, "select * from abc where mfin='$mfin'");
	$rowww = mysqli_fetch_array($sqll); ?>
 <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">From </label>
    <div class="col-sm-4">
      <input type="date" class="form-control" id="inputPassword3" name="fdate" value="<?php echo $rowww['date1']; ?>" placeholder="E.g 1008" required>
    </div>
  </div>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">To </label>
    <div class="col-sm-4">
      <input type="date" class="form-control" id="inputPassword3" name="tdate" value="<?php echo $rowww['date2']; ?>" 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">Print It</button>
    </div>
  </div>
      <div class="alert alert-success">
	  <?php
								if(isset($_POST['s3']))
								{
									extract($_POST);
$rno = $hpl;
$sql = mysqli_query($conn, "select * from user where mfin='$mfin' && roll='$rno' && paydate2 between '$fdate' and '$tdate'");
$n1 = mysqli_num_rows($sql);
if($n1>0)
{
$row = mysqli_fetch_array($sql);
$fid = $row['fid'];
$hpl = $row['hpl'];
$status = $row['status'];

$sur = "SOORYA MOTOR FINANCE";
$mat = "MAATHOOR FINANCE";
$sen = "SENTHOOR MOTOR FINANCE";
if($status=='Reloan') {
if($mfin == $mat) { 
echo "<script>window.open('ddeleter.php?fid=".$fid."&hpl=".$hpl."','myNewWinsr','width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no');</script>";
}
elseif($mfin == $sur) { 
echo "<script>window.open('ddeleter2.php?fid=".$fid."&hpl=".$hpl."','myNewWinsr','width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no');</script>";
}
else { 
echo "<script>window.open('ddeleter3.php?fid=".$fid."&hpl=".$hpl."','myNewWinsr','width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no');</script>";
}
}

else {
if($mfin == $mat) { 
echo "<script>window.open('ddelete.php?fid=".$fid."&hpl=".$hpl."','myNewWinsr','width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no');</script>";
}
elseif($mfin == $sur) { 
echo "<script>window.open('ddelete2.php?fid=".$fid."&hpl=".$hpl."','myNewWinsr','width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no');</script>";
}
else { 
echo "<script>window.open('ddelete3.php?fid=".$fid."&hpl=".$hpl."','myNewWinsr','width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no');</script>";
}
}


}
else{
$sql2 = mysqli_query($conn, "select * from net where mfin='$mfin' && rno='$rno' && paydate2 between '$fdate' and '$tdate'");
$n12 = mysqli_num_rows($sql2);
$row2 = mysqli_fetch_array($sql2);
$fid = $row2['id'];
$hpl = $row2['hpl'];

$sur = "SOORYA MOTOR FINANCE";
$mat = "MAATHOOR FINANCE";
$sen = "SENTHOOR MOTOR FINANCE";
if($mfin == $mat) { 
echo "<script>window.open('ddelete0.php?fid=".$fid."&hpl=".$hpl."','myNewWinsr','width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no');</script>";
}
elseif($mfin == $sur) { 
echo "<script>window.open('ddelete02.php?fid=".$fid."&hpl=".$hpl."','myNewWinsr','width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no');</script>";
}
else { 
echo "<script>window.open('ddelete03.php?fid=".$fid."&hpl=".$hpl."','myNewWinsr','width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no');</script>";
}

}	


								}
							?>
	  </div>
</form>
</div>
</div></div>
</div></div></div> <?php include "layouts/footer.php"; ?></body></html>
