<?php  header('Content-type: text/html; charset=utf-8'); ?>
<html>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<body>
<center><table width=400><tr><td colspan=2><span class="header1">Lägg till feedack</span><br>
<?php
	extract($_REQUEST);

	include("../scripts/sqlinfo.inc");
	mysql_connect($host, $user, $pass);
	mysql_selectdb("pyrot");
	if(!$submit){
		$result=mysql_query("select * from event where col_id=$nr");
		if($r=mysql_fetch_array($result)){
			printf("<form method=\"post\" action=\"add_feedback.php?nr=%s\">
				<table border=0>
				<tr><td>%s, %s</td></tr>
				<tr><td valign=\"top\">Text:</td></tr>
				<tr><td><textarea name=\"feedback\" rows=7 cols=30>%s</textarea></td></tr>
				<tr><td><input type=\"submit\" name=\"submit\" value=\"Spara\"></td></tr>
				</table>
				</form>"
				,$nr, $r["datum"], $r["rubrik"], $r["feedback"]);
		}
		else printf("Skjutningen finns inte!!");
	}
	else{
		mysql_query("update event set feedback=\"$feedback\" where col_id=$nr");
	}
?>
</td></tr></table></center>
</body>
</html>