<?php ob_start(); session_start(); ?>
	<!DOCTYPE html>
	<html>
	<?php include "../layouts/db_connect.php"; ?>
	<?php 
if(isset($_SESSION['code'])) {
	  $code = $_SESSION['code'];
	  $scode = $_SESSION['code'];
	   
		$staff = $_SESSION['name'];
		 $postt = $_SESSION['postt'];
		  $mfin222 = $_SESSION['mfin222'];
	} 
	?>
		<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		
		<!-- Meta, title, CSS, favicons, etc. -->
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta http-equiv="X-UA-Compatible" content="chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1">
<style>

table, th, td {
    border: 1px solid black;
}
#customers {
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    border-collapse: collapse;
    width: 100%;
}

#customers td, #customers th {
    border: 1px solid #ddd;
    padding: 8px;
}

#customers tr:nth-child(even){background-color: #f2f2f2;}

#customers tr:hover {background-color: #ddd;}

#customers th {
    padding-top: 12px;
    padding-bottom: 12px;
    text-align: left;
    background-color: #4CAF50;
    color: white;
}
</style>
		<title>INFOSSEL SOFT SOLUTIONS </title> </head>
		<body>
  
  <?php 		  
  $idd=$_REQUEST['id'];
	$sql=mysqli_query($conn, "select * from pending where id=$idd");
$row=mysqli_fetch_array($sql);
$n = mysqli_num_rows($sql);
 ?>
    <!--  page-wrapper -->
         <div class="right_col" role="main">

            <div class="row">
                <div class="col-lg-12">
                    <!-- Form Elements -->
                    <div class="panel panel-default">
                       
                         <h3><center><font face="Courier New" color="red">Pending</br>
                    <a href="udelete5.php?id=<?php echo $idd; ?>">With Photo</a></br>
                    <a href="udeletel.php?id=<?php echo $idd; ?>"><b></b>Live Data</b></a>
                    </font></center></h3>
                       
                        <div class="panel-body">
                            <div class="row">
							 <div class="col-lg-6">
<table id="customers">
<thead>
<tr>
<?php 
	$hpl =$row['hpl'];
	$mfin3 = $row['mfin'];
	$mfin4 =  $row['mfin'];
	if($mfin3=='SENTHOOR MOTOR FINANCE')
	{
	$mfin4 = 'SENTHOOR MOTOR FINANCE';
	}
	else {
	$mfin4 = 'SOORYA MOTOR FINANCE';
	}
	
$sql2 = mysqli_query($conn, "select * from customerdetails where hpl='$hpl' && mfin='$mfin3'");
$row2 = mysqli_fetch_array($sql2);
$sql24 = mysqli_query($conn, "select * from sizzing where hpl='$hpl' && mfin='$mfin3'");
$nnn = mysqli_num_rows($sql24);
if($nnn>0){
	?>
	<button class="btn btn-danger">Seized Vehicle List</button>
	<?php
}
?>
<th><b><?php echo $row2['name']; ?> : <?php echo $row['hpl']; ?></b></th>

</tr></thead><tbody>

<tr><td><b><font size="2">
 <?php
$sql22 = mysqli_query($conn, "select * from addr where hpl='$hpl' && mfin='$mfin4' order by id asc");
$row3 = mysqli_fetch_array($sql22);
$nn = mysqli_num_rows($sql22);
$iddf = $row3['id'];

if($nn>0) {

$iddf = $row3['id'];
for($i=1;$i<7;$i++){
	$iddf++;
$sql223 = mysqli_query($conn, "select * from addr where id='$iddf'");
$row33 = mysqli_fetch_array($sql223);
	?>
<b><font size="2" color="blue"><?php echo $row33['addr']; ?></font></b></br>
<?php } }  

$sql22 = mysqli_query($conn, "select * from addr where hpl='$hpl' && mfin='$mfin4' order by id asc");
$row3 = mysqli_fetch_array($sql22);
$nn = mysqli_num_rows($sql22);
$iddf = $row3['id'];

if($nn>0) {
?>
<b><font size="2" color="black">Work Address : </font></b></br>
<?php
$iddf = $row3['id'];
for($i=1;$i<7;$i++){
	$iddf++;
$sql223 = mysqli_query($conn, "select * from addr where id='$iddf' order by id asc");
$row33 = mysqli_fetch_array($sql223);
	?>
<b><font size="2" color="blue"><?php echo $row33['oadd']; ?></font></b></br>
<?php } }  ?>
<b><font size="4" color="red"><a href="#<?php echo $row['pno']; ?>">Phone : <?php echo $row2['pno']; ?></a> </font>  </b></br>
<font size="3" color="blue">Phone Office : <?php echo $row2['pnooffice']; ?></br>
Phone Resi :  <?php echo $row2['pnoresi']; ?></font></b></br>
</td></tr>

<tr>
<td><b><font size="2">Area : <?php echo $row2['area']; ?></font></b></td>
</tr>

<th><b>Co-Oblicant : <?php echo $row2['cobname']; ?></b></th>
<tr><td><b><font size="2">
 <?php
$sql22 = mysqli_query($conn, "select * from addr where hpl='$hpl' && mfin='$mfin4' order by id asc");
$row3 = mysqli_fetch_array($sql22);
$nn = mysqli_num_rows($sql22);
if($nn>0) {
$iddf = $row3['id'];
for($i=1;$i<7;$i++){
	$iddf++;
$sql22 = mysqli_query($conn, "select * from addr where id='$iddf'");
$row3 = mysqli_fetch_array($sql22);
	?>
<b><font size="2" color="orange"><?php echo $row3['co']; ?></font></b></br>
<?php } } ?>

</td></tr>

<th><b>Vehicle : <?php echo $row['vno']; ?></b></th>
<tr>
<td><b><font size="2">Vehicle : <?php echo $row2['vname']; ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">Model : <?php echo $row2['model']; ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">Color  : <?php echo $row2['color']; ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">Engine No  : <?php echo $row2['eno']; ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">Chasis No   : <?php echo $row2['cno']; ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">Broker   : <?php echo $row2['bname']; ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">Dealer   : <?php echo $row2['dealer']; ?></font></b></td>
</tr>

<th><b>Loan : <?php echo $row2['hpl']; ?> - <?php echo $row2['name']; ?></b></th>

<tr>
<td><b><font size="2">Loan Date   : <?php echo $row2['hpdate']; ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">Loan Amount   : <?php echo $row2['hpamount']; ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">Due Amt   : <?php echo $row2['total']; ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">Total Dues  : <?php echo $row2['duemnt']; ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">Paid Dues  : <?php echo $row['paymnt']; ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">Pend Dues  : <?php echo $row['pendmnt']; ?></font></b></td>
</tr><?php
$a = $row['defamt'];
$b =  $row['penamt'];
$c = $row['hloan'];
$tott = $b - $a - $c;
?>
<tr>
<td><b><font size="2">Pend Amt  : <?php echo round($tott,0); ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">Def Amount  : <?php echo round($row['defamt'],0); ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">HL Amt  : <?php echo $row['hloan']; ?></font></b></td>
</tr>

<tr>
<td><b><font size="2">Total Pend  : <?php echo $row['penamt']; ?></font></b></td>
</tr>
<tr>
<td><b><font size="2">Last Paid  : <?php echo $row['lddate']; ?></font></b></td>
</tr>


</tbody>

</table>


</div>

</div></div>
</div></div></div></div></div></div> </body></html>
