<?php include "layouts/menu.php"; ?> 
    <?php $hpl=$_REQUEST['hpl'];?>
  <?php $mfin2=$_REQUEST['mfin2'];?>
  <!--  page-wrapper -->
    <link href="vendors/pnotify/dist/pnotify.css" rel="stylesheet">
    <link href="vendors/pnotify/dist/pnotify.buttons.css" rel="stylesheet">
    <link href="../vendors/pnotify/dist/pnotify.nonblock.css" rel="stylesheet">
  <style> 
input[type=text] {
    width: 100%;
   
    box-sizing: border-box;
    border: 1px solid #555;
    outline: Gray;
	
}

input[type=text]:focus {
    background-color: #d1e0e3;
}

.div1 {
    width: 100%;
    height: 100%;
       border: 4px solid #ff3d39;
    background-color: #69f7db;
	float:center;
}

.div2 {
    width: 380px;
    height: 240px;    
background-color:#f4f6df;
    border: 4px solid #376ca1;
	float:right;
}
label {
  
  color: black;
  font-weight: bold;
  
}
td,th{
  
  color: black;
  font-weight: bold;
  
}

</style>

         <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">
                            Customer Details
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <input type="button" value="Print" onclick="PrintElem('#mydiv')"  style="margin:20px;"><div id="mydiv">
      <!--  <div id="mydiv">
  <input type="button" value="Print" onclick="PrintElem('#mydiv')"  style="margin:20px;">
   <form name="form1" method="post" action="" enctype="multipart/form-data"> -->
<?php
						$qry=mysqli_query($conn, "select * from fincust where hpl='$hpl'");
						$row=mysqli_fetch_array($qry);
						$mfin2 = $row['mfin'];  $hpl = $row['hpl']; $hpll = $hpl + 1;
						$qry1=mysqli_query($conn, "select * from finuser where mfin='$mfin2' &&  hpl='$hpl'");
					$n1=mysqli_num_rows($qry1);
					$row1=mysqli_fetch_array($qry1);
				$remarks = $row['remarks'];
		if($remarks!=NULL){
echo '<script language="javascript">';
echo 'alert("'.$remarks.'")';
echo '</script>'; } 	?>


				
<div class="col-md-12 div1">
<div class="col-md-4">
<font color="brown" size="3"><b>A/C No : <?php echo $row['hpl'];?></b></font></br>
<b><font size="2.5" color="blue"> <?php echo $row['name']; ?></font></br>
	<b><font size="2.5" color="blue">S/O <?php echo $row['fname']; ?></font></br>
	<b><font size="2.5" color="blue"><?php echo $row['address']; ?> <?php echo $row['address1']; ?> <?php echo $row['address2']; ?></font></br>
	
</div>
<div class="col-md-2">
<?php $imgg = $row['uimg']; 
if($imgg != NULL) { 
?>
<img src="finuser/<?php echo $row['uimg']; ?>" width="120px" height="120px" style=" border-radius: 60%;" >
<?php } ?> </br> </br></br>

<?php $imgg = $row['img']; 
if($imgg != NULL) { 
?>
<img src="finuser/<?php echo $row['img']; ?>" width="120px" height="120px"  style=" border-radius: 60%;" >
<?php } ?>
</b></font>

</div>



<div class="col-md-6">
<table border="0">
<tr><td>Loan_Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><font color="red" size="2"><?php echo $row['hpdate'];?></td></tr>
<tr><td>Loan Amt</td><td>&nbsp;&nbsp;&nbsp;</td><td><font color="red" size="2"><?php echo $row['hpamount'];?></td></tr>

<tr><td>Interest Percent</td><td>&nbsp;&nbsp;&nbsp;</td><td><font color="red" size="2"><?php echo $row['inter'];?></td></tr>
<tr><td>Int Per Month</td><td>&nbsp;&nbsp;&nbsp;</td><td><font color="red" size="2"><?php echo $row['interest'];?> </td></tr>

<tr><td>Pan Car No </td><td>&nbsp;&nbsp;&nbsp;</td><td><font color="red" size="2"><?php echo $row['pan'];?> </td></tr>
<tr><td>Phone</td><td>&nbsp;&nbsp;&nbsp;</td><td><font color="red" size="2"><?php echo $row['pno'];?> </td></tr>
<tr><td>Bank Holder Name</td><td>&nbsp;&nbsp;&nbsp;</td><td><font color="red" size="2"><?php echo $row['accname'];?></td></tr>
<tr><td>Bank Name</td><td>&nbsp;&nbsp;&nbsp;</td><td><font color="red" size="2"><?php echo $row['bankname'];?></td></tr>

<tr><td>Account No </td><td>&nbsp;&nbsp;&nbsp;</td><td><font color="red" size="2"><?php echo $row['bankno'];?> </td></tr>
<tr><td>IFSC CODE</td><td>&nbsp;&nbsp;&nbsp;</td><td><font color="red" size="2"><?php echo $row['ifsc'];?> </td></tr>
<tr><td>BRANCH</td><td>&nbsp;&nbsp;&nbsp;</td><td><font color="red" size="2"><?php echo $row['branch'];?></td></tr>

<b>

</b></font> <?php $pno = $row['pno']; ?>
</table>
</div>


</div>



		
			
 
   <?php $a1 = 0;  $a2 = 0;   $a3 = 0;   $a4 = 0;   $a5 = 0; 
		$qry1=mysqli_query($conn, "select * from finuser  where mfin='$mfin2' &&  hpl='$hpl' order by paydate2 asc");
					if($n1==0)
						{
							echo "Nothing To Display";
						}
						else
					{ 
						?></p>
					<table class="table table-striped" table class="table" border="0" align="center" cellspacing="0" cellpadding="10" >
					<col width="100px">
					 <tr class="alert alert-info">
					<th style="width:7%">Rcpt No</th>	
							<th style="width:10%">Status</th>
						
						
						<th>Pay Date</th>
							<th>Total</th>
						<th>Due Amt</th>
						<th>Princ</th>
						<th>Intst</th>
						<th>Fine</th>
						<th>HLoan</th>	<th>Reloan</th>
				<th>#Edit</th>
			
						<th>Create </th>
							<th>Altered</th>
					
					</tr>
					
					<?php $i = 0; 
					
				while($row=mysqli_fetch_array($qry1)) 	
					{ 
					$i++;
					 $aaa  = $row['urname'];
					 $sts = $row['status'];
$sts2 = "Reloan";
?>				<tr>
					<td><b><?php echo $row['roll'];?></b></td>
						
						 <?php if($sts == $sts2){ ?>
<td><b><a href="editrcpt.php?fid=<?php echo $row['fid'];?>"><button class="btn btn-warning">Reloan</button></a></b></td>
						 <?php } else { ?>
			<td><b><a href="editrcpt.php?fid=<?php echo $row['fid'];?>"><button class="btn btn-success">Due</button></a></b></td>			 
						 <?php } ?>
				
						
						<td><b><?php echo $row['paydate'];?></b></td>
							<td><b><?php echo round($aaa,0);?></b></td>
						<td><b><?php echo $row['dueamount'];?></b></td>
						<td><b><?php echo $row['pass'];?></b></td>
						<td><b><?php echo $row['rno'];?></b></td>
						<td><b><?php echo $row['fine'];?></b></td>
						<td><b><?php echo $row['hloan'];?></b></td>
					
					<td><b><?php echo $row['rloan'];?></b></td>
						<?php $damt = $damt + $row['dueamount']; $pass = $pass + $row['pass']; $rno = $rno + $row['rno']; 
						$fine = $fine + $row['fine']; $hll = $hll + $row['hloan']; $bal = $bal + $row['bal'];$a22 = $a22 + $a2; $urname = $urname + $aaa; ?>
					    
				<td><b>
<a href="fincancel.php?fid=<?php echo $row['fid'];?>" class="btn btn-primary btn-xs" onclick="return confirm('Are you sure WANT TO CANCEL?');">Cancel</a></b></td>	

						<td><b><font size="1"><?php echo $row['createdate'];?></br>
						<?php echo $row['scode'];?></font>
						</b></td>
						<td><b><font size="1"><?php echo $row['altdate'];?></br><?php echo $row['altby'];?></b></font></td>
		</tr>  <?php 
					}
					}
					?>
				
						</table>

					      <?php
						$qry=mysqli_query($conn, "select * from finnet where mfin='$mfin2' &&  hpl='$hpl'");
						$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 style="width:7%">Rcpt No</th>	
							<th style="width:10%">Status</th>
						
						
						<th> 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>Created By </th>
							<th>Altered By</th>
					
					</tr>
					</tr></thead>
					<?php 
					while($row=mysqli_fetch_array($qry))
						{
					?>
					<tbody><tr class="warning">
					
									<td><b><?php echo $row['rrno'];?></b></td>

						<td><b><a href="editsettle.php?fid=<?php echo $row['id'];?>"><button class="btn btn-danger">Close</button></a></b></td>
						
						
						<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	 $pass = $pass + $ss; $rno = $rno + $row['amt']; 
						$fine = $fine + $row['fine']; $urname = $urname + $row['tot']; 
						 $hll = $hll + $row['hloan'];
						?>
						
				
<?php  if(($postt == 'MD') || ($postt == 'Office All')) { ?> 
<td><b>
<a href="fincancel2.php?fid=<?php echo $row['id'];?>" class="btn btn-primary btn-xs" onclick="return confirm('Are you sure WANT TO CANCEL?');">Cancel</a></b></td>					
<?php } ?>
						<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></tbody>
					<?php
						}
					}
					?>				
					</table>
						</div > 





 </form></div>	
</div>	</div>						
</div>
</div></div>
		  
		  
		  </div>     </div>
                <!-- end of weather widget -->
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->

        <!-- footer content -->
       <script src="vendors/pnotify/dist/pnotify.js"></script>
    <script src="vendors/pnotify/dist/pnotify.buttons.js"></script>
    <script src="vendors/pnotify/dist/pnotify.nonblock.js"></script>
	   <?php include "layouts/footer.php"; ?>
  </body>
</html>
