<?php
	
	$nbre = $_SESSION['s_top_nbre'];

	echo "<center><h1>".decode_lng_text("STATS_AGE_TITLE")."</h1></center></br>";
//var_dump($_SESSION['t_age_details'] );
	
//	foreach ($_SESSION['t_age_details'] as $ligne) {

	echo "</center>";

	echo "<div id=panel>";
	echo "<br/>";
	echo "<form action='".Router::url('statistiques/top_age')."' method=post>";

	echo "<center>";
	echo "<table border=1><tr><td>";
	echo decode_lng_text("STATS_TOP15_PATRO_L");
	echo " <input type=text name=nbre value='".$nbre."' maxlength=5 size=5></td>\n<td>";
	echo "<td><input type=submit value=".decode_lng_text('PRIVATE_ENTER')."></td></tr></table></form>";
	echo "</center>";
	echo "</div>";
	
	// Affichage de l'age des mariés
	echo "<p>";
	echo decode_lng_text("STATS_AGE_WM")." : ";
	echo floor($_SESSION['t_age_details']['wedding_age_average_h'])." ".decode_lng_text(' STATS_OLD_2')."</br>";
	echo decode_lng_text("STATS_AGE_WW")." : ";
	echo floor($_SESSION['t_age_details']['wedding_age_average_f'])." ".decode_lng_text(' STATS_OLD_2')."</br>";	
	echo "</p>";
	
	// Affichage de l'age moyen au moment du décès 
	echo "<p>";	
	echo decode_lng_text("STATS_AGE_DM")." : ";
	echo floor($_SESSION['t_age_details']['death_age_average_h'])." ".decode_lng_text(' STATS_OLD_2')."</br>";
	echo decode_lng_text("STATS_AGE_DW")." : ";
	echo floor($_SESSION['t_age_details']['death_age_average_f'])." ".decode_lng_text(' STATS_OLD_2')."</br>";	
	echo "</p>";
	

	// Affichage l'age moyen au moment du décès  des adultes
	echo "<p>";
	echo decode_lng_text("STATS_AGE_DOM")." : ";
	echo floor($_SESSION['t_age_details']['death_age_average_adults_h'])." ".decode_lng_text(' STATS_OLD_2')."</br>";
	echo decode_lng_text("STATS_AGE_DOW")." : ";
	echo floor($_SESSION['t_age_details']['death_age_average_adults_f'])." ".decode_lng_text(' STATS_OLD_2')."</br>";	
	echo "</p>";
	
	// Calcul de l'age moyen au moment du décès  des enfants
	echo "<p>";
	echo decode_lng_text("STATS_AGE_DYM")." : ";
	echo floor($_SESSION['t_age_details']['death_age_average_children_h'])." ".decode_lng_text(' STATS_OLD_2')."</br>";
	echo decode_lng_text("STATS_AGE_DYW")." : ";
	echo floor($_SESSION['t_age_details']['death_age_average_children_f'])." ".decode_lng_text(' STATS_OLD_2')."</br>";	
	echo "</p>";
	
	$here=decode_lng_text("STATS_HERE");

	echo "<p>".decode_lng_text("STATS_ARTICLE")." 15 ".decode_lng_text("STATS_TOP15_OLP")."  <a href='".router::url('statistiques/top_oldest/15')."' <b>$here</b></a></p>";

	echo "<p>".decode_lng_text("STATS_ARTICLE")." 15 ".decode_lng_text("STATS_TOP15_LML")."  <a href='".router::url('statistiques/top_oldestdead/15')."' <b>$here</b></a></p>";
	
	echo "<p>".decode_lng_text("STATS_ARTICLE")." 15 ".decode_lng_text("STATS_TOP15_YW")."  <a href='".router::url('statistiques/top_wedding/15/asc')."' <b>$here</b></a></p>";
	
	echo "<p>".decode_lng_text("STATS_ARTICLE")." 15 ".decode_lng_text("STATS_TOP15_OW")."  <a href='".router::url('statistiques/top_wedding/15/desc')."' <b>$here</b></a></p>";

	echo "</table></center>";

//	}