<?php
	include '../../autoload.php';
	$answer="<root>";
	$point_id	=	$_REQUEST['point_id'];
	
	error_log ( "$quaadpoint_tag_id : ".$quaadpoint_tag_id );			
	
	if ( $point_id >= 0 )
	{
		$conn = get_dbconnection();
		
		$sql = "delete from quaad_description where id_quaadpoint=".$point_id;
		
		$query = pg_query ( $conn, $sql );
		if ( !$query )
		{
			$err = pg_last_error ($conn);
			
			$answer .= "<status value=\"".$err."\"></status>";
		}
		else
		{
			$sql = "delete from link_quaad_tag where id_quaadpoint=".$point_id;
		
			$query = pg_query ( $conn, $sql );
			if ( !$query )
			{
				$err = pg_last_error ($conn);
				
				$answer .= "<status value=\"".$err."\"></status>";
			}
			else
			{
				$sql = "delete from quaad_point where id=".$point_id;
		
				$query = pg_query ( $conn, $sql );
				if ( !$query )
				{
					$err = pg_last_error ($conn);
				
					$answer .= "<status value=\"".$err."\"></status>";
				}
				else
					$answer .= "<status value=\"ok\"></status>";
			}
		}
	}
	
	$answer.="</root>";
	header('Content-Type: text/xml');
	echo $answer;
?>