<?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");
//Title before frames_header
print '<title>ANISEED v3.0 - Find asymetric cleavages </title>';

    include("frames_header.php");
?>
<div style="border-top:0px solid black;border-bottom:1px solid black;">
<font color="#D64242" size="3"><b>Find asymetric cleavages </b></font>
</div>
<br>
This page allows to compare the volumes of sister cells in Ciona intestinalis embryos up to the 44 cell stage. Select the
developmental stage of interest, the % of asymmetry (calculated as 1-Vsmall_sister/Vlarge_sister) and upon submission a list of sister
pairs satisfying the required asymmetry is obtained. If "asymmetry >0" is selected, the cleavage asymmetry of all sister pairs at the
selected stage is displayed in the results page.

<br>
<br>
<center>
The dataset this tool work with is still incomplete and involves a restricted set of developmental stages.
<form name="formulaire" action="division-result.php" method="post" target="_blank">

<?php
            $celllist="";
			if(isset($_POST["celllist"]))
            	$celllist=$_POST["celllist"];
            if(strlen($celllist)>0)
			      print "<center><H2><font color=\"#FF6600\">Refine subset mode</font> <a href=\"biometry-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" background="pictures/barre.jpg">
              
              <tr> 
                <td>&nbsp;</td>
                <td>&nbsp;</td>
				<td>&nbsp;</td>
              </tr>
			  
              <tr> 
                
				<td align="center" valign="top">
				     <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='division-search.php'; self.formulaire.target='_self'; submit();">
					-->
					<br>
						<!--<select name="species" size="1" onChange="javascript: document.forms[0].action='division-search.php'; document.forms[0].target='_self'; submit();">-->
<select name="species" size="1" onChange="javascript: document.formulaire.action='division-search.php?species='+this.options[this.selectedIndex].value; document.formulaire.target='_self'; submit();">
						<option></option>
						<?php
							$species="";
							if (isset($_POST["species"])) $species=$_POST["species"];
							
							$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 align="center" 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>&nbsp;</td>
              </tr>
			  
              <tr> 
                <td><hr size="1" color="#505F70"></td>
                <td><hr size="1" color="#505F70"></td>
				<td><hr size="1" color="#505F70"></td>
              </tr>
			  
              <tr> 
                <td align="center">
				     <font color="#456898" size="2"><b>Asymmetry</b></font>
					<select name="mvol" size="1"><option value="0">></option><option value="1"><</option></select>&nbsp;<input name="vol" type="text" value="50" size="10"><strong> %</strong>
			    </td>
		<td>&nbsp;</td>
                <td>&nbsp;</td>
			  </tr>
			  
              <tr> 
                <td><hr size="1" color="#505F70"></td>
                <td><hr size="1" color="#505F70"></td>
				<td><hr size="1" color="#505F70"></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");
?>