<?

include ("connection.php");
include ("frames_header.php");


$species=$_GET["species"];

?>



<center><font size="5" color="crimson"><b>Add a new Embryo to the database</b></font><br><br>

<form name="formulaire" action="add-embryo2.php" method="POST" enctype="multipart/form-data">

<!-- ---------------------------- SPECIES --------------------------------->
<font color="#486898" size="-1"><b>Species</b></font><br>
<select name="species" size="1" onChange="javascript: self.location.href = 'add-embryo.php?species='+ this.options[ this.selectedIndex ].value">
<option ></option>
<?
$requete="SELECT \"NAME\" from \"SPECIES\"";
$stmt=pg_query($c,$requete);
while ($row=pg_fetch_array($stmt))
{
$name=$row["NAME"];
print "<option value=\"$name\"";
if($species==$name) print " selected";
print ">$name</option>";
}

?>
</select>

<br><br>
<!-- ---------------------------- DEV_STAGE --------------------------------->
<font color="#486898" size="-1"><b>Developmental stage</b></font><br>
<select name="devstage" size="8" style="background-color:white;" onClick="window.document.formulaire.devname.value=this.options[ this.selectedIndex ].text;">
<?php
$id="";

if (strlen($species)>0)
{

$requete="SELECT \"NAME\" from \"DEV_STAGE\" where \"SPECIES\"='$species' order by \"DEV_PERCENT\"";
$stmt=pg_query($c,$requete);
while($row=pg_fetch_array($stmt))
{
print "<option value=\"".$row["DEV_STAGE_ID"]."\">";
print $row["NAME"]."</option>\n";
$id .= $row["DEV_STAGE_ID"].":";
}

}
?>
</select>

<br><br>

<!-- ---------------------------- TRACABILITY ------------------------------>

<font color="#486898" size="-1"><b>Choose an author</b></font><br>
<select name="author" size="1" style="text-align:center;">
<option></option>
<?
$requete="SELECT \"AUTHOR_ID\",\"NAME\" from \"AUTHOR\" order by \"NAME\"";
$stmt=pg_query($c,$requete);

while ($row=pg_fetch_array($stmt))
{
//print $row["NAME"]."<br>";
print "<option value=\"".$row["AUTHOR_ID"]."\">".$row["NAME"]."</option>";

}

?>
</select>
<br><br>

<!-- ---------------------------- WILD TYPE ----------------------------->

<font color="#486898" size="-1"><b>Wild Type</b></font><br>
<select name="wt" size="1">
<option>Yes</option>
<option>No</option>
</select>


<!-- ---------------------------- NAME --------------------------------->
<br><br>
<font color="#486898" size="-1"><b>Name</b></font><br>

<table>
<tr>
<td align="center"><font color="black" size="-1"><i>Part of stage</i></font></td>
<td align="center"><font color="black" size="-1"><i>Developmental stage</i></font></td>
<td align="center"><font color="black" size="-1">&nbsp;</font></td>
<td align="center"><font color="black" size="-1"><i>Software</i></font></td>
<td align="center"><font color="black" size="-1">&nbsp;</font></td>
<td align="center"><font color="black" size="-1"><i>Resolution</i></font></td>
<td align="center"><font color="black" size="-1">&nbsp;</font></td>
<td align="center"><font color="black" size="-1"><i>Complements</i></font></td>
</tr>



<tr>
<td align="center">
<select name="evol" size="1">
<option></option>
<option>Initial</option>
<option>Very-Early</option>
<option>Early</option>
<option>Mid</option>
<option>Late</option>
<option>Very-Late</option>
</select>
</td>

<td align="center">
<input type="text" name="devname" style="text-align:center;color:#486898;font-weight:bold;">
</td>

<td align="center">
-
</td>

<td align="center">
<input type="text" name="software" size="10" value="Amira" style="color:crimson;text-align:center;font-weight:bold;">
</td>

<td align="center">
-
</td>

<td align="center">
<select name="resolution" size="1">
<option></option>
<option>Low-Resolution</option>
<option>High-Resolution</option>
</select>
</td>

<td align="center">
-
</td>

<td align="center">
<input type="text" name="complements" size="50" style="text-align:center;font-weight:bold;">
</td>


</tr>
</table>


<br><br>

<font color="#486898" size="-1"><b>Wavefront Object (*.obj)</b></font><br>
<input type="file" size="50" name="objfile" style="text-align:center;">

<br><br>

<!--
<font color="#486898" size="-1"><b>VRML 2.0 (*.wrl)</b></font><br>
<input type="file" size="50" name="vrmlfile" style="text-align:center;">

<br><br>

<font color="#486898" size="-1"><b>LSM Confocal Stack (*.lsm)</b></font><br>
<input type="file" size="50" name="lsmfile" style="text-align:center;">

<br><br>
-->

<font color="#486898" size="-1"><b>Comments</b></font><br>
<textarea name="comments" rows="5" cols="80">
</textarea>

<br><br>

<input type="submit" value="Add this Embryo">


</form>


</center>
<?


include ("frames_footer.php");
?> 
