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




print "<title>ANISEED V3.0 - Embryo Collection</title>";

print "<font color=\"#D64242\" size=\"3\"><b>Embryo Collection</b></font><br><br>";
print "You can visualize the lsm files thanks to lsm reader, an imageJ plug in available in <a href=http://rsbweb.nih.gov/ij/plugins/lsm-reader.html>http://rsbweb.nih.gov/ij/plugins/lsm-reader.html</a>. Note that for <em>Boltenia villosa</em> only few cells were reconstructed. <br><br>";


$requete="SELECT E.\"EMBRYO_ID\",E.\"NAME\",E.\"WILD_TYPE\",E.\"SPECIES\",E.\"DEV_STAGE_ID\",E.\"SOFTWARE\" from \"EMBRYO\" E, \"DEV_STAGE\" D where E.\"DEV_STAGE_ID\"=D.\"DEV_STAGE_ID\" order by D.\"SPECIES\",D.\"DEV_PERCENT\"";
$stmt=pg_query($c,$requete);

$num=pg_num_rows($stmt);

print "<center><font color=\"#486898\"><b>$num embryos</b></font></center><br><br>";


print "<center>";
print "<table border=\"0\" width=\"100%\" cellspacing=\"0\">";
print "<tr>";
print "
<td style=\"background-color:lightgray;border-bottom:1px solid black;border-right:1px solid black;\" align=\"center\"><font color=\"#486898\" size=\"-1\"><b>Species</b></font></td>
<td style=\"background-color:lightgray;border-bottom:1px solid black;border-right:1px solid black;\" align=\"center\"><font color=\"#486898\" size=\"-1\"><b>Developmental Stage</b></font></td>
<td style=\"background-color:lightgray;border-bottom:1px solid black;border-right:1px solid black;\" align=\"center\"><font color=\"#486898\" size=\"-1\"><b>Name</b></font></td>
<td style=\"background-color:lightgray;border-bottom:1px solid black;border-right:1px solid black;\" align=\"center\"><font color=\"#486898\" size=\"-1\"><b>Wild Type</b></font></td>
<td style=\"background-color:lightgray;border-bottom:1px solid black;border-right:1px solid black;\" align=\"center\"><font color=\"#486898\" size=\"-1\"><b>Software</b></font></td>
<td style=\"background-color:lightgray;border-bottom:1px solid black;border-right:1px solid black;\" align=\"center\"><font color=\"#486898\" size=\"-1\"><b>Obj file</b></font></td>
<td style=\"background-color:lightgray;border-bottom:1px solid black;border-right:1px solid black;\" align=\"center\"><font color=\"#486898\" size=\"-1\"><b>Surface & Volume</b></font></td>
<td style=\"background-color:lightgray;border-bottom:1px solid black;border-right:1px solid black;\" align=\"center\"><font color=\"#486898\" size=\"-1\"><b>Biometry</b></font></td>
<td style=\"background-color:lightgray;border-bottom:1px solid black;border-right:1px solid black;\" align=\"center\"><font color=\"#486898\" size=\"-1\"><b>Surface of Contact</b></font></td>
<td style=\"background-color:lightgray;border-bottom:1px solid black;\" align=\"center\"><font color=\"#486898\" size=\"-1\"><b>Confocal stack</b></font></td>";
print "</tr>";






while ($row=pg_fetch_array($stmt))
{

/////////PRINT THE TABLE

$id=$row["EMBRYO_ID"];
$species=$row["SPECIES"];
$name=$row["NAME"];
$wt=$row["WILD_TYPE"];
$devid=$row["DEV_STAGE_ID"];
$software=$row["SOFTWARE"];

$tmp=explode("@",$name);
$particule=$tmp[0];


$name=trim(str_replace("@","_",$name));



if ($name[0]=="_") $name=substr($name,1,strlen($name));



$requete0="SELECT \"NAME\" from \"DEV_STAGE\" where \"DEV_STAGE_ID\"='$devid'";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
$devname=$row0["NAME"];


print "<tr>";
print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\">$species</font></td>";
print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\">$particule $devname</font</td>";
print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\">$name</font></td>";
print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\">$wt</font></td>";
print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\">$software&nbsp;</font></td>";

$requete0="SELECT \"OBJ_DATA\" from \"EMBRYO\" where \"EMBRYO_ID\"='$id'";
$stmt0=pg_query($c,$requete0);
if (pg_num_rows($stmt0)>0) print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\"><a href=\"embryo-get-obj.php?id=$id\"><small>Download</small></a></font></td>";
else print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\"><font color=\"#D64242\"><small>Not available</small></font></td>";

$requete0="SELECT count(*) as \"COMPTE\" from \"EMBRYO_BIOMETRY\" where \"EMBRYO_ID\"='$id'";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
if ($row0["COMPTE"]!="0") print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\"><a href=\"embryo-get-sv.php?id=$id\"><small>Download<small></a></font></td>";
else print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\"><font color=\"#D64242\"><small>Not available</small></font></td>";

$requete0="SELECT count(*) as \"COMPTE\" from \"EMBRYO_BIOMETRY_SHAPE\" where \"EMBRYO_ID\"='$id'";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
if ($row0["COMPTE"]!="0") print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\"><a href=\"embryo-get-biom.php?id=$id\"><small>Download<small></a></font></td>";
else print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\"><font color=\"#D64242\"><small>Not available</small></font></td>";

$requete0="SELECT count(*) as \"COMPTE\" from \"EMBRYO_NEIGHBOR\" where \"EMBRYO_ID\"='$id'";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
if ($row0["COMPTE"]!="0") print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\"><a href=\"embryo-get-contact.php?id=$id\"><small>Download<small></a></font></td>";
else print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\"><font color=\"#D64242\"><small>Not available</small></font></td>";


$requete0="SELECT \"LSM\" from \"EMBRYO\" where \"EMBRYO_ID\"='$id'";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
if (strlen($row0["LSM"])>0) print "<td style=\"border-right:1px solid black;\" align=\"center\"><font size=\"-1\"><a href=\"embryo-get-lsm.php?id=$id\"><small>Download<small></a></font></td>";
else print "<td align=\"center\"><font size=\"-1\"><font color=\"#D64242\"><small>Not available</small></font></td>";

print "</tr>";


}


print "</table>";
print "</center>";













include ("frames_footer.php");
?> 
