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

<html>
<body bgcolor="#999966" text="#FFFFFF" link="#000000" vlink="#000000" alink="#000000">
<title>ANISEED CURATOR - Delete Pictures</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;
	}
?>


<?php

    $id=$_POST["id"];

pg_query($c,"begin");

	$requete = "delete from \"PICTURE\" where \"PICTURE_ID\"=$id";
	$resultset = pg_query($c,$requete) or die("<strong> ERROR </strong>".pg_last_error($c));

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

	$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));


    // Validation de la transaction
    //$committed = OCICommit($connection);
pg_query($c,"commit");


    print '<table width="100%" border="0">';
	
    // V�ification de la validation : si une erreur est survenue, afficher le message d'erreur
    
	    print '<tr><td align="center"><H1>Validation done</H1></td></tr>';
	    print '<tr><td align="center"><center><input name="Exit" type="button" value="-= Close window =-" onClick="javascript:self.close();"></center></td></tr>';
    
	//ocilogoff($connection);
?>

 </table>

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

</body>
</html>
 
 
 
 