<?
include("../lib_sa.php");

?>
<html>
<head>
<title>recherche des Membres de la Linneenne</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">


	<table width="100%" height="100%" border="1" cellpadding="10" cellspacing="2" class="linn">
		<form name="form2" method="post" action="<? echo $PHP_SELF ?>">
			<tr align="left" valign="top" height="20"> 
			<td  align="left" valign="top"><p><font size="3"><b>R&eacute;sultat de votre recherche sur&nbsp;&nbsp; 
			<input name="saisie" type="text" id="saisie" value="<? echo $saisie ?>" size="26" maxlength="40">
			</b></font><a href="javascript:document.form2.submit();">&nbsp;&nbsp;rechercher</a> </p>
			<br></td>
			</tr>
		</form>
		<tr align="left" valign="top"><td align="left" valign="top">
		<?php
			$saisie = $_POST['saisie']; 
			//$saisie2=htmlentities($saisie);
			//$saisie2=$saisie;
			if(isset($saisie)) {
				$saisie=echappeSQL($saisie);
				$requete = "SELECT * FROM participants WHERE
					nom like '%$saisie%' OR
					prenom like '%$saisie%' OR
					date_naissance like '%$saisie%' OR
					date_deces LIKE '%$saisie%' OR
					profession LIKE '%$saisie%' OR
					specialite LIKE '%$saisie%' OR
					lieu_naissance LIKE '%$saisie%' OR
					lieu_deces LIKE '%$saisie%' OR
					date_titularisation LIKE '%$saisie%' OR
					membre_honoraire LIKE '%$saisie%' OR
					fonctions LIKE '%$saisie%' OR
					etat LIKE '%$saisie%' OR
					lien LIKE '%$saisie%'
					ORDER BY nom,prenom";
				$result = mysql_db_query($database, $requete);
				echo "<p> Résultats de recherche pour '" . $saisie . "' </p>";
				/* echo mysql_error(); */
				?>
				<table>
					<thead>
						<tr>
							<th>
							Nom
							</th>
							<th>
							Pr&eacute;nom(s)
							</th>
							<th>
							Date de naissance
							</th>
							<th>
							Date de d&eacute;c&egrave;s
							</th>
							<th>
							Profession
							</th>
							<th>
							Sp&eacute;cialit&eacute;
							</th>
							<th>
							Lieu de naissance
							</th>
							<th>
							Lieu de d&eacute;c&egrave;s
							</th>
							<th>
							Date de titularisation
							</th>
							<th>
							Lien
							</th>
							
						</tr>
						<?php
						while ($voir = mysql_fetch_array($result))
						{
							echo '<tr><td>';
							echo $voir['nom'];
							echo '</td><td>';
							echo $voir['prenom'];
							echo '</td><td>';
							echo $voir['date_naissance'];
							echo '</td><td>';
							echo $voir['date_deces'];
							echo '</td><td>';
							echo $voir['profession'];
							echo '</td><td>';
							echo $voir['specialite'];
							echo '</td><td>';
							echo $voir['lieu_naissance'];
							echo '</td><td>';
							echo $voir['lieu_deces'];
							echo '</td><td>';
							echo $voir['date_titularisation'];
							echo '</td><td>';
							if ($voir['lien'])
								echo '<a target="_blank" href="'.$voir['lien'].'">Cliquez ici</a></td></tr>';
						}
					echo "</table>";
			}
		?>
		</td></tr>
	</table> 
</body>
</html>
