<html>
<head>
<title>ANISEED - Find Ciona intestinalis or Halocynthia roretzy territories by their fates</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="This page allows users to find Ciona intestinalis or Halocynthia roretzi territory that gives rise to a fate of interest (nervous sytem for example).">
<meta name="keywords" content="Lemaire, Tassy, Daian, Dauga, Sobral, Khoueiry, Aniseed, Ciona intestinalis, Ciona intestinalis terrotories, nervous system, mesenchyme, muscle, notochord, endoderm, Halocynthia roretzi, tunicate, ascidian database, ciona intestinalis database">
<meta name = "robots" content = "index, follow, all">
<META HTTP-EQUIV="Content-Language" CONTENT="EN">
<style type="text/css">
</style>
</head>

<?php
/*
    ANISEED, NISEED System and Database
    Copyright (C) 2007 Olivier Tassy, Fabrice Daian, Patrick Lemaire

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/
   include("connection.php");
    include("frames_header.php");
?>
<div style="border-top:0px solid black;border-bottom:1px solid black;">
<font color="#D64242" size="3"><b>Find territories by their fates</b></font>
</div>
<br>
This page allows you to find the territory at a given stage that
gives rise to a fate of interest. Select your species, developmental
stage and fate then submit. You can select several fates and use the
boolean operators on the right of the page to restrict your query.
The next page lists the corresponding territories.
<br>
<center>

<form name="formulaire" action="fate-result.php" method="post" target="_blank">

<?php
            $celllist="";
			if(isset($_POST["celllist"]))
            	$celllist=$_POST["celllist"];

		if (strlen($celllist)>0) $refine=true; else $refine=false;

            if(strlen($celllist)>0)
			      print "<center><H2><font color=\"#FF6600\">Refine subset mode</font> <a href=\"fate-search.php\" target=\"_self\"><img src=\"pictures/button-reset.jpg\" border=\"0\" align=\"middle\"></a> </H2></center>";
            
			print '<input name="celllist" type="hidden" value="'.$celllist.'">';
?>

            
	        <table width="99%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td>&nbsp;</td>
                <td>&nbsp;</td>
		<td>&nbsp;</td>
              </tr>
			  
              <tr> 
                
				<td align="left"><font color="#456898" size="2"><b>Species</b></font>
				    <!--
					<select name="species" size="1" onChange="javascript: self.location.href = 'fate-search.php?species=' + this.options[ this.selectedIndex ].value;">
<select name="species" size="1" onChange="javascript: self.formulaire.action='fate-search.php'; self.formulaire.target='_self'; submit();">
					-->
					<select name="species" size="1" onChange="javascript: document.formulaire.action='fate-search.php'; document.formulaire.target='_self'; submit();">
						<?php
							$species="Ciona intestinalis";
							if (isset($_POST["species"])) $species=$_POST["species"];
							else $species="Ciona intestinalis";
							
							$requete="Select \"NAME\" from \"SPECIES\" order by \"NAME\"";
							$stmt = pg_query($c,$requete);
							while( $row=pg_fetch_array($stmt) ){
								$name=$row["NAME"];
								print "<option";
								if($species==$name)
								    print " selected";
								print ">$name</option>";
							}
						?>
				    </select>
				</td>
                <td>&nbsp;</td>
				<td>&nbsp;</td>
              </tr>
			  
           
		<tr>
		<td>&nbsp;</td>
		<td><center>
		<? if ($refine) print '&nbsp;&nbsp;<input type="checkbox" name="notin" value="y"/>&nbsp;&nbsp;Not Fated to form:</input>'; ?>
		</center></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		</tr>
              <tr> 
                
                <td align="left" valign="top">
		            <font color="#456898" size="2"><b>Developmental stage</b></font><br>
                    <select name="devstage[]" size="10" multiple style="width:200">
                    
                    <?php
						
						if(strlen($species)>0){
							 $query="SELECT \"NAME\", \"DEV_STAGE_ID\" FROM \"DEV_STAGE\" WHERE \"SPECIES\"='$species' ORDER BY \"DEV_PERCENT\"";
							 $stmt = pg_query($c,$query);
	
							 while($row=pg_fetch_array($stmt)){
								print "<option value=\"".$row["DEV_STAGE_ID"]."\">";
								print $row["NAME"]."</option>\n";
								
							 }
						}
					 ?>
                  </select>
                </td>
                
                <td align="left" valign="top">
			        &nbsp;<font color="#456898" size="2"><b>Fate</b></font>&nbsp;<br>
					<select name="fate[]" size="10" multiple>
					<?php
						$requete= "SELECT \"KEYWORDS\" from \"FATE_KW\" order by \"KEYWORDS\"";
						$stmt = pg_query($c,$requete);
						while($row=pg_fetch_array($stmt))
						    print "<option value=\"".$row["KEYWORDS"]."\">".$row["KEYWORDS"]."</option>\n";
					?>
					</select>
				</td>
				<td align="left">
					<br>
					<table width="50%" border="0" cellspacing="0" cellpadding="0">
					  <tr align="left">
						<td><input name="and" type="radio" value="and"><font color="#656565" size="-1">and</font> &nbsp;</td>
						<td><input name="and" type="radio" value="or" checked><font color="#656565" size="-1">or</font></td>
					  </tr>
					  <tr align="left">
						<td><input name="only" type="radio" value="no" checked><font color="#656565" size="-1">at least</font></td>
						<td><input name="only" type="radio" value="yes"><font color="#656565" size="-1">only</font></td>
					  </tr>
					</table>
				</td>
			  </tr>
             
              <tr>
                <td>&nbsp;</td>
				<td>&nbsp;</td>
                <td align="right">
				    <input name="submit" type="image" src="pictures/button-submit.jpg" onClick="submit">
					&nbsp;&nbsp;
				    <br>
				</td>
              </tr>
            </table>
</form>

</center>


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