<? require_once "config.php"; ?>
<style type="text/css">
/* places the content ontop of the background image */
#content {position:relative; z-index:1; width:100%;}
</style>
<!--[if IE 6]>
<style type="text/css">
/* some css fixes for IE browsers */
html {overflow-y:hidden;}
body {overflow-y:auto;}
#bg {position:absolute; z-index:-1;}
#content {position:static;}
</style>
<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="<?=HTTP_SERVER;?>include/styles.css" rel="stylesheet" type="text/css" media="all">

<script type="text/javascript" src="js/jquery.validate.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>

<script type="text/javascript">
$(document).ready(function(){
	$("#stateId").change(function(){
		var stateId = $("#stateId").val();
		$("#cityDiv").html("<img src='images/loader.gif' align='absmiddle'/>");
		$.ajax({url:"include/cities.php?stateId="+stateId, success:function(result){ $("#cityDiv").html(result);}, error:function($resulte){ alert("error")} });
	});	
	
	$("#stateId2").change(function(){
		var stateId = $("#stateId2").val();
		$("#cityDiv2").html("<img src='images/loader.gif' align='absmiddle'/>");
		$.ajax({url:"include/cities.php?stateId="+stateId, success:function(result){ $("#cityDiv2").html(result);}, error:function($resulte){ alert("error")} });
	});	
	
	$("#newfrm").validate();
	
	$("#invitefrm").validate();
	
	$(".checkavail").click(function(){
		var username = $("#username").val();
		$("#checkavailDiv").html("<img src='images/loader.gif' align='absmiddle'/>");
		$.ajax({url:"checkavailusername.php?username="+username, success:function(result){ $("#checkavailDiv").html(result);}, error:function($resulte){ alert("error occured")} });
	});	
	
});

function searchformval(){
	if($("#bloodgroup").val() == ""){
		alert("Please select bloodgroup.")
		$("#bloodgroup").focus();
		return false;
	}
}

function loginval(){
	if($("#donorusername").val() == ""){
		alert("Please enter username.")
		$("#donorusername").focus();
		return false;
	}
	if($("#ipassword").val() == ""){
		alert("Please enter password.")
		$("#ipassword").focus();
		return false;
	}
}

</script>
<?php include_once("analytics.php") ?>

</head>

<body>
<table style="margin:0 auto; width:980px" border="0">
<tr>
	<td width="230"><a href="index.php"><img src="<?=HTTP_IMAGES;?>logo.png" border="0"/></a></td>
	<td style="vertical-align:bottom;padding-bottom:5px;">A social initiative of Maa Vaishno Devi Seva Samiti(Bihar)</td>
	<td width="240" style="text-align:right">
	<? if(isset($_SESSION['uid']) && ($_SESSION['uid'])){ 
		?><a href="update_data.php">My Account</a> | <a href="logout.php">logout</a> <?
		}else{
	?>





    <form action="login.php" method="post">
<table>
		<tr>     <td>     
<a href ="login.php" >LOGIN HERE</a></td> 
         </tr>
		<tr>
			<td>  	
			<br />
        

</td>
		</tr>
		<tr>
			<td colspan="2" align="right"></td>
		</tr>
		</table>








	<? } ?>
	</td>
</tr>
</table>
<table style="margin:0 auto; width:980px; height:32px; border-spacing: 0px;" border="0">
<tr>
	<td style="background:url('<?=HTTP_IMAGES;?>topbannerred.png'); color:#ffffff; text-align:center;">
	<a href="registration.php" class="toplink">Free Register</a> | 
<a href="login.php" class="toplink">Donor Login</a> |
	<a href="invite-your-friends.php" class="toplink">Invite your friends</a> | 
	<a href="donors-speak.php" class="toplink">Donor's speak</a> | 
	<a href="blood-donation-eligibility.php" class="toplink">Blood Donation Eligibility</a> | 
	<a href="gallery.php" class="toplink">Gallery</a> | 
	<a href="blood-bank-numbers.php" class="toplink">Blood Bank Numbers</a> | 
	<a href="contact-us.php" class="toplink">Contact us</a> 
	</td>
</tr>
</table>
<table style="margin:0 auto; width:980px; height:159px; border-spacing: 0px;" border="0">
<tr>
	<td style="background:url('<?=HTTP_IMAGES;?>topbannerblack.jpg');"></td>
</tr>
</table>

<form id="form1" name="form1" method="post" action="search.php">

<table id="searchinputTable" style="margin:0 auto; margin-top:4px; width:980px; height:32px; background-color:#DA261D; color:#ffffff;">
<tr>
	<td width="10%">&nbsp;&nbsp;&nbsp;<b>Find a Donor</b></td>
	
	<td>Group</td>
	<td width="15%">
			<select name="bloodgroup" id="bloodgroup" value="" class="required">
<option value="">--</option>
<?php
	$sql = "SELECT * FROM ".$SETTINGS["data_table"]." GROUP BY bloodgroup ORDER BY bloodgroup";
	$sql_result = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query" '.$sql);
	while ($row = mysql_fetch_assoc($sql_result)) {
		echo "<option value='".$row["bloodgroup"]."'".($row["bloodgroup"]==$_REQUEST["bloodgroup"] ? " selected" : "").">".$row["bloodgroup"]."</option>";
	}
?>
</select>
		
	</td>
	<td>State ID</td>
	<td width="10%">
<select name="state">
	<option value="">--</option>
<?php
	$sql = "SELECT * FROM ".$SETTINGS["data_table"]." GROUP BY state ORDER BY state";
	$sql_result = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query" '.$sql);
	while ($row = mysql_fetch_assoc($sql_result)) {
		echo "<option value='".$row["state"]."'".($row["state"]==$_REQUEST["state"] ? " selected" : "").">".$row["state"]."</option>";
	}
?>
</select>
	
	
	</td>
	<td>City</td>
	<td width="15%">
<select name="city">
	<option value="">--</option>
<?php
	$sql = "SELECT * FROM ".$SETTINGS["data_table"]." GROUP BY city ORDER BY city";
	$sql_result = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query" '.$sql);
	while ($row = mysql_fetch_assoc($sql_result)) {
		echo "<option value='".$row["city"]."'".($row["city"]==$_REQUEST["city"] ? " selected" : "").">".$row["city"]."</option>";
	}
?>
</select>
	</td>
	<td>Results</td>
	<td width="15%">
	<select name="results">
<option>5</option>
	<option>10</option>
	<option>20</option>
	<option>40</option>
	<option>80</option>
	<option>120</option>
	<option>240</option>
<option>320</option>
<option>400</option>
	</select><br>	
	</td>
	<td width="20%">
	
<a href="search.php"><img src="<?=HTTP_IMAGES;?>reset.png" alt="Reset" /></a>
  &nbsp;
	<input type="image" src="<?=HTTP_IMAGES;?>search.png" name="button" id="button" value="Submit" />
  
  </td>
</form>

</tr>
</table>
</form>