<?php include "layouts/menu.php"; ?> 
   <?php $paydate=$_REQUEST['paydate'];?> 
  <!--  page-wrapper -->
         <div class="right_col" role="main">
            <div class="row">
                 <!-- page header -->
                <div class="col-lg-12">
                    <h1 class="page-header  alert alert-info">Due Details</h1>
                </div>
                <!--end page header -->
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <!-- Form Elements -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Details
                        </div>
                        <div class="panel-body">
                            <div class="row">
   <div id="mydiv">
  <input type="button" value="Print" onclick="PrintElem('#mydiv')"  style="margin:20px;">
   <div class="alert alert-info">Monthly Due</div>
  
                    <?php
					
						$qry=mysqli_query($conn, "select * from user where mfin='$mfin' &&  paydate=$paydate");
						$n=mysqli_num_rows($qry);
						if($n==0)
						{
							echo "Nothing To Display";
						}
						else
					{ 
						?></p>
					<div class="table-responsive">
  <table class="table table-bordered table-hover"><thead>
  <tr class="info">
						<th>Name</th>
						
						<th>Loan No</th>
						<th>Duemonth</th>
						<th>Duedate</th>
						<th>Dueamount</th>
						<th>Interest</th>
						<th>Amt W/o</th>
						<th>Pay Months</th>
						<th>Total Paid Months</th>
						<th>Paydate</th>
						<th>Fine</th>
						<th>Bal</th>
						<th>Amount</th>
						<th>Delete</th>
					</tr></thead>
					<?php 
					while($row=mysqli_fetch_array($qry))
						{
					?>
					<tbody><tr class="warning">
					<col width="100px">
						<td><?php echo $row['name'];?></td>
						
						<td><?php echo $row['hpl'];?></td>
						<td><?php echo $row['no'];?></td>
						<td><?php echo $row['duedate'];?></td>
						<td><?php echo $row['dueamount'];?></td>
						<td><?php echo $row['rno'];?></td>
						<td><?php echo $row['pass'];?></td>
						<td><?php echo $row['paymnt'];?></td>
						<td><?php echo $row['payyr'];?></td>
						<td><?php echo $row['paydate'];?></td>
						
						
						<td><?php echo $row['fine'];?></td>
						<td><?php echo $row['bal'];?></td>
						<td><?php echo $row['urname'];?></td>
						<td><a href="ddelete.php?hpl=<?php echo $row['hpl'];?>&name=<?php echo $row['name'];?>&fid=<?php echo $row['fid'];?>">More Info</a></td>
					</tr></tbody>
					<?php
						}
					}
				
					?>
					</table>
					<div class="alert alert-warning">Monthly Interest</div>
  
                    <?php
					
						$qry=mysqli_query($conn, "select * from user2 where mfin='$mfin' &&  paydate=$paydate");
						$n=mysqli_num_rows($qry);
						if($n==0)
						{
							echo "Nothing To Display";
						}
						else
					{ 
						?></p>
					<div class="table-responsive">
  <table class="table table-bordered table-hover"><thead>
  <tr class="warning">
						<th>Name</th>
						<th>Loan No</th>
						<th>Duedate From</th>
						<th>Duedate To</th>
						<th>Intrst</th>
						<th>Pay Amount</th>
						<th>Balance</th>
						<th>Paydate</th>
						<th>Delete</th>
					</tr></thead>
					<?php 
					while($row=mysqli_fetch_array($qry))
						{
					?>
					<tbody><tr class="warning">
					<col width="100px">
						<td><?php echo $row['name'];?></td>
						<td><?php echo $row['hpl'];?></td>
						<td><?php echo $row['duedate'];?></td>
						<td><?php echo $row['paymnt'];?></td>
						<td><?php echo $row['rno'];?></td>
						<td><?php echo $row['urname'];?></td>
						<td><?php echo $row['bal'];?></td>
						<td><?php echo $row['paydate'];?></td>
						<td><a href="mdelete.php?hpl=<?php echo $row['hpl'];?>&name=<?php echo $row['name'];?>&fid=<?php echo $row['fid'];?>">More Info</a></td>
					</tr></tbody>
					<?php
						}
					}
				
					?>
					</table>
					
					
					
					
					 <div class="alert alert-info">Due Settlements</div>
                    <?php
					
						$qry=mysqli_query($conn, "select * from net where mfin='$mfin' &&  bmnt=$paydate");
						$n=mysqli_num_rows($qry);
						if($n==0)
						{
							echo "Nothing To Display";
						}
						else
					{ 
						?></p>
					<div class="table-responsive">
  <table class="table table-bordered table-hover"><thead>
  <tr class="info">
						<th>Name</th>
						<th>Loan No</th>
						<th>Duemonth</th>
						<th>Duedate</th>
						<th>Dueamount</th>
						<th>Paid month</th>
						<th>Balance Month</th>
						<th>tot</th>
						<th>R.No</th>
						<th>Paydate</th>
						<th>Delete</th>
					</tr></thead>
					<?php 
					while($row=mysqli_fetch_array($qry))
						{
					?>
					<tbody><tr class="warning">
					<col width="100px">
						<td><?php echo $row['name'];?></td>
						<td><?php echo $row['hpl'];?></td>
						<td><?php echo $row['no'];?></td>
						<td><?php echo $row['duedate'];?></td>
						<td><?php echo $row['dueamount'];?></td>
						<td><?php echo $row['paid'];?></td>
						<td><?php echo $row['bmnt'];?></td>
						<td><?php echo $row['tot'];?></td>
						<td><?php echo $row['rno'];?></td>
						<td><?php echo $row['paydate'];?></td>
						<td><a href="fdelete.php?hpl=<?php echo $row['hpl'];?>&name=<?php echo $row['name'];?>">More Info</a></td>
					</tr></tbody>
					<?php
						}
					}
				
					?>
					</table>
					<div class="alert alert-success">Monthly Due Settlements</div>
  <?php
					
						$qry=mysqli_query($conn, "select * from net2 where mfin='$mfin' &&  bmnt=$paydate");
						$n=mysqli_num_rows($qry);
						if($n==0)
						{
							echo "Nothing To Display";
						}
						else
					{ 
						?></p>
					<div class="table-responsive">
  <table class="table table-bordered table-hover"><thead>
  <tr class="success">
						<th>Name</th>
						<th>Loan No</th>
						
						<th>Duedate</th>
						<th>Dueamount</th>
						<th>Paid month</th>
						<th>Balance Month</th>
						<th>tot</th>
						<th>R.No</th>
						<th>Paydate</th>
						<th>Delete</th>
					</tr></thead>
					<?php 
					while($row=mysqli_fetch_array($qry))
						{
					?>
					<tbody><tr class="warning">
					<col width="100px">
						<td><?php echo $row['name'];?></td>
						<td><?php echo $row['hpl'];?></td>
					
						<td><?php echo $row['duedate'];?></td>
						<td><?php echo $row['dueamount'];?></td>
						<td><?php echo $row['paid'];?></td>
						<td><?php echo $row['bmnt'];?></td>
						<td><?php echo $row['tot'];?></td>
						<td><?php echo $row['rno'];?></td>
						<td><?php echo $row['paydate'];?></td>
						<td><a href="mfdelete.php?hpl=<?php echo $row['hpl'];?>&name=<?php echo $row['name'];?>">More Info</a></td>
					</tr></tbody>
					<?php
						}
					}
				
					?>
					</table>
</div>
<div class="alert alert-info">Doc Charge</div>
  <?php
					
						$qry=mysqli_query($conn, "select * from dc where mfin='$mfin' &&  date=$paydate");
						$n=mysqli_num_rows($qry);
						if($n==0)
						{
							echo "Nothing To Display";
						}
						else
					{ 
						?></p>
					<div class="table-responsive">
  <table class="table table-bordered table-hover"><thead>
  <tr class="info">
						<th>Id</th>
					
						<th>Loan No</th>
					
						<th>CREDIT</th>
					
						<th>BROKER COMMISSION</th>
					
						<th>INCOME</th>

						<th>DATE</th>
						<th>MORE</th>
					</tr></thead>
					<?php 
					while($row=mysqli_fetch_array($qry))
						{
					?>
					<tbody><tr class="warning">
					<col width="100px">
						<td><?php echo $row['dcid'];?></td>
						
						<td><?php echo $row['hpl'];?></td>
					
						<td><?php echo $row['credit']; ?></td>
			
						<td><?php echo $row['debit'];?></td>
			
						<td><?php echo $row['bal'];?></td>
					
						<td><?php echo $row['date'];?></td>
					
						<td><a href="qdebitdel.php?dcid=<?php echo $row['dcid'];?>&debit=<?php echo $row['debit'];?>">More Info</a></td>
					</tr></tbody>
					<?php
						}
					}
				
					?>
					</table>
</div>
<div class="alert alert-danger">Debit Amount</div>
  <?php				
						$qry=mysqli_query($conn, "select * from debit where mfin='$mfin' &&  date=$paydate");
						$n=mysqli_num_rows($qry);
						if($n==0)
						{
							echo "Nothing To Display";
						}
						else
					{ 
						?></p>
					<div class="table-responsive">
  <table class="table table-bordered table-hover"><thead>
  <tr class="danger">
						<th>Id</th>
						<th></th>
						<th>Amount</th>
						<th></th>
						
						<th>Purpose</th>
						<th></th>
						<th>More Details</th>
					</tr></thead>
					<?php 
					while($row=mysqli_fetch_array($qry))
						{
					?>
					<tbody><tr class="warning">
					<col width="100px">
						<td><?php echo $row['did'];?></td>
						<td></td>
						<td><?php echo $row['debit'];?></td>
						<td></td>
						
						<td><?php echo $row['details'];?></td>
						<td></td>
						<td><a href="debitdel.php?did=<?php echo $row['did'];?>&details=<?php echo $row['details'];?>">More Info</a></td>
					</tr></tbody>
					<?php
						}
					}
				
					?>
					</table>
</div>

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