<?php
/*
    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/>.

*/
	//connection
	include("connection.php");
//Title before frames_header
print '<title>ANISEED v3.0 - Molecule hsp</title>';

    include("frames_header.php");
?>

<?php
//////////////////////////////////////////Best BLAST hits///////////////////////////////////////////
        $gene=$_GET["gene"];
		$mol=$_GET["mol"];
		
		print "<font color=\"#D64242\" size=\"3\"><b>Best blast hits</b></font><br><br>";
        print "<center><table width=\"99%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	    print "<tr align=\"center\" valign=\"middle\" ><td><font color=\"#456898\" size=\"2\"><b>Protein name&nbsp;</b></font></strong></td><td><font color=\"#456898\" size=\"2\"><b>ID%&nbsp;</b></font></td><td><font color=\"#456898\" size=\"2\"><b>Score&nbsp;</b></font></td><td><font color=\"#456898\" size=\"2\"><b>Evalue&nbsp;</b></font></td><td><font color=\"#456898\" size=\"2\"><b>Description</b></font></td></tr>";
	    $requete="select \"PROTEIN\", \"EVALUE\", \"SCORE\", \"DESCRIPTION\", \"ID\" from \"BLAST\" where \"MOL_ID\"=$gene and \"PROTEIN\"='$mol' order by \"SCORE\" DESC";
    	$stmt = pg_query($c,$requete);
		$count=0;
    	while($row=pg_fetch_array($stmt)){
		    ++$count;
			print "<tr align=\"center\"><td><a target=\"_BLANK\" href=\"http://us.expasy.org/cgi-bin/niceprot.pl?".$row["PROTEIN"]."\">".$row["PROTEIN"]."</a></td><td>".$row["ID"]."%</td><td>".$row["SCORE"]."</td><td>".$row["EVALUE"]."</td><td><font size=\"-1\">".$row["DESCRIPTION"]."&nbsp;</font></td></tr>";
		    print '<tr valign="top"><td><hr size="1"></td><td><hr size="1"></td><td><hr size="1"></td><td><hr size="1"></td><td><hr size="1"></td></tr>';
		}
		if($count==0){
		   print "</table></center><br><center>NONE</center>";
		}else{
		    print "</table></center>";
			print "PSI-Blast - Swissprot database";
		}

?>

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