<?php session_start();?>

<?php
	if($_SESSION ["role"]=="Administrator")
	{
		$role = $_SESSION["role"];
		$email = $_SESSION["email"];
		// header('location:form.php');
	}
	else
	{
		header('location:index.php?expired session please login back');
		// $userName = $_SESSION["userName"]; $userRole = $_SESSION["userRole"];
		}
?>

<?

require ("_common/global.php");
require ("_common/conn.php");
//require ("_common/function.php");
require ("_common/check_session.php");
?>
<?php
$id =$_REQUEST['id'];
$email =$_SESSION['email'];
	$conn = mysql_connect('localhost', 'dvsvigov_vacc', 'DVSvacdos123');
	 if (!$conn)
    {
	 die('Could not connect: ' . mysql_error());
	}
	mysql_select_db("dvsvigov_vacdos", $conn);
$result = mysql_query("SELECT * FROM user WHERE id  = '$id'");
$test = mysql_fetch_array($result);

	$name = $_POST['name'];
	$post = $_POST['post'];
	$phone = $_POST['phone'];
	$pass = $_POST['pass'];
	$role = $_POST['role'];
	$status = $_POST['status'];
	
		
	mysql_query("UPDATE IGNORE user SET name='$name',  post='$post', phone='$phone', pass='$pass', role='$role', status='$status' WHERE id = '$id'")
				or die(mysql_error());
				
	
	
						
			//echo "<script>	alert('Records saved');</script>";
		//window.location.href='myproject.php';
 

			echo "Records saved"; 
			header('Location:usermanage.php');
		
	


mysql_close($conn);
?>

