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


	$motif=$_POST["motifid"];
	$name=$_POST["name"];

	//Mise a jour
	pg_query($c,"begin");	
	$requete="update \"MOTIF_REGUL\" set \"NAME\"='$name' where \"MOTIF_ID\"=$motif";
	pg_query($c,$requete) or die("<strong>Error</strong> ".pg_last_error($c));

	pg_query($c,"commit");
		
	echo '<SCRIPT LANGUAGE="JavaScript"> javascript:opener.location.reload(); self.close(); </script>';	    
	include ("frames_footer.php"); 
				
?>

</body>
</html>