<?php
	$stats_accueil = $_SESSION['t_stats_accueil'];

		// skin = BLANC_BOXES ARRONDIES
		$fontcolor='#fceed';
		$bgcolor0='#593408'; // couleur du bandeau d'entete
		$bgcolor1='#fceed0'; // couleur du menu latéral
		$bgcolor2='#ffffd9'; // couleur du fond des pages
		$bgcolor3='#ffffd9'; // couleur du fond ddu menu principal

?>
	
		<body bgcolor=<?php echo $bgcolor2; ?>>
		<div id=menutop>
		<table bgcolor=<?php echo $bgcolor0; ?> width='100%' cellspacing=0 cellpadding=10>
		<tr><td width='300px'><center><?php display_country_flags() ?></center></td>
		<td><center>
		<table border='0' cellspacing='0' cellpadding='5' bgcolor=<?php echo $bgcolor3; ?> <tr><th>&nbsp; &nbsp; &nbsp;</th>
<?php		



	if($_SESSION['s_page']=="accueil") {
		?>
		<th><?php echo display_lng_text('INDEX_LNK_IDX'); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		?>
		<th><a href='<?php echo Router::url('accueil/index') ?>'><?php echo display_lng_text("INDEX_LNK_IDX"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	if($_SESSION['s_page']=="patro")
	{
		?>
		<th><?php echo display_lng_text("INDEX_LNK_PATRO"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		?>
		<th><a href='<?php echo Router::url('patronymes/index') ?>'><?php echo display_lng_text("INDEX_LNK_PATRO"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
		
	}
	if($_SESSION['s_page']=="lieux")
	{
		?>
		<th><?php echo display_lng_text("INDEX_LNK_PLACES"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		?>
		<th><a href='<?php echo Router::url('lieux/index') ?>'><?php echo display_lng_text("INDEX_LNK_PLACES"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	if($_SESSION['s_page']=="dates")
	{
		?>
		<th><?php echo display_lng_text("INDEX_LNK_DATES"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		?>
		<th><a href='<?php echo Router::url('dates/index') ?>'><?php echo display_lng_text("INDEX_LNK_DATES"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	if($_SESSION['s_page']=="stats")
	{
		?>
		<th><?php echo display_lng_text("INDEX_LINK_STATS"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		?>
		<th><a href='<?php echo Router::url('statistiques/top_10') ?>'><?php echo display_lng_text("INDEX_LINK_STATS"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	if($_SESSION['s_page']=="family")
	{
		?>
		<th><?php echo display_lng_text("FAMILY_TITLE"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		?>
			<th><A HREF='<?php echo Router::url('familles/index') ?>'><?php echo display_lng_text("FAMILY_TITLE"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php

		}
	if($_SESSION['s_page']=="search")
	{
		?>
		<th><?php echo display_lng_text("INDEX_LNK_SEARCH"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		?>
		<th><A HREF='<?php echo Router::url('recherches/individus') ?>'><?php echo display_lng_text("INDEX_LNK_SEARCH"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	if ($_SESSION['b_connecte']==true)  
	{
		?>
		<th><A HREF="<?php echo Router::url('users/logout')?>"><?php echo display_lng_text("INDEX_LNK_LOGOUT"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		$url = str_replace ("&", "*", $_SERVER['REQUEST_URI']);
		?>
		<th><a href="<?php echo Router::url('users/login')?>"><?php echo display_lng_text("INDEX_LNK_PRIVATE"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	if ($_SESSION['b_connecte']==true and $_SESSION['s_privilege']=="admin")
	{
		if($_SESSION['s_page']=="admin") {
			?>
			<th><?php echo display_lng_text("INDEX_LNK_ADMIN"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
			<?php
		}
		else {
			?>
			<th><a href="<?php echo Router::url('users/admin_index')?>"><?php echo display_lng_text("INDEX_LNK_ADMIN"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
			<?php
			
		}
	}
?>
</tr></table>
</td></tr></table>
</div>

<?php

if($_SESSION['s_skin'] == 'BROWN_TOP_LEFT' ) {
	echo "<div id='corps'>";
}
else {
	echo "<div id='corps' style=' margin: 0 auto; width:80%;'>";
}
	
if($_SESSION['s_page']=="accueil" || $_SESSION['s_skin'] == 'BROWN_TOP_LEFT' ) {
?>	
<table border=0 width=100%><tr><td>
<?php


	echo "<a name=\"top\"></a>";
	echo "<div>";
	echo "<table>";
	echo "<tr><td id=menucote></td><td valign='top'>";
	echo "<tr><td width='300px' id=menucote>";
	echo "<table>";
	echo "<tbody><tr><td bgcolor=".$bgcolor0." width='25%'><br>";
	echo "<font color=".$fontcolor." face='helvetica'><b>".decode_lng_text('INDEX_IND')."</b></font><br><br>";
	echo "<table border='0' cellpadding='10' cellspacing='0' width='98%'>";
	echo "<tbody><tr><td bgcolor=".$bgcolor1." width='100%'><font color=".$fontcolor.">";
	echo "<a href='".Router::url('patronymes/index')."'>".decode_lng_text('INDEX_LNK_PATRO')."</a></font><br>";
	echo "<font color=".$fontcolor."><a href='".Router::url('patronymes/flashlist')."'>".decode_lng_text('FLASH_TITLE')."</a></font><br>";
	echo "<font color=".$fontcolor."><a href='".Router::url('statistiques/top_10')."'>".decode_lng_text('INDEX_LINK_STATS')."</a></font><br>";
	echo "<font color=".$fontcolor."><a href='".Router::url('recherches/individus')."'>".decode_lng_text('INDEX_LNK_SEARCH')."</a></font><br>";
	echo "</td></tr></tbody></table><br>";
	echo "<font color=".$fontcolor." face='helvetica'><b>".decode_lng_text('INDEX_LNK_PLACES')."</b></font><br><br>";
	echo "<table border='0' cellpadding='10' cellspacing='0' width='98%'>";
	echo "<tbody><tr><td bgcolor=".$bgcolor1." width='100%'>";
	echo "<font color=".$fontcolor."><a href='".Router::url('lieux/index/birth')."'>".decode_lng_text('GEDTAG_BIRT')."</a></font><br>";
	echo "<font color=".$fontcolor."><a href='".Router::url('lieux/index/wedding')."'>".decode_lng_text('GEDTAG_MARR')."</a></font><br>";
	echo "<font color=".$fontcolor."><a href='".Router::url('lieux/index/death')."'>".decode_lng_text('GEDTAG_DEAT')."</a></font><br>";
	echo "<font color=".$fontcolor."><a href='".Router::url('lieux/index/')."'>".decode_lng_text('IDX_LIEUX_ALL')."</a></font><br>";
	echo "</td></tr></tbody></table><br>";
	echo "<font color=".$fontcolor." face='helvetica'><b>".decode_lng_text('GEDTAG_DATE')."</b></font><br><br>";
	echo "<table border='0' cellpadding='10' cellspacing='0' width='98%'>";
	echo "<tbody><tr><td bgcolor=".$bgcolor1." width='100%'>";
	echo "<font color=".$fontcolor."><a href='".Router::url('statistiques/birthday')."'>".decode_lng_text('BIRTHDAY_INDEX')."</a></font><br>";
	echo "</td></tr></tbody></table><br>";
	echo "<font color=".$fontcolor." face='helvetica'><b>".decode_lng_text('IDX_LIEUX_MAP')."</b></font><br><br>";
	
	echo "<table border='0' cellpadding='10' cellspacing='0' width='98%'>";
	echo "<tbody><tr><td bgcolor=".$bgcolor1." width='100%'>";
	$i = 0;
//echo count($_SESSION['s_place']);
	while ($i < count($stats_accueil['s_place']))
	{
		echo "<font color=".$fontcolor."><a href='".Router::url('cartes/index/'.$stats_accueil['s_place'][$i]['code'])."'>".$stats_accueil['s_place'][$i]['name']."</a></font><br>";
		$i += 1;
	}

	echo "</td></tr></tbody></table>";
	echo "<br></td></tr></tbody></table>";
	
	if($_SESSION['s_skin']=="BLUE_TOP") {	
		echo "</td><td width='75%'>";
		echo "<center><h1>".$sTitleM2."</h1></center>";
		echo "<table cellpadding='10'cellspacing='0' width='100%' >";
		echo "<tr><td bgcolor=".$bgcolor2.">";
	}
	else {
		echo "</td><td width='80%'>";
		echo "<center><h1>".$sTitleM2."</h1></center>";
		echo "<table cellpadding='10'cellspacing='0' width='100%' class='contour'>";
		echo "<tr><td bgcolor=".$bgcolor1.">";	
	}
}
?>