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
| $requete = " SELECT * FROM aide_ac,aide_st WHERE aide_ac.structure = aide_st.s_clef ";
if (isset($_POST['public'])&&($_POST['public'])!="#")
{
$requete .= ' AND public = "'.$_POST['public'].'"';
}
if (isset($_POST['lieu'])&&($_POST['lieu'])!="#")
{
$requete .= ' AND lieu = "'.$_POST['lieu'].'"';
}
if (isset($_POST['activite'])&&($_POST['activite'])!="#")
{
$requete .= ' AND activite = "'.$_POST['activite'].'"';
}
if (($_POST['mot'])!="")
{
$requete .= " AND activite LIKE '%".strtolower($mot)."%' OR specifique LIKE '%".strtolower($mot)."%' OR description LIKE '%".strtolower($mot)."%' ";
}
$requete .= ' ORDER BY activite;';
// exécution de la requête
$req = mysql_query($requete) or die (mysql_error().$requete);
while ($data = mysql_fetch_array($req)) {
//affichage des résultats
echo '<table><tr><td class="txtg">Activités</td><td class="txtp">' , stripslashes(htmlentities(trim($data['activite']))) , '</td></tr>';
echo '<tr><td class="txtg">Description</td><td class="txtp">' , stripslashes(htmlentities(trim($data['description']))) , '</td></tr>';
echo '<tr><td class="txtg">Organisateur</td><td class="txtp">' , stripslashes(htmlentities(trim($data['s_nom']))) , '</td></tr>';
echo '<tr><td class="txtg">Horaires</td><td class="txtp">' , stripslashes(htmlentities(trim($data['horaires']))) , '</td></tr>';
echo '<tr><td class="txtg">Dates</td><td class="txtp">' , stripslashes(htmlentities(trim($data['dates']))) , '</td></tr>';
echo '<tr><td class="txtg">Tarifs</td><td class="txtp">' , stripslashes(htmlentities(trim($data['tarifs']))) , '</td></tr></table><br />';
}
} |
Partager