<?
/*
    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>ANISEED v3.0 - Expression curves</title>
<?
include ("frames_header.php");


$name=$_GET["name"];
/*
$requete="select A.*, B.\"SPECIES\" from \"GENE\" A, \"MOL_ENTITY\" B where (A.\"NAME\"='$name')and(A.\"GENE_ID\"=B.\"MOL_ID\")";

//print $requete;

	$stmt = pg_query($c,$requete);

	if($row=pg_fetch_array($stmt)){
	
	    $id=$row["GENE_ID"];

	    $species=$row["SPECIES"];

	

	    $id=$row["GENE_ID"];
		$name=$row["NAME"];

$clustid=$id;

if ($row["NAME"]{0}=="K") //KYOTO
{
//AJOUT POUR L'ABSTRACT de KYOTO

$qu="SELECT \"NAME\" from \"MOL_ENTITY\" where \"MOL_ID\"='$id'";
$st=pg_query($c,$qu);
$ro=pg_fetch_array($st);

$temp=explode(".",$ro["NAME"]);
$abstract=$temp[0].".".$temp[1].".".$temp[2];
$qu="SELECT \"MOL_ID\" from \"MOL_ENTITY\" where \"NAME\"='$abstract' and \"TYPE\"='abstract'";
$st=pg_query($c,$qu);
$ro=pg_fetch_array($st);

	$clustid=$ro["MOL_ID"];
		//print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Corresponding cluster: </b></font></td><td>";
		//print "<a href=\"ESTcluster.php?name=".$ro["MOL_ID"]."\"><font color=\"#000000\" size=\"-1\">".$ro["MOL_ID"]."</font></a></td></tr>";
//FIN AJOUT
}

if ($row["NAME"]{0}=="E")
	{
	//POUR ENSEMBL

	$qu="SELECT \"ABSTRACT_ID\" from \"TRANSCRIPT\" where \"TRANSCRIPT_ID\"='$id'";
	$st=pg_query($c,$qu);
	$ro=pg_fetch_array($st);

 	$clustid=$ro["ABSTRACT_ID"];
//	print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Corresponding cluster: </b></font></td><td>";
//	print "<a href=\"ESTcluster.php?name=".$ro["ABSTRACT_ID"]."\"><font color=\"#000000\" size=\"-1\">".$ro["ABSTRACT_ID"]."</font></a></td></tr>";
	}
}

*/


?>


<!-- Header pour l'onglet 
  <link rel="stylesheet" type="text/css" media="screen" href="ongletv1.css" title="Version 1" />

<div id="header">
  <ul>
    <li><a href="#">Features</a></li>
    <li><a href="molecule-sequence.php?id=<? print $id; ?>">Sequence</a></li>
    <li><a href="ESTcluster.php?name=<? print $clustid; ?>&base=<?print $id;?>">Cluster</a></li>
    <li><a href="est-expression.php?name=<?print $clustid;?>&base=<? print $id; ?>&species=<?print $species;?>">EST count</a></li>
    <li><a href="insitu-result.php?target=<? print $name;?>&MOLtype=2&Order=DEV_STAGE_ID">InSitu data</a></li>
    <li id="current"><a href="expression-curve.php?name=<? print $name;?>">Expression profile</a></li>
    <li><a href="#">Molecular tool</a></li>
    <li><a href="#">Microarray probe</a></li>
    <li><a href="FLATexport-molecule-gene.php?name=<? print $name; ?>">Export</a></li>
  </ul>
</div>

<br><br>
EOF Onglet -->

<div align="center">
<?
print "<br>";
print "<table>";

$requete="SELECT \"KEYWORDS\" from \"FATE_KW\"";
$stmt=pg_query($c,$requete);
$i=0;
while ($row=pg_fetch_array($stmt))
{
if ($i%2==0) print "<tr>";
print "<td>";
$gene=" ";
print '<div style="border:1px solid black;background:white;color:black;">';
print "<b>".$row["KEYWORDS"]."  $gene </b><br>";
print "<img src=\"graphpng.php?id=$name&fate=".$row["KEYWORDS"]."\">"; 
print '</div>';
print "</td>";
$i++;
if ($i%2==0) print "</tr>";
}
print "</table>";
?>
</div>
<?

//FIN TEST

include ("frames_footer.php");
?>