<?
include ("connection.php");
include ("frames_header.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>';
	include ("frames_footer.php");
		return;
	}


$requete="SELECT \"IS_ADMIN\" from \"AUTHOR\" where \"AUTHOR_ID\"='".$_SESSION["curationauthor"]."'";
$stmt=pg_query($c,$requete);
$row=pg_fetch_array($stmt);
$ONLY_ANNOTATOR="y";
if ($row["IS_ADMIN"]=="n") $ONLY_ANNOTATOR="y";else $ONLY_ANNOTATOR="n";




$requete="SELECT * from \"ARTICLE\"";
$stmt=pg_query($c,$requete);

print "<center><h3>Articles already entered in the database</h3><br></center>";
$NUM=pg_num_rows($stmt);
print "<center>$NUM articles</center><br><br>";

while ($row=pg_fetch_array($stmt))
{

$id=$row["ARTICLE_ID"];
$pmid=$row["PUBMED_ID"];
$title=$row["TITLE"];
$authors=$row["AUTHORS"];
$paper=$row["PAPER"];
$url=$row["URL"];
$comments=$row["COMMENTS"];




if ($ONLY_ANNOTATOR=="n")
print "
<div style=\"border:1px solid black; background: white; color:black; padding:5px;margin:5px;\">

<center><b><font color=\"#D64242\">$authors</font></b><br>
<i>$title</i><br>
$paper<br>
<font size=\"-1\">Pubmed ID: <b>$pmid</b></font><br>
<font size=\"-1\">Aniseed Article ID: <b>$id</b></font><br>
<br>
</center>
<center>
<a target=\"_blank\" href=\"delete-article.php?id=$id\"><img border=\"0\" src=\"pictures/button-cur-delete.gif\"></a>
&nbsp;&nbsp;
<a href=\"edit-article.php?id=$id\"><img border=\"0\" src=\"pictures/button-cur-edit.gif\"></a>
</center>
</div>
<br><br>";
else if ($ONLY_ANNOTATOR=="y")
print "
<div style=\"border:1px solid black; background: white; color:black; padding:5px;margin:5px;\">

<center><b><font color=\"#D64242\">$authors</font></b><br>
<i>$title</i><br>
$paper<br>
<font size=\"-1\">Pubmed ID: <b>$pmid</b></font><br>
<font size=\"-1\">Aniseed Article ID: <b>$id</b></font><br>
<br>
</center>
<center>
<a href=\"edit-article.php?id=$id\"><img border=\"0\" src=\"pictures/button-cur-edit.gif\"></a>
</center>
</div>
<br><br>";








}













include ("frames_footer.php");
?>