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

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

$name=$_GET["name"];
$id=$_GET["id"];
$from=$_GET["from"];
$to=$_GET["to"];
$inib=$_GET["inib"];
$updown=$_GET["updown"];


$requete="DELETE FROM \"MUTANT\" where \"NAME\"='$name' AND \"IN_SITU_ID\"='$id' AND \"FROM_ID\"='$from' AND \"UP_DOWN\"='$updown'";

if (strlen($to)>0) $requete.=" AND \"TO_ID\"='$to'";

if (strlen($inib)>0) $requete.="AND \"INHIBITOR_ID\"='$inib'";

//$requete="DELETE FROM \"MUTANT\" where \"NAME\"='$name' AND \"IN_SITU_ID\"='$id' AND \"FROM_ID\"='$from' AND \"TO_ID\"='$to' AND \"INHIBITOR_ID\"='$inib' AND \"UP_DOWN\"='$updown'";
//print $requete;
pg_query($c,"begin");
$stmt=pg_query($c,$requete);
pg_query($c,"commit");


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>';




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

</body>
</html>