session_start();
if (!session_is_registered("LLC"))
{
// if session check fails, invoke error handler
header("Location: ../loginform.php");
exit();
}
$user = $_SESSION['UNAME'];
$Room = $_POST['room'];
$NTask = trim($_POST['ntask']);
$Description = $_POST['description'];
$Status = $_POST['status'];
$Place = trim($_POST['place']);
$Task = $_POST['task'];
if ($NTask == '')
{
print "
You must enter a task.
";
exit();
}
if ($Place == '')
{
$Place=50;
}
include("../include/dbconfig.php");
$connection = mysql_connect($db_host, $db_user, $db_pass) or die ("Unable to connect!");
mysql_select_db($db_name);
$query = "update SR_task set Task='$NTask', Description='$Description', Status='$Status', Place=$Place where RoomNo='$Room' and Task='$Task'";
$result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error());
header("Location: editroom.php?room=$Room");
exit();
?>