<?php
	//connection
	include("connection.php");
	include ("frames_header.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>";
	    include ("frames_footer.php");
		return;
	}
?>


<form action="reg-region-motif-edit-type-results.php" method="post" name="form1" target="_self">
<center>
<?php

	$motif=$_GET["motifid"];
	$id=$_GET["id"];

	print "<input name=\"id\" type=\"hidden\" value=\"$id\">";

	print '<select name="motifid" size="1">';
		$query="SELECT \"MOTIF_ID\", \"NAME\" FROM \"MOTIF_REGUL\" ORDER BY \"NAME\"";
		$stmt = pg_query($c,$query);
		while($row=pg_fetch_array($stmt)){
		  	if($row["MOTIF_ID"]==$motif){
				print "<option value=\"".$row["MOTIF_ID"]."\" selected=\"selected\">".$row["NAME"]."</option>";    	    
			} else {
				print "<option value=\"".$row["MOTIF_ID"]."\">".$row["NAME"]."</option>";    
			}			
		}									  
	print '</select>';
	
		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>

<?php
	include ("frames_footer.php");
?> 
