<?php
$init==0;
	//$init = isset($this->request->params[0]) ? 1 : 0;

	//$page = isset($this->request->params[0])?$this->request->params[0] : 1; 
	//if ($page== 'S') {$page=1;}
	
	echo "<center><h1>".decode_lng_text("SEARCH_TITLE")."</h1></center></br>";

	$nom = $_SESSION['s_rech_nom'];
	$nom_exact = $_SESSION['s_rech_nom_exact'];
	$prenom = $_SESSION['s_rech_prenom'];
	$prenom_exact = $_SESSION['s_rech_prenom_exact'];
	$sexe = $_SESSION['s_rech_sexe'];
	$lieu = $_SESSION['s_rech_lieu'];
	$lieu_exact = $_SESSION['s_rech_lieu_exact'];
	$start = $_SESSION['s_rech_start'];
	$end = $_SESSION['s_rech_end'];
	$choice =$_SESSION['s_rech_choice'];

	/*
	* affichage du panneau de selection des critères
	*/

echo "<form action=\"\" method='get'>";
echo "<input type=hidden name=FAMILY value=\"$FAMILY\">";
echo "<input type=hidden name=COUNTRY value=\"$COUNTRY\">";
echo "<input type=hidden name=ZONE value=\"$ZONE\">";
echo "<input type=hidden name=CITY value=\"$CITY\">";
echo "<center>";
echo "<table border=1><tr><td>";
echo display_lng_text("SEARCH_LAST_NAME");
echo " : </td><td><input type=text name=nom value=\"$nom\"></td>\n<td>";
echo display_lng_text("SEARCH_FISRT_NAME");
echo " : </td><td><input type=text name=prenom value=\"$prenom\"></td>\n<td>";
echo display_lng_text("SEARCH_SEXE");
echo " : </td><td><select name=sexe>";
echo "<OPTION value=>";
echo display_lng_text("SEARCH_SEXE_NO");
echo "</OPTION>";
echo "<OPTION ";
if ($sexe=="h")
echo "SELECTED ";
echo "value=\"h\">";
echo display_lng_text("SEARCH_SEXE_MALE");
echo "</OPTION>";
echo "<OPTION ";
if ($sexe=="f")
echo "SELECTED ";
echo "value=\"f\">";
echo display_lng_text("SEARCH_SEXE_FEMALE");
echo "</OPTION>";
echo "</SELECT></td>\n</tr>";
echo "<tr>";
echo "<td>".decode_lng_text("GEDTAG_DATE")." : </td><td colspan='5' rowspan='1'>";
echo decode_lng_text("DETAIL_DATE_BEGIN")." = <input type=text name=start value=\"$start\" SIZE=4>&nbsp;&nbsp;&nbsp;&nbsp;".decode_lng_text("DETAIL_DATE_END")." = <input type=text name=end value=\"$end\" SIZE=4>";
echo "</td></tr>";

echo "<tr><td>".decode_lng_text("INDEX_EVENT")." :</td>";
echo "<td colspan='4' rowspan='1'>";
if ($choice=='birth') {$check='checked';} else {$check='';}
echo "<input type='radio' name='choice' value='birth' $check>&nbsp;".decode_lng_text("GEDTAG_BIRT")."&nbsp;&nbsp;&nbsp;";
if ($choice=='wedding') {$check='checked';} else {$check='';}
echo "<input type='radio' name='choice' value='wedding' $check>&nbsp;".decode_lng_text("GEDTAG_MARR")."&nbsp;&nbsp;&nbsp;";
if ($choice=='death') {$check='checked';} else {$check='';}
echo "<input type='radio' name='choice' value='death' $check>&nbsp;".decode_lng_text("GEDTAG_DEAT")."&nbsp;&nbsp;&nbsp;";
if ($choice=='other') {$check='checked';} else {$check='';}
echo "<input type='radio' name='choice' value='other' $check>&nbsp;".decode_lng_text("PATRO_OTHER")."&nbsp;&nbsp;&nbsp;";
if ($choice=='all') {$check='checked';} else {$check='';}
echo "<input type='radio' name='choice' value='all' $check>&nbsp;".decode_lng_text("IDX_LIEUX_ALL")."&nbsp;&nbsp;";
echo "</td>";
echo "<td><center><input type=submit value=".decode_lng_text('PRIVATE_ENTER')."></center></td>";
echo "</tr></table></form>";
echo "</center>";

	if ($init==0) {
		echo "<div id=tab><h2><strong><i>".display_lng_text('SEARCH_NO_CRITERIA')."</i></strong></h2></div>";
		
	}
	
	echo "<center><input type=submit value=".decode_lng_text('PRIVATE_ENTER')." onClick='AttenteVisibility();'></center>";
	echo "</form></br>";
	echo "<div><a href='".Router::url('avis/recherches_guide')."'>".display_lng_text("SEARCH_GUIDE")."</a></div></br>";
	echo "</center>";

	// vue d'attente pendant la recherche
	
	echo "<div id='attente_retour' class='attente box2 w500p' >
			<table style='text-align: center; height=300px; width:100%;'>
			  <tbody>

				<tr>
				  <td style='text-align: center;'>
					<img width='400px' height='25px' src='".IMAGES."attente.gif' alt='Attente  recherches' /> 
				  </td>
				</tr>
				<tr>
				  <td style='text-align: center;font-size:16px;'>
						<p><br/><i>".display_lng_text('SEARCH_ATTENTE')."</i> <br/>  </p>
				  </td>
				</tr>
				
			  </tbody>
			</table>
				
		</div>";
		
	
/*
*     Affichage du résultat
*/

	if ($init==0) { return; }
	
	echo "<div id='recherches_resultats' style='visibility:display'>";
	echo "<div> <img src='".IMAGES."ligne_orange.png' width=100% height='2px'></div>";

	echo "<table>";
	$nb_res_max = count($_SESSION['t_recherches_resultats']);

