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

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

<CENTER><H1>Add an anatomy part.</H1></CENTER><br>
<hr size="1">
<br>


<?php

$name=$_GET["name"];
$type=$_GET["type"];
$childof=$_GET["childof"];
$species=$_GET["species"];
$nomstade=$_GET["nomstade"];
$stadedev = $_GET["stadedev"];
//print "$name; $type; $childof; $species; $nomstade; $stadedev ";


$requete="INSERT INTO \"BIO_ENTITY\" (\"BIO_ID\") values (nextval('\"S_BIO_ID\"'))";
/*Debut de transaction*/
pg_query($c,"begin");
$stmt= pg_query($c,$requete) or die("<strong>Error</strong> ".pg_last_error($c));


	//ocifreestatement($stmt);
	$requete="INSERT INTO \"ANAT_ENTITY\" (\"ANAT_ID\", \"DEV_STAGE_ID\", \"SPECIES\", \"NAME\", \"TYPE\", \"CHILD_OF\") values ( currval('\"S_BIO_ID\"'),'$stadedev','$species', '$name','$type','$childof')";
	
	$stmt= pg_query($c,$requete) or die("<strong>Error</strong> ".pg_last_error($c));

pg_query($c,"commit");
			
		print "<br><center><H1>INSERT 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>';
		
	

?>
