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

<html>
<body bgcolor="#999966" text="#FFFFFF" link="#000000" vlink="#000000" alink="#000000">
<title>ANISEED</title>


<?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;
	}
?>


 <br>
 

<?php

$test='n';

$insituid = $_POST["insituid"];
$cloneid = $_POST["cloneid"];
$anatid = $_POST["anatid"];
$name = $_POST["name"];

pg_query($c,"begin");
$requete= "Delete from \"TARGET\" where \"TARGET_ID\" in (select \"MOL_ID\" from \"MOL_ENTITY\" where \"NAME\"='$cloneid') and \"REGION_ID\"='$anatid' and \"IN_SITU_ID\"='$insituid'";
//print "<tr><td> ( Requete : $requete ) </tr></td>";

$stmt= pg_query($c,$requete) or die ("<strong>ERROR </strong>".pg_last_error($c));

// Validation de la transaction
if ($test=='n')
{
	/*$committed = OCICommit($connection);
	if(!$committed) {
        $error = OCIError($connection);
        echo 'ERROR:'.$error['message'];
    }*/
pg_query($c,"commit");

}

	
// Verification de la validation : si une erreur est survenue, afficher le message d'erreur

print '<table width="100%" border="0">';
print '<tr><td align="center"><H1>Validation done</H1></td></tr>';
print ' <br><center> To see changes refresh the "IN SITU FULL REPORT" page</center><br>';
print '<tr><td align="center"><center><input name="Exit" type="button" value="-= Close window =-" onClick="javascript:self.close();"></center></td></tr>';

	//ocilogoff($connection);
	
	
	
?>

</table>

</body>
</html>
 
 
 
 