<?php
	header('Content-type: text/html; charset=iso-8859-1');

// TEST : req.php?REQ=select oxg_countries.id_country, oxg_countries.libelle from oxg_events2, oxg_countries where oxg_events2.id_country = oxg_countries.id_country group by libelle

	$sReq=isset($_REQUEST["REQ"])?$_REQUEST["REQ"] : "";
	$sReq=stripslashes($sReq);
	include("admin/lib_inc.php");
	$sql_query=$sReq;
	$result = mysql_query( $sql_query ) or mysql_die();
	$numfields = mysql_num_fields($result);
	if($row = mysql_fetch_array($result))
	{
		$i=0;
		if(substr($row[$i],0,7)=="GEDTAG_")
		{
			echo decode_lng_text($row[$i]);
		}
		else
		{
			echo $row[$i];
		}
		for ($i=1;$i<$numfields;$i++)
		{
			if(substr($row[$i],0,7)=="GEDTAG_")
			{
				echo "¤".decode_lng_text($row[$i]);
			}
			else
			{
				echo "¤".$row[$i];
			}
		}
	}
	while($row = mysql_fetch_array($result))
	{
		echo "|";
		$i=0;
		if(substr($row[$i],0,7)=="GEDTAG_")
		{
			echo decode_lng_text($row[$i]);
		}
		else
		{
			echo $row[$i];
		}
		for ($i=1;$i<$numfields;$i++)
		{
			if(substr($row[$i],0,7)=="GEDTAG_")
			{
				echo "¤".decode_lng_text($row[$i]);
			}
			else
			{
				echo "¤".$row[$i];
			}
		}
	}
	mysql_close(); // Déconnexion de MySQL
?>