<?php
	include '../../autoload.php';
	
	$id	= $_POST['id'];
	$language = $_POST['language'];
	
	$conn = get_dbconnection();

	$sql = "select id, description_summary as name, description from quaad_description where id_quaadpoint=".$id." and language='".$language."'";
	
	
	$answer="<root>";
	$query = pg_query($conn,$sql);
	if($query)
	{
		if($row = pg_fetch_row($query))
		{
			$answer.="<quaad_description>";
			$answer.="<id>".htmlspecialchars($row[0], ENT_XML1, 'UTF-8')."</id>";
			$answer.="<name>".htmlspecialchars($row[1], ENT_XML1, 'UTF-8')."</name>";
			$answer.="<description>".htmlspecialchars($row[2], ENT_XML1, 'UTF-8')."</description>";
			$answer.="</quaad_description>";
		}
	}
	
	$answer.="</root>";
	header('Content-Type: text/xml');
	echo $answer;
?>