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

	//PROMOTER_ID
	$id = $_GET["promid"];

	 echo '<form name="formCreateRegReg" action="reg-region-construct-add-results.php" method="post"> 	
		<p>Name: <input type="text" name="NAME" size="20"/></p>
		<p>Basal promoter: <select name="MIN_PROMOT_ID" size="1">
			<option value="'.$id.'">Endogenous Promoter</option>';

	//$khoueiry = "SELECT A.\"PROMOTER_ID\", A.\"NAME\" FROM \"PROMOTER\" A ,\"GENE_REGULATION\" B WHERE A.\"PROMOTER_ID\"=B.\"PROMOTER_ID\" AND B.\"TYPE\" LIKE '%Basal Promoter%';"
	$khoueiry = "SELECT \"PROMOTER_ID\", \"NAME\" FROM \"PROMOTER\" WHERE \"TYPE\" LIKE '%Basal Promoter%';";
	$stmt = pg_query($c,$khoueiry);
		
	while($row=pg_fetch_array($stmt)){ 
	  echo '<option value="'.$row["PROMOTER_ID"].'">'.$row["NAME"].'</option>';
	}	

	echo '</select></p>	
		
	<p>Reporter: <select name="REPORTER_GENE" size="1">';
	echo '<option value="LacZ">LacZ</option>';
	echo '<option value="GFP">GFP</option>';
/*		
	$khoueiry = "SELECT \"MOLECULAR_TOOL_ID\", \"NAME\" FROM  \"MOLECULAR_TOOL\" WHERE \"TYPE\" LIKE '%Reporter gene%';";
	$stmt = pg_query($c,$khoueiry);
		
	while($row=pg_fetch_array($stmt)){ 
	  echo '<option value="'.$row["MOLECULAR_TOOL_ID"].'">'.$row["NAME"].'</option>';
	}
*/
	echo '</select></p>';	
	
	echo '<p>Comments: <textarea rows="3" name="COMMENTS" cols="50"></textarea></p>
		<input type="hidden" name="PROMOTER_ID" value="'.$id.'"/>
		
	    <br><img src="pictures/button-cur-delete.gif" title="Cancel"  onClick="javascript:self.close();">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	    <input name="submit" type="image" src="pictures/button-cur-validate.gif" onClick="submit" title="Create Construct">
	
	</form>'; 


include ("frames_footer.php"); 

?>