<?php

	// on recupere le nom choisi
	//$id = $this->request->data->patro; 
	
	$family=$this->request->params[1];
	$name_family = $_SESSION['t_familles'][$family]['nom_famille'];
	$id_sosa_actuel=$_SESSION['t_familles'][$family]['id_sosa_actuel'];
	
	//echo $family." = ".$id_family.' '.$name_family."</br>";
	
	echo "<center><h1>".decode_lng_text("SOSA_TITLE")."</h1></center>";
	
	echo "<br/><center><h2>".decode_lng_text('SOSA_MODIFY2')."</br> \"".$name_family."\"</h2></center>";
	echo "<div id=panel>";
	//echo "<form action=".Router::url('familles/sosa/1')." method=post>";
	echo "<form action='' method=post>";
	echo "<center>";
	echo "<table border=0><tr>";
	
	echo "<tr><td>";
	//Liste des patronymes
	echo "<select id='patro' name='patro' onchange='ObtenirSosaIndividus(\"".BASE_URL."\");' >";
	echo "<OPTION value=''>".decode_lng_text('SOSA_PATRO')."</OPTION>";

	foreach ($_SESSION['t_patronymes'] as $k =>$patro) {
		if ($id==$patro[patro_id]) {
			echo "<option value=".$patro[patro_id]." selected ='selected'>".$patro[patro_libelle]."</option>";
		}
		else {
		echo "<option value=".$patro[patro_id].">".$patro[patro_libelle]."</option>";
		}
		
	}
	echo "</select>";
	
	if ($this->request->params[0] == 1)  {
		echo "</td><td>&nbsp&nbsp</td><td>";
	
	}
	// //Liste des personnes
	
		echo "<select id='personnes' name='personnes' >";
		echo "<OPTION value=''>".decode_lng_text('SOSA_PERSON')."</OPTION>";
		foreach ($_SESSION['t_personnes'] as $k =>$personne) {
			echo "<option value=".$personne[id].">".$personne[identite]."</option>";
		}
		
	echo "</td></tr></table>";
	echo "</br>"; 
	echo "<input id='family' type='hidden' value='".$family."'>";
	echo "<input type='submit' value='".decode_lng_text('PRIVATE_ENTER')."' onClick='SosaConfirm(\"".BASE_URL."\");return false;'></form>";
	echo "</center>";

	echo "</div>";
	echo "<div id='confirmation'></div>";	




?>
