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


<html>
<body bgcolor="#999966" text="#FFFFFF" link="#000000" vlink="#000000" alink="#000000">
<title>ANISEED CURATOR - Add Reference</title><br>

<?php
    if ( (!isset($_SESSION["login"]))or(!isset($_SESSION["pass"])) ) {
	    print "<center><strong>you need to <a href=\"login.php\">login</a> as an authorised curator to proceed.</strong>";
	    print '</center></body></html>';
	return;
	}
?>


<?

$pubmedid=$_GET["pubmedid"];
$title=$_GET["title"];
$paper=$_GET["paper"];
$author=$_GET["author"];
$url=$_GET["url"];
$comments=$_GET["comments"];
$id=$_GET["id"];

$requete="INSERT into \"REFERENCE\"(\"BIO_ID\",\"PUBMED_ID\",\"TITLE\",\"PAPER\",\"AUTHORS\",\"URL\",\"COMMENTS\") values ('$id','$pubmedid','$title','$paper','$author','$url','$comments')";

pg_query($c,"begin");
pg_query($c,$requete);

$requete = "update \"ENTRY_ORIGIN\" set \"ANNOTATOR_ID\"=".$_SESSION['curationauthor'].", \"ANNOTATION_DATE\"=current_date where \"BIO_ID\"=$id";
$resultset = pg_query($c,$requete) or die("<strong>ERROR </strong>".pg_last_error($c));	

pg_query($c,"commit");

print "<center><strong><em>Reference added to $id</em></strong></center>";
print "<br><br><center>";
print '<input name="Exit" type="button" value="-= Close window =-" onClick="javascript:opener.location.reload();self.close();"></center>';





?>

<SCRIPT LANGUAGE="JavaScript"> javascript:opener.location.reload(); self.close(); </script>
</body>
</html>
	
	
	
	
