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

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



<?php

$name=$_GET["name"];
$type=$_GET["type"];
$anatid=$_GET["anatid"];
$species=$_GET["species"];
$stadedev = $_GET["stadedev"];
$childof = $_GET["childof"];
if ($type=="")
{
	echo "<CENTER><H3>ERROR: please select a type for this anatomy part.</H3></CENTER>";
	print '<br><center><input name="Exit" type="button" value="-= Close window =-" onClick="javascript:self.close();"></center>';

}
else
{
	//echo "name=$name  type=$type anatid=$anatid  species=$species  stadedev=$stadedev";


pg_query($c,"begin");

	$requete=" update \"ANAT_ENTITY\" set \"NAME\"='$name', \"TYPE\"='$type', \"CHILD_OF\"='$childof' where \"ANAT_ID\"='$anatid' and \"SPECIES\"='$species' and \"DEV_STAGE_ID\"='$stadedev'";
	$stmt = pg_query($c,$requete) or die("<strong>Error</strong> ".pg_last_error($c));

pg_query($c,"commit");
			
			print "<br><center><H1>Update done for $name</H1></center>";
			print '<tr><td align="center"><center><input name="Exit" type="button" value="-= Close window =-" onClick="javascript:self.close();"></center></td></tr>';
	
	

}
?>