<?php

	$sPage  = "places_ind";
	require("admin/§lib_inc.php");

	$FAMILY=isset($_REQUEST["FAMILY"])?$_REQUEST["FAMILY"] : -1; 
	//$sTitle = decode_lng_text("DETAIL_ZONE_TITLE");

	$DAY=isset($_REQUEST["DAY"])?$_REQUEST["DAY"] : 0; 
	$MONTH=isset($_REQUEST["MONTH"])?$_REQUEST["MONTH"] : 0; 

	$month=decode_lng_text("MONTH$MONTH");

	$sTitle = $DAY." ".$month;

	require("§menu.php");

	if($FAMILY!=-1)
	{
		$sReqFam=" and id_family=$FAMILY ";
	}
	else
	{
		$sReqFam="";
	}
/*	if($bSessionOk==false)
	{
		$sReqCont=" and contemporary=1 ";
	}
	else*/
	{
		$sReqCont="";
	}

	//set_time_limit(0);
	
	flush();


	$result = mysql_query( "select devnt, type, id_event from oxg_events2 where right(left(devnt,7),2)+100='$MONTH'+100 and right(devnt,2)+100='$DAY'+100 $sReqFam order by left(devnt,4)");
	echo "<table>";
	while($row = mysql_fetch_array($result))
	{
		$year = substr($row['devnt'], 0, 4);
		echo "<tr><th align=right>".$year."</th>";

		//$result_t = mysql_query( "select type, id_event, info2 from oxg_events where id_event=$row[id_father]");
		//$row_t = mysql_fetch_array($result_t);
		$compagne="";

		$acte=decode_lng_text("GEDTAG_EVEN")." ".decode_lng_text("GEDTAG_OF")." ";
		if ($row['type']==51) { $acte=decode_lng_text("GEDTAG_BIRT")." ".decode_lng_text("GEDTAG_OF")." "; }
		if ($row['type']==115) { $acte=decode_lng_text("GEDTAG_MARR")." ".decode_lng_text("GEDTAG_BTW")." "; $compagne = $row['id_event'];}
		if ($row['type']==82) { $acte=decode_lng_text("GEDTAG_DIV")." ".decode_lng_text("GEDTAG_BTW")." "; $compagne = $row['id_event'];}
		if ($row['type']==77) { $acte=decode_lng_text("GEDTAG_DEAT")." ".decode_lng_text("GEDTAG_OF")." "; }
		if ($row['type']==55) { $acte=decode_lng_text("GEDTAG_BURI")." ".decode_lng_text("GEDTAG_OF")." "; }
		if ($row['type']==47) { $acte=decode_lng_text("GEDTAG_BAPM")." ".decode_lng_text("GEDTAG_OF")." "; }
		if ($row['type']==64) { $acte=decode_lng_text("GEDTAG_BAPM")." ".decode_lng_text("GEDTAG_OF")." "; }
		echo "<td>".$acte."</th>";
		//affichage de la personne
		$id_ind=donne_ind_evnt($FAMILY, $row['id_event']);
		echo "".affiche_lien_individu($FAMILY, $id_ind);
		//affichage du conjoint
		if ($compagne != "") {
			$req = "select info2 from oxg_events where id_event=$compagne $sReqFam";
			$res = mysql_query($req);
			$row = mysql_fetch_array($res);
			$compagne = $row['info2'];
			$result_cont = mysql_query( "select * from oxg_individuals where id_individual=$compagne $sReqCont $sReqFam");
			if ($row_cont = mysql_fetch_array($result_cont))
				{
				echo " ".decode_lng_text("GEDTAG_AND")." ".affiche_lien_individu($FAMILY, $compagne, true, false);
				}
			else
				{
				echo " ".decode_lng_text("GEDTAG_AND")." X";
				}
			}
		echo "</td></tr>";
		flush();
	}
	echo "</table>";


	affiche_pied_page(true);

?>
