<html>
<head>
<title>ANISEED - Molecular tool results (Ciona intestinalis, Halocynthia roretzi)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="This page will list Ciona intestinalis molecular tools linked to a specific transcript model. Click on the molecular tool you are interested in.">
<meta name="keywords" content="molecular tool, transcript model, Ciona intestinalis, Halocynthia roretzi, ascidian database, ciona intestinalis database, Tassy, Lemaire, Daian, Sobral, Dauga.">
<meta name = "robots" content = "index, follow, all">
<META HTTP-EQUIV="Content-Language" CONTENT="EN">
<style type="text/css">
</style>
</head>

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


$pmid=$_GET["pmid"];
$artid=$_GET["id"];
$name=$_GET["name"];
$species=$_GET["species"];


print "<center><font color=\"#D64242\" size=\"3\"><b>Matching Molecular tools</b></font></center><br>";




/*$requete="SELECT * from \"MOLECULAR_TOOL\" where \"MOLECULAR_TOOL_ID\" in (
select \"BIO_ID\" from \"REFERENCE\" where \"PUBMED_ID\"='$pmid'
)";*/


if (strlen($name)==0) //// On vient de article card
{
$requete="

select * from \"MOLECULAR_TOOL\" where \"ASSOCIATED_GENE_ID\" in (
select \"NAME\" from \"GENE\" where \"GENE_ID\" in (
select \"GENE_MODEL_ID\" from \"GENE_CONCEPT\" where \"GENE_CLUSTER_ID\" in (
select \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\" in(
select \"GENE_ID\" from \"GENE\" where \"NAME\" in (
select distinct \"TRANSCRIPT\" from \"ARTICLE_GENE\" where \"ARTICLE_ID\"='$artid'
)
)
)
)
) 

AND \"MOLECULAR_TOOL_ID\" in (
select \"BIO_ID\" from \"REFERENCE\" where \"PUBMED_ID\"='$pmid'
)
";
}
else		//// On vient de l'interface de recherche d'outils moleculaire
	{

	$requete="SELECT * from \"MOLECULAR_TOOL\" where \"NAME\" ilike '%".strtoupper($name)."%'";
	
	}



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

$NUM=pg_num_rows($stmt);
if ($NUM==1) print "<center><font color=\"black\" size=\"-1\">$NUM Result</font></center>";
if ($NUM>1) print "<center><font color=\"black\" size=\"-1\">$NUM Results</font></center>";

print "<br>";

print "<table cellpadding=\"3\" cellspacing=\"2\" width=\"100%\">";
print "<tr><td align=\"center\"><font color=\"#486898\" size=\"-1\"><b>Name</b></font></td><td align=\"center\"><font color=\"#486898\" size=\"-1\"><b>Type of Tool</b></font></td></tr>";

$I=0;
while ($row=pg_fetch_array($stmt))
{

$name=$row["NAME"];
$type=$row["TYPE"];
$moltoolid=$row["MOLECULAR_TOOL_ID"];


//print $name." ".$type."<br>";
if ($I%2==1) $bgcolor="#AAAAAA"; else $bgcolor="#DDDDDD";

print "<tr><td style=\"background-color:$bgcolor;\" align=\"center\"><a href=\"moltool-card.php?id=$moltoolid\"><font size=\"-1\">$name</font></a></td><td style=\"background-color:$bgcolor;\" align=\"center\"><font size=\"-1\">$type</font></td></tr>";


$I++;
}

print "</table>";

include ("frames_footer.php");
?>