<?php
require_once "include/dbconnect.php"; 
session_start();
if (!isset($_SESSION['username'])){
header('location:login.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>Bihar Blood Bank</title>

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

	<table id="containerTable" border="0">
	<tr>
		<td width="220">
		<? require "left.php";?>
		</td>
		
		<td width="550px;text-align:center;">
		
		<h1>My Account</h1>
		
		<?=$msg;?>
		
		<div id="form">


<?php
$ud_id=$_POST['username'];
$ud_ipass=$_POST['ipassword'];
$ud_firstname=$_POST['fname'];
$ud_lastname=$_POST['email'];
$ud_birthday=$_POST['ydob'];
$ud_bloodgroup=$_POST['bloodgroup'];
$ud_mobile=$_POST['mobile'];
$ud_dayphone=$_POST['dayphone'];

$ud_gender=$_POST['gender'];
$ud_weight=$_POST['weight'];


$sql = " UPDATE users SET fname='$ud_firstname' , email='$ud_lastname' , mobile='$ud_mobile' , dayphone='$ud_dayphone' , weight='$ud_weight'  WHERE username='$ud_id'";

if ($conn->query($sql) === TRUE) {
echo "<div class='msg'>Record Updated</div>";
} else {
    echo "<div class='msg'>Error Updating Record</div>";
}






?>





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