require ('config/config.inc.php3');
HAUTPAGE("affichage");
?>
|
Rubrique echo $categorie; ?>
|
include ("connect.inc.php3");
$lechoix="";
if ($choix)
{
$lechoix=$choix;
}
if ($debut=="") { $debut=0; }
$sql="SELECT * FROM $table WHERE affiche='O' AND categorie='$categorie' ORDER BY numero DESC ";
$TableRep=mysql($database,$sql);
$nbe=mysql_NumRows( $TableRep);
?>
switch($action)
{
case "filtrer";
// récupération du nombre d'annonces correspondantes au critère
$TableRep1=mysql($database,"SELECT * FROM $table WHERE categorie='$categorie' and affiche='O' AND choix='$lechoix'");
$nbe=mysql_NumRows( $TableRep1);
$TableRep=mysql($database,"SELECT * FROM $table WHERE categorie='$categorie' and affiche='O' AND choix='$lechoix' ORDER BY numero DESC limit $debut,$nb_affichage");
$top=1;
$topsuivant="affi_ann.php3?action=filtrer&categorie=$categorie&choix=$choix";
break;
case "rechercher";
$instruction1="SELECT * FROM $table WHERE commentaire LIKE '%$nom_a_chercher%' and affiche = 'O' and categorie='$categorie' ";
$TableRep1=mysql($database,$instruction1);
$nbe=mysql_NumRows( $TableRep1);
$instruction="SELECT * FROM $table WHERE commentaire LIKE '%$nom_a_chercher%' and affiche = 'O' and categorie='$categorie' limit $debut,$nb_affichage";
$TableRep=mysql($database,$instruction);
$top=1;
$topsuivant="affi_ann.php3?action=rechercher&categorie=$categorie&nom_a_chercher=$nom_a_chercher";
break;
default; /*si aucune action n'est spécifiée, afficher tous les enregistrements*/
if ($affichage_continue=="o")
{
$sql="SELECT * FROM $table WHERE affiche='O' AND categorie='$categorie' ORDER BY numero DESC LIMIT $debut,$nb_affichage";
$TableRep=mysql($database,$sql);
$topsuivant="affi_ann.php3?categorie=$categorie";
$top=1;
}
else
{
$TableRep=mysql($database,"SELECT * FROM $table WHERE affiche='O' AND categorie='$categorie' ORDER BY numero DESC LIMIT $nb_affichage");
$top=0;
}
break;
}
$NombreEntrees=mysql_NumRows( $TableRep);
if($NombreEntrees == 0) /* La table est vide */
{
echo " ";
}
else
{
if ($top==1)
{
echo " Nombre d'annonces affichées : ". $NombreEntrees." sur un total de ".$nbe."
";
}
else
{
echo " les ". $NombreEntrees." dernières annonces sur un total de ".$nbe."
";
}
$i=0; /* initialisation de la variable de boucle */
while ($i < $NombreEntrees) /* faire tant que la fin de la table n'est pas atteinte */
{
$affiche =mysql_result($TableRep, $i, "affiche");
$texte_numero = mysql_result($TableRep, $i, "numero");
$texte_choix = mysql_result($TableRep, $i, "choix");
$texte_nom = mysql_result($TableRep, $i, "nom");
$texte_datesaisie = mysql_result($TableRep, $i, "datesaisie");
$texte_email = mysql_result($TableRep, $i, "email");
$texte_commentaire = ereg_replace("\r","
",(mysql_result($TableRep, $i, "commentaire")));
$texte_url = mysql_result($TableRep, $i, "url");
$texte_image = mysql_result($TableRep, $i, "image");
$texte_telephone = mysql_result($TableRep, $i, "telephone");
if (($i % 2)==1 && ($aff_double=="o"))
{
echo "";
}
else
{
echo "";
echo "";
}
echo "Annonce n° : ". $texte_numero . " ";
echo " Choix : ";
echo $texte_choix;
echo "
";
echo " Date de l'annonce : "; /*100*/
$ladatesaisie=explode("-",$texte_datesaisie);
echo $ladatesaisie[2]."/".$ladatesaisie[1]."/".$ladatesaisie[0];
echo "
";
echo " Nom ou pseudo : ";
echo $texte_nom;
if ($texte_email)
{
echo " ";
echo " E-mail : ";
echo "".$texte_email."
";
}
echo "Annonce ";
echo $texte_commentaire."
";
echo " ";
if ($texte_url)
{
echo "SITE ";
echo "".$texte_url."";
echo "
";
}
if ($texte_telephone)
{
echo "telephone ";
echo $texte_telephone;
echo "
";
}
if ($texte_image)
{
echo "Photo ";
echo " Voir l'image
";
}
if (($i % 2)==1 || ($aff_double=="n"))
{
echo "
|
";
}
else
{
echo "";
}
if ($i == ($NombreEntrees-1))
{
echo " |
";
}
$i++; /* On passe à l'enregistrement suivant */
}
echo "Fin de la sélection
";
// barre de navigation pour page suivante ou precedente
echo "";
if ($top==1)
{
if ($debut != 0)
{
echo "
";
echo "
";
}
if (($debut+$nb_affichage) < $nbe)
{
echo " = $nbe)
{
$final=($nbe - $nb_affichage);
}
echo $final;
echo "\">
";
$derniere = ($nbe - $nb_affichage);
echo "
";
}
}
}
echo "";
?>
SOMMAIRE - RETOUR AUX ANNONCES