<?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;
}

@media screen and (max-width: 600px) {
    .bb{
        margin-top:15%;
    }
    
}
</style>
		<title>INFOSSEL SOFT SOLUTIONS </title> </head>
			<body class='bb'>
  
  <?php
			  
  $hpl=$_REQUEST['hpl'];
  $vno=$_REQUEST['vno'];
  $model=$_REQUEST['model'];
  $area=$_REQUEST['area'];
  $name=$_REQUEST['name'];
  $add=$_REQUEST['add'];
  $adhaar=$_REQUEST['adhaar'];
   $broker=$_REQUEST['broker'];
  $model=$_REQUEST['model'];
   $mfin2=$_REQUEST['mfin2'];
if($hpl !=NULL)
{
	$sql=mysqli_query($conn, "select * from pending where hpl='$hpl' order by hpl asc");
		$sql2=mysqli_query($conn, "select * from pendingw where hpl='$hpl' order by hpl asc");
			$sql3=mysqli_query($conn, "select * from pendingm where hpl='$hpl' order by hpl asc");
}
elseif($vno !=NULL)
{
	$sql=mysqli_query($conn, "select * from pending where vno LIKE '%$vno%' order by hpl asc");
	$sql2=mysqli_query($conn, "select * from pendingw where vno LIKE '%$vno%' order by hpl asc");
	$sql3=mysqli_query($conn, "select * from pendingm where vno LIKE '%$vno%' order by hpl asc");
}
 elseif($area !=NULL)
{
	$sql=mysqli_query($conn, "select * from pending where area LIKE '%$area%' order by hpl asc");
	$sql2=mysqli_query($conn, "select * from pendingw where area LIKE '%$area%' order by hpl asc");
	$sql3=mysqli_query($conn, "select * from pendingm where area LIKE '%$area%' order by hpl asc");
}
 elseif($name !=NULL)
{
	$sql=mysqli_query($conn, "select * from pending where fname LIKE '%$name%' order by hpl asc");
	$sql2=mysqli_query($conn, "select * from pendingw where fname LIKE '%$name%' order by hpl asc");
	$sql3=mysqli_query($conn, "select * from pendingm where fname LIKE '%$name%' order by hpl asc");
}
 
else{
		$sql=mysqli_query($conn, "select * from pending order by hpl asc");
		$sql2=mysqli_query($conn, "select * from pendingw order by hpl asc");
	$sql3=mysqli_query($conn, "select * from pendingm order by hpl asc");
}

$n1 = mysqli_num_rows($sql);
$n2 = mysqli_num_rows($sql2);
$n3 = mysqli_num_rows($sql3);
$n = $n1 + $n2 + $n3;
 ?>
    <!--  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">Search</br></font></center></h3>
                       
                        <div class="panel-body">
                            <div class="row">
							 <div class="col-lg-6">
<table id="customers">
<thead>
<tr>

<th>Total Records Found : <?php echo $n; ?></th>

</tr></thead><tbody>
<?php while($row=mysqli_fetch_array($sql)) {
	$hpl =$row['hpl'];
	$mfin3 = $row['mfin'];
	$id = $row['id'];
		$hplt = $row['hpl'];
						$qrya=mysqli_query($conn, "select * from customerdetails where hplt='$hplt'");	
						$rowa=mysqli_fetch_array($qrya);

	?>
<a href="udelete.php?id=<?php echo $id; ?>"><tr>
<td><b><a href="udelete.php?id=<?php echo $id; ?>"><font size="2"><?php echo $row['fname']; ?></font></b></br>
<b><font size="2" color="green"><?php echo $row['area']; ?></font></a></b></br>
<b><font size="2" color="green"><?php echo $rowa['totalhpamt']; ?></font></a></b></br>
<b><font size="2" color="red"><?php echo $row['hpl']; ?> </font> <font size="2" color="red">(Dues : <?php echo $row['pendmnt']; ?>, Amt : <?php echo $row['penamt']; ?>)</font> </b></br>
<font size="2" color="blue"><?php echo $row['vname']; ?> <?php echo $row['vno']; ?></font></b></br>
<font size="2" color="orange">Daily </font></b></br>
</tr></a>


<?php } ?>

<?php while($row=mysqli_fetch_array($sql2)) {
	$hpl =$row['hpl'];
	$mfin3 = $row['mfin'];
	$id = $row['id'];

	?>
<a href="udeletew.php?id=<?php echo $id; ?>"><tr>
<td><b><a href="udeletew.php?id=<?php echo $id; ?>"><font size="2"><?php echo $row['fname']; ?></font></b></br>
<b><font size="2" color="green"><?php echo $row['area']; ?></font></a></b></br>
<b><font size="2" color="red"><?php echo $row['hpl']; ?> </font> <font size="2" color="red">(Dues : <?php echo $row['pendmnt']; ?>, Amt : <?php echo $row['penamt']; ?>)</font> </b></br>
<font size="2" color="blue"><?php echo $row['vname']; ?> <?php echo $row['vno']; ?></font></b></br>
<font size="2" color="orange">Weekly</font></b></br>
</tr></a>


<?php } ?>

<?php while($row=mysqli_fetch_array($sql3)) {
	$hpl =$row['hpl'];
	$mfin3 = $row['mfin'];
	$id = $row['id'];

	?>
<a href="udeletem.php?id=<?php echo $id; ?>"><tr>
<td><b><a href="udeletem.php?id=<?php echo $id; ?>"><font size="2"><?php echo $row['fname']; ?></font></b></br>
<b><font size="2" color="green"><?php echo $row['area']; ?></font></a></b></br>
<b><font size="2" color="red"><?php echo $row['hpl']; ?> </font> <font size="2" color="red">(Dues : <?php echo $row['pendmnt']; ?>, Amt : <?php echo $row['penamt']; ?>)</font> </b></br>
<font size="2" color="blue"><?php echo $row['vname']; ?> <?php echo $row['vno']; ?></font></b></br>
<font size="2" color="orange">Monthly </font></b></br>
</tr></a>


<?php } ?>
</tbody>

</table>


</div>

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