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


<html>
<body bgcolor="#999966" text="#FFFFFF" link="#000000" vlink="#000000" alink="#000000">
<title>ANISEED CURATOR - Edit InSitu Comments</title>


<form action="curator-edit2.php" method="post" name="form1" target="_self">
<center>
<?php
	
    if ( (!isset($_SESSION["login"]))or(!isset($_SESSION["pass"])) ) {
	    print "<strong>you need to <a href=\"login.php\">login</a> as an authorised curator to proceed.</strong>";
	    print '</center></body></html>';
		return;
	}
	
	
	$part=$_GET["part"];
	$id=$_GET["id"];
	
	print "<input name=\"part\" type=\"hidden\" value=\"$part\">";
	print "<input name=\"id\" type=\"hidden\" value=\"$id\">";
	
	
    if($part=="IM_COMMENTS")
	    print '<strong>In situ description: </strong><br>';
	else if($part=="EXP_COMMENTS")
		print '<strong>Experimental conditions description: </strong><br>';
	
	
	if( ($part=="IM_COMMENTS")or($part=="EXP_COMMENTS") ){
		print '<textarea name="text" cols="50" rows="20">';
		
		$requete="SELECT \"$part\" FROM \"IN_SITU\" WHERE \"IN_SITU_ID\"=$id";
		$stmt = pg_query($c,$requete);
		if ( $row=pg_fetch_array($stmt) )
	    print $row["$part"];
		
		print '</textarea>';
		
		print '<br><img src="pictures/button-cur-delete.gif" title="Cancel"  onClick="javascript:self.close();">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
		print '<input name="submit" type="image" src="pictures/button-cur-validate.gif" onClick="submit" title="Ok">';
	}

?>
</center>
</form>


</body>
</html>