<?
//error_reporting(E_ERROR);
?>
<?php require_once "application_top.php"; 
require_once "include/dbconnect.php";


$UserName = $_SESSION['username'];




$query = "SELECT * FROM users where username='$UserName'";
$result = $conn->query($query);
$num = mysqli_num_rows($result);


if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {

   $firstname=$row["fname"];
$lastname=$row["email"];
$birthday=$row["ydob"];
$bloodgroup=$row["bloodgroup"];
$mobile=$row["mobile"];
$dayphone=$row["dayphone"];
$state=$row["state"];
$city=$row["city"];
$usr=$row["username"];
$ipassword=$row["ipassword"];
$gender=$row["gender"];
$weight=$row["weight"];






?>	

	
	

<!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>
      <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js' type='text/javascript'></script>
   
      <link rel='stylesheet' type='text/css' href='style/donor.css'/>

<?php include ("include/header.php"); ?>

	<table id="containerTable" border="0">
	<tr>
		<td width="220">
		<? require "left.php";?>
		</td>
		
		<td width="500px;text-align:center;">
		
		<h1>Edit And Submit Form</h1>
		
		<?=$msg;?>


		<div id="form">
		
		

<!---Form starts Here---->


<table width="400" cellpadding="1" cellspacing="1" style="background:#DA1D26; font-size:15px; color:#fff;"><tr align="center" valign="top">


<form action="donor_dataprocess.php" method="post">
<input type="hidden" name="username" value="<? echo "$UserName" ?>">
 <tr>
    <td width="198">FirstName:</td>
    <td width="193"><input type="text" name="fname" value="<? echo "$firstname"?>"></td>
  </tr>
  <tr>
    <td>Email:</td>
    <td> <input type="text" name="email" value="<? echo "$lastname"?>"></td>
  </tr>
   <tr>
    <td>Mobile:</td>
    <td><input type="text" name="mobile" value="<? echo "$mobile"?>">
    </td>
  </tr>
   <tr>
    <td>Alternate No.:</td>
    <td><input type="text" name="dayphone" value="<? echo "$dayphone"?>"></td>
  </tr>
 
  
      <tr>
    <td>UserName:</td>
    <td><input type="text" name="username" value="<? echo "$usr"?>">
    </td>
  </tr>
    <tr>
    <td>Password:</td>
    <td> <input type="text" name="ipassword" value="<? echo "$ipassword"?>">
    </td>
  </tr>
    <tr>
    <td>Weight:</td>
    <td><input type="text" name="weight" value="<? echo "$weight"?>">
    </td>
  </tr> <tr>
    <td>&nbsp;</td>
    <td> <input type='Submit' name='Submit' id='Submit' src='images/submit.png' alt='Update'/>
    </td>
  </tr>
</table>


<?php
}

 }
?>



<br>
	</div>
</div>
		
		</td>
		
		<td width="220" align="right">
		<? require "right.php";?>
		</td>
	</tr>
	</table>






<?php include ("include/footer.php"); ?>
