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

?>

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


<?

	$name=$_GET["name"];
	//$name=strtoupper($name);
	if(strlen($name)==0){
	    print '<center><h2><strong>Missing parameter: gene Name </strong></h2></center>';
		include("frames_footer.php");
		return;
	}

	$syno=$_GET["syno"];
	
	
	$species=$_GET["species"];
	

	//Recup du mol_id etant donne le gene_id
/*
	$requete="SELECT \"GENE_ID\" FROM \"GENE\" WHERE \"NAME\"='$name'";
	$stmt=pg_query($c,$requete);

	$row=pg_fetch_array($stmt);
	$molid=$row["GENE_ID"];

	*/
	//Suppression dans la base

	pg_query($c,"begin");

	//$requete="INSERT into \"GO_DESCRIPTION\" (\"MOL_ID\",\"GO_ID\") values ('$molid','$go')";
	//$requete="DELETE FROM \"SYNO\" where \"GENE_ID\"='$molid' and \"SYNO\"='$syno'";


	$requete="DELETE from \"GENE_CONCEPT_NAME\" where \"GENE_CLUSTER_ID\"='$name' and \"GENE_CLUSTER_NAME\"='$syno'";
	

	$stmt=pg_query($c,$requete);

	if (!$stmt)
		{
		print "Error: ".pg_last_error($c);
		pg_query($c,"rollback");
		include ("frames_footer.php");
		return;
		}




	pg_query($c,"commit");

	print "<center><strong> Synonym successfuly removed </strong></center>";


	









?>


<?

include ("frames_footer.php");
?>