<?php include "layouts/menu.php"; ?>
		<script type="text/javascript">
	  $(function() {
   $("#datepicker").datepicker({ dateFormat: 'dd-mm-yy' });
  });
</script>
<script type="text/javascript">
function zp(n){
return n<10?("0"+n):n;
}
function insertDate(t,format){
var now=new Date();
var DD=zp(now.getDate());
var MM=zp(now.getMonth()+1);
var YYYY=now.getFullYear();
format=format.replace(/DD/,DD);
format=format.replace(/MM/,MM);
format=format.replace(/YYYY/,YYYY);
t.value=format;
}
</script>
    <script>
  $(function() {
   $("#datepicker1").datepicker({ dateFormat: 'dd-mm-yy' });
  });
  </script>
    <script>
  $(function() {
   $("#datepicker2").datepicker({ dateFormat: 'dd-mm-yy' });
  });
  </script>
      <script>
  $(function() {
   $("#datepicker8").datepicker({ dateFormat: 'dd-mm-yy' });
  });
  </script>
    <script>
  $(function() {
   $("#datepicker9").datepicker({ dateFormat: 'dd-mm-yy' });
  });
  </script>
   <script>
function add()
{
var x = document.getElementById("txt1").value;
var y = document.getElementById("txt2").value;
document.getElementById("bal").value =(x*1)-(y*1);
}
</script>
     
  <?php include "layouts/menu1.php"; ?>
            <!-- Right side column. Contains the navbar and content of the page -->
           <div class="right_col" role="main">
                <!-- Content Header (Page header) -->
               
                   <div class="panel-body">
                            <div class="row">
   <div class="alert alert-info">Document Release</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">Release Date</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="bm12" name="hpdate3" required  value="" placeholder="Date" onfocus="insertDate(this,'DD-MM-YYYY')">
    </div>   
</div>	
<div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Loan Number</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="bm12" name="hpl" required  value="" placeholder="">
    </div>   
</div>	

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

        <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-primary  btn-lg btn-block" name="s11">Register</button>
    </div>
  </div>
													<div class="alert alert-warning">
							<?php
							if(isset($_POST['s11']))
							{
								extract($_POST);
								$update = mysqli_query($conn, "update customerdetails set hpdate3='$hpdate3',status='Closed',document='Released' where mfin='$mfin' && hpl='$hpl'");
								if($update)
								{
								    
								    	$delete=mysqli_query($conn, "delete from pending where mfin='$mfin' && hpl='$hpl'");
									
									echo "Registered Successfully";
									
								}
								else
								{
									echo "Failure";
								}
							}		
							
						   
								
?>	
	  </div>
</form>


  		
					<div class="table-responsive">
					<table id="datatable-buttons" id="datatable-buttons" class="table table-striped table-bordered">
					<thead>
						<tr><th>S.No</th>
						<th>Loan No</th>
						<th>Name</th>
					<th>Make</th>	<th>Man Year</th><th>Release Date</th>
						<th>Int</th>
						<th>User Image</th>
						<th>Vehicle No</th>
							
						<th>Broker</th>
						<th>Phone No</th>
						<th>H.P Amount</th>
						<th>H.P Date</th>
							<th>Prin</th>
							<th>Interest</th><th>Dues</th>
							<th>Due Amount</th>
								<th>Created By</th>
								<th>Create Date</th>
								<th>Alt By</th>
								<th>Alt Date</th>
					</tr></thead><tbody> <?php $gg = 0; $fff = 0; $qw = NULL; $bbb = 0;
			

	$qry=mysqli_query($conn, "select * from customerdetails where mfin='$mfin' && document='Released'  order by hpl asc");
			
					$n=mysqli_num_rows($qry);
						?></p>
					
					<?php 
					while($row=mysqli_fetch_array($qry))
						{ $gg++; $fff++;
							$mfin2 = $row['mfin'];
							$paydate = $row['hpdate']; 
					?>
					
				<tr>
				<td><?php echo $fff;?></td>
						<td><?php echo $row['hpl'];?></td>
						<td><?php echo $row['name']; ?></td>
						<td><?php echo $row['vname'];?></td>	
						<td><?php echo $row['model'];?></td>
								<td><?php echo $row['hpdate3'];?></td>
						<td><?php $ffft = $row['inter']; $drd = $ffft * 12; echo round($drd,2); ?></td>
					<?php $dddd = $row['uimg']; if($dddd!= NULL) { ?>	<td><img src="user/<?php echo $row['uimg'];?>" width="40" height="40"/></td> <?php } else { ?>
					<td><img src="111.png" width="40" height="40"/></td> <?php } ?>
						<td><?php echo $row['vno'];?></td>
						
	
					<td><?php echo $row['bname'];?></td>
						<td><?php echo $row['pno'];?></td>
						<td><?php echo $row['hpamount'];?></td><td><?php echo $row['hpdate'];?></td>
						<td><?php echo $row['dueamt'];?></td>
						<td><?php echo $row['interest'];?></td><td><?php echo $row['duemnt'];?></td>
						<td><?php echo $row['total'];?></td>
						<td><?php echo $row['scode'];?></td>
	<td><?php echo $row['createdate'];?></td>
		<td><?php echo $row['altby'];?></td>
			<td><?php echo $row['altdate'];?></td>
					</tr>
					<?php
						}
				
			?></tbody>	</table>
 </div><!-- /.box -->
                        </div>
                    </div>

                </section><!-- /.content -->
            </aside><!-- /.right-side -->
        </div><!-- ./wrapper -->
     <!-- footer content --> 
        <footer>
          <div class="pull-right">
             <a href="https://infossel.com">Infossel Soft Solution</a>
          </div>
          <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->
      </div>
    </div>

    <!-- jQuery -->
    <script src="vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="vendors/nprogress/nprogress.js"></script>
    <!-- iCheck -->
    <script src="vendors/iCheck/icheck.min.js"></script>
    <!-- Datatables -->
    <script src="vendors/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="vendors/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
    <script src="vendors/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
    <script src="vendors/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
    <script src="vendors/datatables.net-buttons/js/buttons.flash.min.js"></script>
    <script src="vendors/datatables.net-buttons/js/buttons.html5.min.js"></script>
    <script src="vendors/datatables.net-buttons/js/buttons.print.min.js"></script>
    <script src="vendors/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js"></script>
    <script src="vendors/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
    <script src="vendors/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="vendors/datatables.net-responsive-bs/js/responsive.bootstrap.js"></script>
    <script src="vendors/datatables.net-scroller/js/dataTables.scroller.min.js"></script>
    <script src="vendors/jszip/dist/jszip.min.js"></script>
    <script src="vendors/pdfmake/build/pdfmake.min.js"></script>
    <script src="vendors/pdfmake/build/vfs_fonts.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="build/js/custom.min.js"></script>

  </body>
</html>