0byt3m1n1
Path:
/
home
/
k
/
a
/
s
/
kassiope
/
www
/
achat
/
[
Home
]
File: promo.php
<? $menu = 3; include("../configuration.inc.php"); foreach($_GET as $k=>$v) { $_GET[$k] = (int)$v; } if (!isset($_GET['catid'])) { $catid = 0;} else {$catid = intval($_GET['catid']);} $systeme = 0; $origine = 0; $profil = 0; $sup = ''; if (isset($_GET['systeme'])) { $systeme = intval($_GET['systeme']); if($systeme>0) $sup .= " and p.id in (select produit_id from gaia_produits_systemes where systeme_id = '".$systeme."') "; } if (isset($_GET['origine'])) { $origine = intval($_GET['origine']); if($origine>0) $sup .= " and p.origine = '".$origine."' "; } if (isset($_GET['profil'])) { $profil = intval($_GET['profil']); if($profil>0) $sup .= " and p.id in (select produit_id from gaia_produits_profils where profil_id = '".$profil."') "; } $DOC_TITLE = "[GAIABOUTIK.FR]"; $paddingno=1; include("$repertoire_modele/haut.php"); if($catid>0) { $sqlcat = "SELECT image2, description_".$_SESSION['langue'].", nom_".$_SESSION['langue'].", parent_id, id FROM gaia_categories WHERE id = '".$catid."' ORDER BY position"; $rescat = mysql_query_override($sqlcat); $rowCat = mysql_fetch_row_override($rescat); } if (isset($_GET['nb'])) $nb = intval($_GET['nb']); else $nb = 1000; if (!isset($_GET['start'])) {$start=0;} else $start = intval($_REQUEST['start']); if (!isset($_GET['tri'])) {$tri=0;} else $tri = $_REQUEST['tri']; // Récupération et affichage des données $sql = "SELECT p.id FROM gaia_produits p, gaia_produits_categories pc WHERE p.promotion > 0 and p.id = pc.produit_id AND pc.categorie_id = '$catid' AND p.etat = '1' ".$sup.""; $result=mysql_query_override($sql); if (mysql_num_rows_override($result) == 0) { $sql = "SELECT p.id FROM gaia_produits p, gaia_produits_categories pc WHERE p.promotion > 0 and p.id = pc.produit_id AND p.etat = '1' AND pc.categorie_id in (SELECT id FROM gaia_categories WHERE parent_id = '$catid' AND etat = '1') ".$sup.""; } elseif (mysql_num_rows_override($result) == 0 && empty($catid)) { $sql = "SELECT p.id FROM gaia_produits p, gaia_produits_categories pc WHERE p.promotion > 0 and p.id = pc.produit_id AND p.etat = '1' ".$sup.""; } $result = mysql_query_override ($sql); $nbres = mysql_num_rows_override($result); if ($tri==0) $sql .= "order by position asc"; elseif ($tri==1) $sql .= " order by (prix * (1-promotion/100)) asc "; elseif ($tri==2) $sql .= " order by (prix * (1-promotion/100)) desc "; elseif ($tri==3) $sql .= " order by date_insere desc "; $result = mysql_query_override ($sql); $nbprod = mysql_num_rows_override($result); //if ($nb>0) $sql .= " LIMIT $start,$nb "; $result = mysql_query_override ($sql); $nbprod = mysql_num_rows_override($result); if(!empty($rowCat[0])) { echo '<div class=" bandeau"> <div class="top-title container-fluid text-center"> <h1>'.stripslashes($rowCat[2]).'</h1> <span>'.breadcrumb($catid).'</span> </div> <img src="upload/'.$rowCat[0].'" class="img-fluid" alt="'.stripslashes($rowCat[2]).'" /> </div>'; } //################################################################# // GESTION DES FILTRES //################################################################# if($catid==1) { $rec = mysql_query_override("SELECT id, nom_".$_SESSION['langue']." as nom FROM gaia_profils ORDER BY position, nom_".$_SESSION['langue']."") or DIE('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR()); $intit_profil = $intit_systeme = $intit_origine = array(); $cpt=0; while($d = mysql_fetch_array_override($rec)) { if($cpt<3) $intit_profil[] = stripslashes($d['nom']); $opt_profil .= '<option value="'.$d['id'].'" '.(($d['id']==$profil)?'selected':'').'>'.stripslashes($d['nom']).'</option>'; $cpt++; } $cpt=0; $rec = mysql_query_override("SELECT id, nom_".$_SESSION['langue']." as nom FROM gaia_systemes ORDER BY position, nom_".$_SESSION['langue']."") or DIE('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR()); while($d = mysql_fetch_array_override($rec)) { if($cpt<3) $intit_systeme[] = stripslashes($d['nom']); $opt_systeme .= '<option value="'.$d['id'].'" '.(($d['id']==$systeme)?'selected':'').'>'.stripslashes($d['nom']).'</option>'; $cpt++; } $cpt=0; $rec = mysql_query_override("SELECT id, nom_".$_SESSION['langue']." as nom FROM gaia_origines ORDER BY position, nom_".$_SESSION['langue']."") or DIE('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR()); while($d = mysql_fetch_array_override($rec)) { if($cpt<2) $intit_origine[] = stripslashes($d['nom']); $opt_origine .= '<option value="'.$d['id'].'" '.(($d['id']==$origine)?'selected':'').'>'.stripslashes($d['nom']).'</option>'; $cpt++; } echo ' <div class="filters"> <div class="container text-center"> <div class="row"> <div class="col-sm-4"> <span><span>'.SYSTEMES.'</span>'.implode(', ',$intit_systeme).', ...</span> <img src="images/blog1.jpg" /> <select name="systemes" onchange="location.href=\''.$catid.'-\'+this.value+\'-'.$origine.'-'.$profil.'-'.$start.'-'.$tri.'-c-torrefaction-noailles-'.propre($rowCat[2]).'.html\'"> <option value="0">Trier par '.SYSTEMES.'</option> '.$opt_systeme.' </select> </div> <div class="col-sm-4"> <span><span>'.ORIGINES.'</span>'.implode(', ',$intit_origine).', ...</span> <img src="images/blog2.jpg" /> <select name="origines" onchange="location.href=\''.$catid.'-'.$systeme.'-\'+this.value+\'-'.$profil.'-'.$start.'-'.$tri.'-c-torrefaction-noailles-'.propre($rowCat[2]).'.html\'"> <option value="0">Trier par '.ORIGINES.'</option> '.$opt_origine.' </select> </div> <div class="col-sm-4"> <span><span>'.PROFILS.'</span>'.implode(', ',$intit_profil).', ...</span> <img src="images/blog3.jpg" /> <select name="profils" onchange="location.href=\''.$catid.'-'.$systeme.'-'.$origine.'-\'+this.value+\'-'.$start.'-'.$tri.'-c-torrefaction-noailles-'.propre($rowCat[2]).'.html\'"> <option value="0">Trier par '.PROFILS.'</option> '.$opt_profil.' </select> </div> </div> </div> </div> '; } //################################################################# if ($nbprod == 0) { echo '<section id="shop" class="space-top-30"> <div class="container text-center">'; echo "<div class=\"clear\"></div><div class=\"texte\" style=\"padding:80px 10px;\">".NO_INDEX_PRODUCT."</div>"; echo '</div></section>'; } else { echo '<!-- shop section --> <section id="shopz" class="space-top-30"> <div class="container"> <div class="row"> <div class="col-sm-6 text-left"><!--<h2>'.$nbprod.' produit(s) en promotion</h2>--></div> <div class="col-sm-6 text-right"> <select class="selectpicker" onchange="location.href=\''.$catid.'-'.$systeme.'-'.$origine.'-'.$profil.'-'.$start.'-\'+this.value+\'-c-torrefaction-noailles-'.propre($rowCat[2]).'.html\'"> <optgroup label="Trier par :"> <option value="0" '.(($tri==0)?'selected':'').'>--</option> <option value="3" '.(($tri==3)?'selected':'').'>Nouveauté</option> <option value="1" '.(($tri==1)?'selected':'').'>Prix ordre croissant</option> <option value="2" '.(($tri==2)?'selected':'').'>Prix ordre décroissant</option> </optgroup> </select> </div> </div> <div class="row" id="products">'; $cpt=1; while($prod=mysql_fetch_array_override($result)) { template_index_produit($prod['id'], '', $form = "index"); if($cpt%4==0) echo '<div class="col-lg-12"></div>'; $cpt++; } echo ' </div> '.(($nb<$nbres)?' <div class="text-center more-button space-top-30"> <a href="'.$wwwroot.'/'.$catid.'-'.$nbres.'-'.$tri.'-c-torrefaction-noailles-'.propre($rowCat[2]).'.html" class="btn btn-default-filled"><span>VOIR +</span></a> </div> ':'').' </div> <!-- / container -->'; } include("$repertoire_modele/bas.php"); ?>