<?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"];
		}
?>
<?php

require ("_common/global.php");
require ("_common/conn.php");
//require ("_common/function.php");
require ("_common/check_session.php");
?>
<?php
$name2 =$_REQUEST['name'];
//$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 data_vaccine WHERE name  = '$name2'");
$test = mysql_fetch_array($result);

	$name = $_POST['nameedit'];
	
	$notes = $_POST['notes'];
	
	
		
	mysql_query("UPDATE IGNORE data_vaccine SET name='$name', notes='$notes' WHERE name = '$name2'")
				or die(mysql_error());
echo "1 record modified";
header('location: pre-vaccine.php');
mysql_close($link)

//mysqli_query($link, $sql);
//header('location: assignevaluator.php');
//mysqli_close($link);
?>
