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

<?php
    $id=$_GET["idanat"];

	/*Test de la sélection d'une partie anatomique*/
	if ($id=="undefined")
	{
	print "<br><br><center><h2><strong>Error, please select an anatomical part.</strong></h2></center><br><br>";
	include ("frames_footer.php");
	return;
	}
    
	$requete="select B.\"NAME\" as dev, A.\"NAME\" from \"ANAT_ENTITY\" A, \"DEV_STAGE\" B where A.\"ANAT_ID\"='$id' and A.\"DEV_STAGE_ID\"=B.\"DEV_STAGE_ID\"";
    $stmt = pg_query($c,$requete);
	if ($row=pg_fetch_array($stmt)){
	    print "&nbsp;&nbsp;<h2><strong><em><u>".$row["NAME"]." &nbsp;(".$row["dev"].")</u></em></strong></h2><br>";
	}
	
	print '<table width="25%" border="0" cellspacing="0" cellpadding="0">';
	print '<tr><td align="right" background="pictures/barre-red.jpg"><em>Fates</em></td></tr>';
	$count=0;
	$requete="select \"KEYWORDS\" from \"FATE\" where \"ANAT_ID\"='$id' order by \"KEYWORDS\"";
    $stmt = pg_query($c,$requete);
	while ($row=pg_fetch_array($stmt)){
	    ++$count;
	    print "<tR align=\"right\"><td><strong>".$row["KEYWORDS"]."</strong><br></td></tr>";
	}
	print '</table>';
	if($count==0)
	    print "<strong>No match</strong>";
?>


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