<?php include "layouts/menu.php"; ?> 
    <?php $idd=$_REQUEST['id'];?>
  <?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">
                            Repledge / Deposite / Financier Data
                        </div>
                        <div class="panel-body">
                            <div class="row">
      <!--  <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 id='$idd'");
						$row=mysqli_fetch_array($qry);
						$mfin2 = $row['mfin'];  $hpl = $row['hpl']; $hpll = $hpl + 1;
						  $pan = $row['pan'];
								$qry6=mysqli_query($conn, "select * from customerdetails where hpl='$pan' && mfin='$mfin2'");
						$row6=mysqli_fetch_array($qry6);
						$idm = $row6['id'];
						$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'];
		?>


				
<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>
<?php
$sql22 = mysqli_query($conn, "select * from finaddr where hpl='$hpl' && mfin='$mfin2' order by id asc");
$row3 = mysqli_fetch_array($sql22);
$nn = mysqli_num_rows($sql22);
$iddf = $row3['id'];

?>
	<b><font size="3.5" color="blue">Bank : <?php echo $row['name']; ?></font></br>
	<b><font size="2.5" color="blue">Repledge Name :<?php echo $row['fname']; ?></font></br>
	<b><font size="2.5" color="blue">Repledge No <?php echo $row['remarks']; ?></font></br>
		<b><font size="2.5" color="blue">App Commis <?php echo round($row['document'],0); ?></font></br>
		

 
    <a href="monudelete.php?id=<?php echo $idm; ?>"><h1>Click to See Customer details - <?php echo $pan; ?></h1></a>


</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>Cus Jewel Loan 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
$damt = $row['interest'];			
	$defamt2 = $row['defamt'];	
	$defamt = (($damt*$defamt2)/100)/30;	
?>		
<center><?php if($postt == 'MD')   { ?>
<a href="fincanled.php?id=<?php echo $row['id'];?>" class="btn btn-primary btn-xs" onclick="return confirm('Are you sure WANT TO CANCEL?');">DELETE</a>
<?php } 		$ss = $row['status'];
	if($ss == 'Closed') {
						?>
		
<a href="fineditled.php?id=<?php echo $row['id'];?>&mfin=<?php echo $row['mfin'];?>" data-toggle="tooltip" title="Led Edit!"><i class="fa fa-edit fa-2x" style="color:blue;"  aria-hidden="true"></i></a>&nbsp;&nbsp;
		<?php $ff = $row['lat']; if($ff>0) { ?>	<a href="https://www.google.com/maps/?q=<?php echo $row['lat'];?>,<?php echo $row['lang'];?>"  data-toggle="tooltip" title="Google Map !" title="Full View!" target="_blank"><i class="fa fa-map-marker fa-2x" style="color:purple;" aria-hidden="true"></i></a> <?php } ?>

				<?php }
elseif($ss == 'Reloan') { ?>
				
			
<a href="editled.php?id=<?php echo $row['id'];?>&mfin=<?php echo $row['mfin'];?>" data-toggle="tooltip" title="Led Edit!"><i class="fa fa-edit fa-2x" style="color:blue;"  aria-hidden="true"></i></a>&nbsp;&nbsp;
<a href="reloan5.php?id=<?php echo $row['id'];?>&mfin=<?php echo $row['mfin'];?>" data-toggle="tooltip" title="Clone!"><i class="fa fa-clone fa-2x" style="color:black;"  aria-hidden="true"></i></a>&nbsp;&nbsp;
<a href="udelete.php?id=<?php echo $row['id'];?>&mfin2=<?php echo $row['mfin']; ?>"  data-toggle="tooltip" title="Full View!"><i class="fa fa-feed fa-2x" style="color:navi;" aria-hidden="true"></i></a>
		<?php $ff = $row['lat']; if($ff>0) { ?>	<a href="https://www.google.com/maps/?q=<?php echo $row['lat'];?>,<?php echo $row['lang'];?>"  data-toggle="tooltip" title="Google Map !" title="Full View!" target="_blank"><i class="fa fa-map-marker fa-2x" style="color:purple;" aria-hidden="true"></i></a> <?php } ?>

				<?php }
				elseif($ss == 'Sized') { ?>
				
<a href="registerf2.php?hpl=<?php echo $row['hpl'];?>&mfin2=<?php echo $row['mfin'];?>" data-toggle="tooltip" title="Receipt!"><i class="fa fa-print fa-2x"  style="color:green;" aria-hidden="true"></i></a>&nbsp;&nbsp;
<a href="editled.php?id=<?php echo $row['id'];?>&mfin=<?php echo $row['mfin'];?>" data-toggle="tooltip" title="Led Edit!"><i class="fa fa-edit fa-2x" style="color:blue;"  aria-hidden="true"></i></a>&nbsp;&nbsp;
<a href="fullsettle2.php?hpl=<?php echo $row['hpl'];?>&mfin2=<?php echo $row['mfin'];?>" data-toggle="tooltip" title="Full Settlement!"><i class="fa fa-close fa-2x" style="color:red;"  aria-hidden="true"></i></a>&nbsp;&nbsp;	
<a href="reloan2.php?hpl=<?php echo $row['hpl'];?>&mfin2=<?php echo $row['mfin'];?>" data-toggle="tooltip" title="Reloan!"><i class="fa fa-random fa-2x" style="color:Maroon;"  aria-hidden="true"></i></a>&nbsp;&nbsp;		
<a href="reloan5.php?id=<?php echo $row['id'];?>&mfin=<?php echo $row['mfin'];?>" data-toggle="tooltip" title="Clone!"><i class="fa fa-clone fa-2x" style="color:black;"  aria-hidden="true"></i></a>&nbsp;&nbsp;			

		<?php $ff = $row['lat']; if($ff>0) { ?>	<a href="https://www.google.com/maps/?q=<?php echo $row['lat'];?>,<?php echo $row['lang'];?>"  data-toggle="tooltip" title="Google Map !" title="Full View!" target="_blank"><i class="fa fa-map-marker fa-2x" style="color:purple;" aria-hidden="true"></i></a> <?php } ?>

				<?php } else {?>
			
<a href="finregisterf2.php?hpl=<?php echo $row['hpl'];?>&mfin2=<?php echo $row['mfin'];?>" data-toggle="tooltip" title="Receipt!"><i class="fa fa-print fa-2x"  style="color:green;" aria-hidden="true"></i></a>&nbsp;&nbsp;
<a href="fineditled.php?id=<?php echo $row['id'];?>&mfin=<?php echo $row['mfin'];?>" data-toggle="tooltip" title="Led Edit!"><i class="fa fa-edit fa-2x" style="color:blue;"  aria-hidden="true"></i></a>&nbsp;&nbsp;
<a href="finfullsettle2.php?hpl=<?php echo $row['hpl'];?>&mfin2=<?php echo $row['mfin'];?>" data-toggle="tooltip" title="Full Settlement!"><i class="fa fa-close fa-2x" style="color:red;"  aria-hidden="true"></i></a>&nbsp;&nbsp;	

		<?php $ff = $row['lat']; if($ff>0) { ?>	<a href="https://www.google.com/maps/?q=<?php echo $row['lat'];?>,<?php echo $row['lang'];?>"  data-toggle="tooltip" title="Google Map !" title="Full View!" target="_blank"><i class="fa fa-map-marker fa-2x" style="color:purple;" aria-hidden="true"></i></a> <?php } ?>
	
				<?php }?>
				
				
			
					
					
   <?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");
					 
						?></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 $aaa;?></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);
					 
						?></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 > </br> 

<div class="table-responsive">
  <table class="table table-bordered table-hover"><thead>
  <tr class="info">
						<th colspan="8">Jewel Details</th>
						</tr>
  <tr class="info">
						
						
						<th>Jewel</th>
						<th>Nos</th>
						<th>H/O</th>
					  <th>T-W-T</th>
					  <th>ST/OT</th>
					  <th>G-W-T</th>
					  <th>N/W</th>
					</tr></thead><tbody>
					<tr>
<td><?php echo $row6['v1']; ?></td> <td><?php echo $row6['a1']; ?></td>  <td><?php echo $row6['c1']; ?></td>  <td><?php echo $row6['t1']; ?></td>  <td><?php echo $row6['s1']; ?></td>
<td><?php echo $row6['g1']; ?></td>  <td><?php echo $row6['n1']; ?></td>
					</tr>
					<tr>
<td><?php echo $row6['v2']; ?></td> <td><?php echo $row6['a2']; ?></td>  <td><?php echo $row6['c2']; ?></td>  <td><?php echo $row6['t2']; ?></td>  <td><?php echo $row6['s2']; ?></td>
<td><?php echo $row6['g2']; ?></td>  <td><?php echo $row6['n2']; ?></td>
					</tr>
					<tr>
<td><?php echo $row6['v3']; ?></td> <td><?php echo $row6['a3']; ?></td>  <td><?php echo $row6['c3']; ?></td>  <td><?php echo $row6['t3']; ?></td>  <td><?php echo $row6['s3']; ?></td>
<td><?php echo $row6['g3']; ?></td>  <td><?php echo $row6['n3']; ?></td>
					</tr>
					<tr>
<td><?php echo $row6['v4']; ?></td> <td><?php echo $row6['a4']; ?></td>  <td><?php echo $row6['c4']; ?></td>  <td><?php echo $row6['t4']; ?></td>  <td><?php echo $row6['s4']; ?></td>
<td><?php echo $row6['g4']; ?></td>  <td><?php echo $row6['n4']; ?></td>
					</tr>
					<tr>
<td><?php echo $row6['v5']; ?></td> <td><?php echo $row6['a5']; ?></td>  <td><?php echo $row6['c5']; ?></td>  <td><?php echo $row6['t5']; ?></td>  <td><?php echo $row6['s5']; ?></td>
<td><?php echo $row6['g5']; ?></td>  <td><?php echo $row6['n5']; ?></td>
					</tr>
					</tbody>
					</table>
						
						 <div class="table-responsive">
 	




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