<?php require_once "application_top.php"; ?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Search Blood Donors || Bihar Blood Bank</title>



<? include ("include/header.php"); ?>
	<table id="containerTable">
	<tr>
		<td width="220">
		<? require "left.php";?>
		</td>
		
		<td width="500px;">
		<br/>
		<?=$msg;?>
		<br/>
	<table width="100%" border="1" cellspacing="0" cellpadding="4">
  <tr>
   
    <td width="25%" bgcolor="#CCCCCC"><strong>Name</strong></td>
	    <td width="5%" bgcolor="#CCCCCC"><strong>Bloodgroup</strong></td>
	    <td width="20%" bgcolor="#CCCCCC"><strong>Email</strong></td>
    <td width="5%" bgcolor="#CCCCCC"><strong>State</strong></td>
    <td width="10%" bgcolor="#CCCCCC"><strong>City</strong></td>
	<td width="10%" bgcolor="#CCCCCC"><strong>Mobile</strong></td>
  </tr>
<?php

$bggroup=  $_POST['bloodgroup'];
$stateid=  $_POST['stateId'];
$cityid=  $_POST['mycity'];
$limit = $_POST['results'];


$sql = "SELECT * FROM users WHERE bloodgroup='$bggroup' AND state = '$stateid' AND city ='$cityid' LIMIT $limit";



$result = $conn->query($sql);
if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
?>
  <tr>
 
    <td width="25%"><?php echo $row["fname"]; ?></td>
      <td width="5%" ><?php echo $row["bloodgroup"]; ?></td>
      <td width="20%"><?php echo $row["email"]; ?></td>
	   <td width="5%"><?php echo $row["state"]; ?></td>
       <td width="10%"><?php echo $row["city"]; ?></td>
	   <td width="10%"><?php echo $row["mobile"]; ?></td>
  </tr>
<?php
	}
} else {
?>
<tr><td colspan="5">No results found.</td>
<?php	
}
?>
	</tr>
	</table>
<td width="220" align="right">
		<? require "right.php";?>
		</td>
	</table>
	
<? include ("include/footer.php"); ?>
