<?php  include "layouts/menu.php"; ?>
 
        <div class="right_col" role="main">
          <div class="">


            <div class="clearfix"></div>

            <div class="clearfix"></div>

            <div class="row">
      <div class="col-md-12">
       
				        <form id="demo-form2" data-parsley-validate class="form-horizontal form-label-left" method="post"  enctype="multipart/form-data">
  <div class="col-md-3">  <input type="date" class="form-control thicker" id="datepicker" name="fdate" value="<?php echo date("Y-m-d"); ?>" placeholder="From Date" onfocus="insertDate(this,'DD-MM-YYYY')">
    </div>
    <div class="col-md-3">   <input type="date" class="form-control thicker" id="datepicker" name="tdate" value="<?php echo date("Y-m-d"); ?>" placeholder="To Date" onfocus="insertDate(this,'DD-MM-YYYY')">
   </div>
   <div class="col-md-3">    <select type="text" class="form-control thicker" id="typp" name="typp" value="">
	<option value="0">All</option>
	<option value="1">Not Processed</option>
	<option value="2">Processed</option></select>
    </div>
   <div class="col-md-3">      <button type="submit" class="btn btn-info" name="s15">Show It</button></div>
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
               
                  <div class="x_content">
                    <div class="row">
                      <div class="col-sm-12">
                        <div class="card-box table-responsive">
                          
                                        <?php
		
								if(isset($_POST['s15']))
								{
									extract($_POST);
									//header("location:billrep2.php?fdate=$fdate&&tdate=$tdate");
								$fdate= $fdate; $tdate = $tdate;	
							$bal = 0; $a22 = 0; ?>
						
  <table id="datatable-buttons" id="datatable-buttons" class="table table-striped table-bordered">                            <thead>
                            
					<tr class="alert alert-info">
					<th style="width:7%">Rcpt No</th>	<th style="width:10%">Loan No</th>
						
						<th style="width:15%">Name</th>
							<th style="width:10%">Status</th>
						
						
						<th>Pay Date</th>
							<th>Total</th>
					
						<th>Prin Amt</th>
					<th>Int Amt</th>
						<th>Def Amt</th>
						<th>HL Amt</th>
			<?php  if(($postt == 'MD') || ($postt == 'Office All')) { ?> 	<th>#Options</th> <?php } ?>
			<th>Mode</th>
						<th>Created By </th>
							<th>Altered By</th>
							
					
					</tr>
                            </thead>
                           <tbody>			
					<?php $damt = 0; $pass = 0; $rno = 0; $fine = 0; $urname = 0; $hll = 0;
					//while (strtotime($fdate) <= strtotime($tdate)) 
							//	{  
						$paydate = $fdate;
					$i =0; $cass = "Cash A/C"; $ff = NULL;	
if($typp == 0) {					
	$qry=mysqli_query($conn, "select * from net where mfin='$mfin' && mode='$cass' && paydate2 between '$fdate' and '$tdate'");
}
elseif($typp == 1) {					
	$qry=mysqli_query($conn, "select * from net where mfin='$mfin' && mode='$cass' && dscode='$ff' && paydate2 between '$fdate' and '$tdate'");
}
else {					
	$qry=mysqli_query($conn, "select * from net where mfin='$mfin' && mode='$cass' && dscode!='$ff' && paydate2 between '$fdate' and '$tdate'");
}						

				$n=mysqli_num_rows($qry);
				while($row=mysqli_fetch_array($qry))
  { 
$x = $row['hpl'];
?>				<tr>
						<td><b><?php echo $row['rrno'];?></b></td>
						<td><b><?php echo $row['hpl'];?></b></td>
					
						<td><b><?php echo $row['name']; ?></b></td>
						<?php $dscode = $row['dscode'];
						if($dscode == $ff) { ?>
						<td><b><button class="btn btn-info">NotPrs</button></b></td>
						<?php } else { ?>
						<td><b><button class="btn btn-success">Procsd</button></b></td>
						<?php } ?>			
						
						<td><b><?php echo $row['paydate'];?></b></td>
						<td><b><?php echo $row['tot'];?></b></td>
						
							<td><b><?php echo $ss=$row['dueamt']  - $row['addless'];?></b></td>
						<td><b><?php echo $row['amt'];?></b></td>
						<td><b><?php echo $row['fine'];?></b></td>
						<td><b><?php echo $row['hloan'];?></b></td>
		<?php  if(($postt == 'MD') || ($postt == 'Office All')) { ?> 				<td><b>
<a href="00def2.php?hpl=<?php echo $row['hpl'];?>&mfin=<?php echo $row['mfin'];?>" class="btn btn-danger btn-xs" onclick="return confirm('Are you sure WANT TO Default Process ?');">Default Process</a>	
		<?php } ?>		 <td><b><font size="1"><?php echo $row['mode'];?></b></td>			
						<td><font size="1"><b><?php echo $row['createdate'];?></br><?php echo $row['scode'];?></b></font></td>
						<td><font size="1"><b><?php echo $row['altdate'];?></br><?php echo $row['altby'];?></b></font></td>	
					</tr> <?php   } ?>
						
  </tbody>
				<tfoot>	<tr class="alert alert-success">
					
						<td><b></b></td>
						<td><b></b></td>
						<td><font size="4" color="red"><b>Total</b></font></b></td>
						<td><b>-</b></td>
					    <td><b></b></td>
						<td><b><font size="4" color="red"><b><?php echo $urname;?></b></font></b></td>
					
						<td><b><font color="red"><?php echo $pass;?></b></font></td>
						<td><b><font color="red"><?php echo round($rno,0);?></b></font></td>
						<td><b><font color="red"><?php echo $fine;?></b></font></td>
					    <td><b><font color="red"><?php echo $hll; ?></b></font></td>
					    
					<?php  if(($postt == 'MD') || ($postt == 'Office All')) { ?> 	<td><b></b></td> <?php } ?>
						<td><b></b></td>		<td><b></b></td>	
						<td><b></b></td>
					    </tr> </tfoot>
							</table> <?php } ?>
                      
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>

              
        <!-- /page content -->

        <!-- 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>