1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
<input type="button" class="button" data-toggle="modal" data-target="#id_ton_modal" value="valider" name="valider"/>
<!-- fenêtre modale en Bootstrap--------------->
<div class="modal fade" id="id_ton_modal" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" >Résultat de la recherche</h4>
</div>
<div class="modal-body">
<p>La liste des structures : </p>
<?php
//
if (isset($_POST['valider']))
{ ?>
<?php $nationalite=(!empty($_POST['nationalite']))?($_POST['nationalite']):NULL;
$statut_conflit=(!empty($_POST['statut_conflit']))? $_POST['statut_conflit']:NULL;
$etat=(!empty($_POST['etat']))? $_POST['etat']:NULL;
//$sepulture=$_POST['id_sepulture'];
$sexe=(!empty($_POST['sexe']))? $_POST['sexe']:NULL;
$age=( !empty($_POST['age']))? $_POST['age']:NULL;
$particularite=(!empty($_POST['particularite']))? $_POST['particularite']:NULL;
$confession=(!empty($_POST['confession']))? $_POST['confession']:NULL;
$institution=(!empty($_POST['institution']))? $_POST['institution']:NULL;
$administrative=(!empty($_POST['administrative']))? $_POST['administrative']:NULL;
$aide_sociale=(!empty($_POST['aide_sociale']))? $_POST['aide_sociale']:NULL;
/* Recherche selon +sieurs critères */
$criteres=array();
if( !empty($_POST['nationalite']) )
$criteres[]="id_nationalite LIKE '{$_POST['nationalite']}'";
if( !empty($_POST['statut_conflit']) )
$criteres[]="id_statut_conflit LIKE '{$_POST['statut_conflit']}'";
if( !empty($_POST['etat']) )
$criteres[]="id_etat LIKE '".$_POST['etat']."'";
if( !empty($_POST['sepulture']) )
$criteres[]="id_sepulture LIKE '{$_POST['sepulture']}'";
if( !empty($_POST['sexe']) )
$criteres[]="id_sexe LIKE '{$_POST['sexe']}'";
if( !empty($_POST['age']) )
$criteres[]="id_age LIKE '{$_POST['age']}'";
if( !empty($_POST['particularite']) )
$criteres[]="id_particularite LIKE '{$_POST['particularite']}'";
if( !empty($_POST['confession']) )
$criteres[]="id_confession LIKE '{$_POST['confession']}'";
if( !empty($_POST['institution']) )
$criteres[]="id_institution LIKE '{$_POST['institution']}'";
if( !empty($_POST['administrative']) )
$criteres[]="id_administrative LIKE '{$_POST['administrative']}'";
if( !empty($_POST['aide_sociale']) )
$criteres[]="id_aide_sociale LIKE '{$_POST['aide_sociale']}'";
//etc
$strWhere = isset($criteres) && count($criteres)>0 ? " WHERE " . implode(' AND ', $criteres) : '';
$sql="SELECT * FROM categorisation " . $strWhere ;
//echo " <br> REQUETE : <br>".$sql;
$sth = $bdd->prepare($sql);
$sth->execute();
/* Afficher les résultats */
$result = $sth->fetchAll();
?>
<h3> La liste des structures : </h3>
<?php
if(count($result)){
foreach( $result as $donnees ){
// echo $donnees['id_struct'].'<br>';
$id_struct=$donnees['id_struct'];
$sql2="SELECT * FROM structure WHERE id_struct='$id_struct'";
//echo $sql2;
$sth = $bdd->prepare($sql2);
$sth->execute();
/* Afficher les résultats */
$result = $sth->fetchAll();
//echo"Les noms des structures : ";
foreach( $result as $donnees ){
$contact=$donnees['nom_contact'];
$struct=$donnees['id_struct'];
?>
<a href="lecture_structure_affichage.php?nom_contact=<?php echo $contact; ?>"> <?php echo $contact.'<br>'; ?></a>
<?php
}}
}else {
echo "<br> Aucun résultat trouvé !";
}
?>
<?php
}
?>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button> <!-- la proprieté data-dismiss : permet de cacher le le modal en cliquant sur le bouton -->
</div>
</div> |
Partager