<? require_once "application_top.php"; ?>
<? require_once "include/dbconnect.php"; ?>
<?
$wheresql = " where status = '1' ";
$breadcrumb = "";


if(isset($_REQUEST['stateId']) && ($_REQUEST['stateId'])){
	$wheresql .= "and state = '".$_REQUEST['stateId']."' ";
	$breadcrumb .= "State: <b>" . $_REQUEST['stateId']."</b>";
}
if(isset($_REQUEST['mycity']) && ($_REQUEST['mycity'])){
	$wheresql .= "and city = '".$_REQUEST['mycity']."' ";
	$mycityexp = explode("_",$_REQUEST['mycity']);
	$breadcrumb .= "&nbsp;&nbsp;MyCity: <b> " . $mycityexp[1]."</b>";
}
if(isset($_REQUEST['bloodgroup']) && ($_REQUEST['bloodgroup'])){
	$wheresql .= "and bloodgroup = '".$_REQUEST['bloodgroup']."'";
	$breadcrumb .= "&nbsp;&nbsp;Bloodgroup: <b>" .$_REQUEST['bloodgroup']."</b>";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Bihar Blood Bank</title>
<? include ("include/header.php"); ?>
	<table id="containerTable">
	<tr>
		<td width="220">
		<? require "left.php";?>
		</td>
		
		<td width="500px;">
		
		<br/><br/>
		<?=$breadcrumb;?>
			<?
			//---------------pagination BOF---------------------------------------
			$column_name = "uid,fname,ddob,mdob,ydob,bloodgroup,mobile,dayphone,evephone,chkSMS,state,city,town,how_often,username,ipassword,gender,weight,email,dlast,mlast,ylast,chkHideMobile,suffered1,postedon";
			//$from_where = " from users ".$wheresql." ";
			
            
            
			$extra = $_SERVER['QUERY_STRING'];
			$adjacents = 3;
			$limit = 20; 							//how many items to show per page
			$targetpage = $_SERVER['PHP_SELF']; 	//your file name  (the name of this file)
			require "pagination.php";
			$cnt = 1;
			$bg = "";
			while($row = mysql_fetch_array($result))
            			{
				$bg = ($bg == "#ffffff")? "#eeeeee" : "#ffffff";
				//--------------pagination EOF----------------------------------------

				
				$myct = explode("_",$row['city']);
				
				?>
				<div style="padding:10px;border:1px solid; background-color:#eeeeee; margin-bottom:10px;">
					<table border=0 id="searchlistTable">
					<tr>
						<th>Id:</th><td colspan="2"><? echo $row['uid'];?></td>
					</tr>
					<tr>
						<th>Name:</th><td width="200"><? echo $row['fname'];?></td><th>Gender:</th><td><? echo $row['gender'];?></td>	
					</tr>
					<tr>
						<th>City</th><td><? echo $myct[1];?></td><th>Mobile No.</th><td><? echo $row['mobile'];?></td>	
					</tr>
					<tr>
						<th></th><td></td><th>Residence No.</th><td><? echo $row['dayphone'];?></td>	
					</tr>
					</table>
				</div>
				<?
				$cnt++;
			}
		
        if(!$cnt){
    			?>
				<div style="padding:10px;border:1px solid; background-color:#eeeeee; margin-bottom:10px;">
				Sorry No matching results found, Please try again.
				</div>
				<?
			}

        
			?>
			Total Results found: <?=$cnt;?>
			
			<center><?=$pagination?></center>

		</td>
		
		<td width="220" align="right">
		<? require "right.php";?>
		</td>
	</tr>
	</table>
	
<? include ("include/footer.php"); ?>