<?php
	
	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>";
	    print '</center></body></html>';
		return;
	}

	$reg_id=$_GET["regid"];

?>

<?

print '<br><center><strong>Add a new regulatory motif</strong></center><br>';
print '<form name="form1" method="POST" action="reg-region-add-motif-results.php">';
//MAKE WITH A TABLE FOR IT TO BE ALL NICE AND DANDY!!
print '<input type="hidden" name="regid" value="'.$reg_id.'"/>';

print 'Regulatory motif Name:  <select name="motif" size="1">';

		$query="SELECT \"NAME\", \"MOTIF_ID\" FROM \"MOTIF_REGUL\" WHERE \"TYPE\"='manual' ORDER BY \"NAME\"";
		$stmt = pg_query($c,$query);
			while($row=pg_fetch_array($stmt))
		print "<option value=\"".$row["MOTIF_ID"]."\">".$row["NAME"]."</option>";
							  
	print '</select>';
	/*
	print '<input type="checkbox" name="update" value="1" checked> 
	<strong>Use this motif to update internal matrix</strong><br/>';
	print '<input type="checkbox" name="reverse" value="1"> 
	<strong>Motif in the reverse orientation (e.g. Reversed GATA is TATC)</strong>';
	*/
	print '&nbsp;&nbsp; Begin: &nbsp;&nbsp; <input type="text" size="10" name="begin"/>';
	print ' &nbsp;&nbsp; Stop: &nbsp;&nbsp; <input type="text" size="10" name="stop"/>';	
	print ' &nbsp;&nbsp; Comments: <input type="text" size="40" name="comments"/> ';			
	//print 'Comments: <br>';
	//print '<textarea name="comments" cols="50" rows="20"></textarea>';	
	//print '<br><br>';
	
	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">';
	print '</form>';
	
	print '<form name="form1" method="POST" action="reg-region-find-motif-coords.php">';
	print '<input type="hidden" name="regid" value="'.$reg_id.'"/>';
	print '<br><center><strong>Search position(s)</strong></center><br><br>';	
	print 'Sequence to search (just A,T,C,G): &nbsp;&nbsp; <input type="text" name="sequence"/><br>';	
	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">';
	print '</form>';
?>

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