$genre='2';
if(!($connecte = @mysql_connect($dbhost, $dblogin, $dbpassword)))
{
echo erreurServeurMySQL();
}
if (!isset($deb))
{
$deb = 0;
}
if ($connecte)
{
mysql_select_db($dbname);
# Recherche par date
if ($genre==1)
{
$separateur='-';
$temp=split($separateur,$nom,3);
$day=$temp[0];
$month=$temp[1];
$year=$temp[2];
$nom = mktime(0,0,0,"$month","$day","$year");
$query_tous=mysql_query("select * from $tableAgenda where date_fin>='$nom' and date_deb<='$nom' and etat=1 order by date_deb");
$query_affiche=mysql_query("select * from $tableAgenda where date_fin>='$nom' and date_deb<='$nom' and etat=1 order by date_deb limit $deb,$nbrchamp ");
}
# Recherche par événement
if ($genre==2)
{
$query_tous=mysql_query("select * from $tableAgenda where manif like '%$nom%' and etat=1 order by date_deb");
$query_affiche=mysql_query("select * from $tableAgenda where manif like '%$nom%' and departement like '33' and etat=1 order by date_deb limit $deb,$nbrchamp ");
$popol=$row[7];
}
# Recherche par lieu
if ($genre==3)
{
$query_tous=mysql_query("select * from $tableAgenda where lieu like '%$nom%' and etat=1 order by date_deb");
$query_affiche=mysql_query("select * from $tableAgenda where lieu like '%$nom%' and departement like '33' and etat=1 order by date_deb limit $deb,$nbrchamp ");
}
# Recherche par rubrique
if ($genre==4)
{
$query_tous=mysql_query("select * from $tableAgenda where rubrique like '%$nom%' and etat=1 order by date_deb");
$query_affiche=mysql_query("select * from $tableAgenda where rubrique like '%$nom%' and departement like '33' and etat=1 order by date_deb limit $deb,$nbrchamp ");
}
# Recherche par ville
if ($genre==5)
{
$query_tous=mysql_query("select * from $tableAgenda where ville like '%$nom%' and etat=1 order by date_deb");
$query_affiche=mysql_query("select * from $tableAgenda where ville like '%$nom%' and departement like '33' and etat=1 order by date_deb limit $deb,$nbrchamp ");
}
$count=mysql_num_rows($query_tous);
if (mysql_num_rows($query_affiche) == 0)
{
// Si il n'y a pas de résultats
$nom2=strtoupper($nom);
echo "Il n'y a pas d'événements pour $nom2 en ce moment. ";
}
else
{
while($row = mysql_fetch_row($query_affiche))
{
affiche_evenement_spectacle($row[0]);
}
}
if ($genre==1)
{
[email protected]("d-m-Y",$nom);
}
}
?>
|
|