0byt3m1n1
Path:
/
home
/
k
/
a
/
s
/
kassiope
/
www
/
achat
/
[
Home
]
File: top.php
<? include("../configuration.inc.php"); if (!isset($_GET['catid'])) { $catid = 0;} else {$catid = intval($_GET['catid']);} $DOC_TITLE = "GAIABOUTIK.FR"; include("$repertoire_modele/haut.php"); echo "<div class=\"entete\">".NEWS."</div>"; $nb = 30; //nombre d'enregistrement par page if (!isset($_GET['start'])) {$start=0;} else {$start = intval($_REQUEST['start']);} // Récupération et affichage des données $sql = "SELECT p.id, p.reference, p.nom_".$_SESSION['langue'].", p.promotion, p.descriptif_".$_SESSION['langue']." , p.image1, p.image2, p.prix, p.prix_revendeur, p.on_stock, p.points, p.on_special, pc.categorie_id FROM gaia_produits p, gaia_produits_categories pc, gaia_categories c WHERE p.id = pc.produit_id AND on_top = '1' AND p.etat = '1' ORDER BY p.prix LIMIT $start,$nb"; $result=mysql_query_override($sql) or DIE('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR()); if (mysql_num_rows_override($result) == 0) { echo "<div class=\"texte\">".NO_INDEX_PRODUCT."</div>"; } else { echo "<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"100%\">"; $nb_cellules = mysql_num_rows_override($result); $nb_colonnes = 2; $j = 0; while($prod=mysql_fetch_array_override($result)) { if ( $j % $nb_colonnes == 0 ) { echo "<tr>"; } if($j % $nb_colonnes !=0 OR $j % $nb_colonnes == 0 ) { echo "<td class=\"normal\" width=\"50%\">"; template_index_produit($prod['id'], $where = "AND p.on_top = '1'" , $form = "top"); } echo "</td>"; $j++; if ( $j % $nb_colonnes == 0 OR $j == $nb_cellules ) { echo "</tr>"; } } echo "<td align=\"center\" class=\"normal\" colspan=\"2\">"; //Boutons précédent et suivant if($start) {print("<a class=petit href=\"index.php?catid=".$catid."&start=".($start-$nb)."\">Page précédente</a>");} $result=mysql_query_override("SELECT COUNT(*) FROM gaia_produits p, gaia_produits_categories pc WHERE p.id = pc.produit_id AND pc.categorie_id = $catid AND p.etat = 1"); $row=mysql_fetch_row_override($result); if($row[0]>($start+$nb)) { if($start) {print(" / ");} print("<a class=petit href=\"index.php?catid=".$catid."&start=".($start+$nb)."\">Page suivante</a>"); } print("<br />"); //Affichage des pages if($row[0]>$nb) {// le nombre d'enreg. est > au nb de lignes d'affichage ? print("Page : "); for($index=0;($index*$nb)<$row[0];$index++) // oui alors on affiche les numéros de pages { ?> <b><a class="petit" href="<?=$_SERVER['PHP_SELF']."?catid=".$catid."&start=".$index*$nb; ?>"><? echo $index+1; ?></a></b> <? } } echo "</td></tr></table>"; } include("$repertoire_modele/bas.php"); ?>