= $y; } }; $title= "SAV : Retour et échange des produits Abisco sécurité"; $lang = "_1"; $custom_page = new CharteCustomPages( "custom_page.tpl" , stripslashes($title) ); $custom_page->setData("title",utf8_encode(html_entity_decode(html_entity_decode(stripslashes("SAV : Retour et échange des produits Abisco sécurité"))))); $custom_page->setData("meta_description",mb_convert_encoding(html_entity_decode(stripslashes("En cas de défaut technique, le retour et l\'échange du produit sont pris en charge par Abisco sécurité. Un service après-vente de qualité avec Abisco Sécurité.")), "UTF-8", "ASCII")); $custom_page->setData("meta_keywords",utf8_encode(html_entity_decode(html_entity_decode(stripslashes(""))))); //$custom_page->setData("meta_author",utf8_encode($meta_author)); $rsamarques=DBUtil::query("SELECT idbrand FROM custom_pages WHERE filename='SAV' LIMIT 1"); //Page specifique $rsidpageprod = DBUtil::getDBValue( "idpage_prod", "custom_pages", "idpage", 41); $rsidbrand = DBUtil::getDBValue( "idbrand", "custom_pages", "idpage", 41); if ($rsidpageprod !== false) { $custom_page->setData("idpage_prod", 1); if ($rsidbrand && $rsidbrand != null) { $products_specific_page = DBUtil::query("SELECT * FROM page_product pp, product p WHERE pp.idpage = ".intval($rsidpageprod)." AND pp.idproduct = p.idproduct AND p.idbrand = $rsidbrand"); if ($products_specific_page->RecordCount() ) { $select = "SELECT pp.idproduct, p.idcategory, c.name_1 AS cat_name"; $from = " FROM page_product pp, product p, category c"; $where = " AND pp.idpage = ".intval($rsidpageprod)." AND pp.idproduct = p.idproduct AND p.idbrand = $rsidbrand"; } else { $select = "SELECT p.idproduct, p.idcategory, c.name_1 AS cat_name"; $from = " FROM product p, category c"; $where = " AND p.idbrand = $rsidbrand"; } } else { $select = "SELECT pp.idproduct, p.idcategory, c.name_1 AS cat_name"; $from = " FROM page_product pp, product p, category c"; $where = "AND pp.idpage = ".intval($rsidpageprod)." AND pp.idproduct = p.idproduct"; } } else { if ($rsidbrand && $rsidbrand != null) { $custom_page->setData("idpage_prod", 1); $select = "SELECT p.idproduct, p.idcategory, c.name_1 AS cat_name"; $from = " FROM product p, category c"; $where = " AND p.idbrand = $rsidbrand" ; } else $custom_page->setData("idpage_prod", 0); } if ($select) { $rsproducts = DBUtil::query(" $select$from WHERE p.available <>0 AND p.idcategory = c.idcategory $where ORDER BY c.name_1 ASC "); //regroupement des produits par categorie $category_ids = array(); $categories_list = array(); include_once ("$GLOBAL_START_PATH/objects/catalog/CProduct.php"); include_once ("$GLOBAL_START_PATH/objects/flexy/proxies/CProductProxy.php"); while (!$rsproducts->EOF()) { $product_object = new CProductProxy(new CProduct($rsproducts->fields("idproduct"))); if (!in_array($rsproducts->fields("idcategory"), $category_ids)) { $category_ids[] = $rsproducts->fields("idcategory"); $categories_list[intval($rsproducts->fields("idcategory"))] = array( "cat_name" => $rsproducts->fields("cat_name"), "products" => array( 0 => $product_object ) ); } else { $categories_list[intval($rsproducts->fields("idcategory"))]["products"][] = $product_object; } $rsproducts->MoveNext(); } $i = 0; $cat_lists = array(); foreach ($categories_list as $k => $v) { $cat_lists[$i] = $v; $i++; } $custom_page->setData("product_categories", $cat_lists); } //fin page specifique //breadcrumbs function makeBreadcrub(){ global $rsidbrand; if ($rsidbrand) $lmarque = '
  • Marques
  • '; else $lmarque = ""; return ''; } $custom_page->setData("breadcrumbs",makeBreadcrub()); //fin breadcrumbs $content=stripslashes("

    Services après-vente

    En cas de défaut technique, le produit doit nous être retourné, à vos frais, dans son emballage et dans la limite de sa durée de garantie, accompagné d\'une copie de la facture.Ce produit sera ensuite renvoyé chez le fournisseur concerné qui pratiquera une expertise.

     

    Si un défaut mécanique est effectivement constaté, votre produit vous sera échangé gratuitement dans un délai de 1 à 6 semaines pour les solutions de sécurité sur mesure. Les frais de retour sont entièrement pris en charge par Abisco Sécurité.

     

    Les garanties MasterLock, Abus et Thirard ne couvrent pas les dommages directs et indirects liés à une utilisation non-conforme des cadenas et autres matériels de sécurité.

     

    Pour éviter que la serrure ou l\'anse de votre cadenas de sécurité ne se grippent, il est important de les entretenir. En les nettoyant et en les graissant régulièrement, vous éviterez ainsi qu\'ils ne deviennent impossibles à ouvrir.

    "); $content_plus=stripslashes(""); $scriptName = $GLOBAL_START_URL."/SAV"; /* include_once( "HTML/Template/Flexy.php" ); include_once( "HTML/Template/Flexy/Element.php" ); $options["templateDir"][] = "$GLOBAL_START_PATH/templates/catalog/"; $options["strict"][]="false"; $options[ "compileDir" ] = "$GLOBAL_START_PATH/catalog/templates/"; if($rsamarques->RecordCount() > 0 && $rsamarques->fields("idbrand")){ $idmarque=$rsamarques->fields("idbrand"); $rsdelaamarque=DBUtil::query("SELECT idbrand, brand, logo, brand_url FROM brand WHERE idbrand=$idmarque"); $brandName=$rsdelaamarque->fields("brand"); $brandLogo=$GLOBAL_START_URL."/www/".$rsdelaamarque->fields("logo"); if($rsdelaamarque->fields("brand_url") && $rsdelaamarque->fields("brand_url")!=""){ $brandLink="$GLOBAL_START_URL/".$rsdelaamarque->fields("brand_url"); }else{ $brandLink="$GLOBAL_START_URL/catalog/product_brand?IdBrand=$idmarque"; } $custom_page_subcontent = new HTML_Template_Flexy($options); $catalog_right = Session::getInstance()->getCustomer() ? Session::getInstance()->getCustomer()->get( "catalog_right" ) : 0; $ANDLINES=""; $FROMLINE=""; $idcategory = ""; if(isset($_REQUEST["IdCateg"]) && $_REQUEST["IdCateg"]!=""){ $idcategory=$_REQUEST["IdCateg"]; $ParameterOutputArray["IdCateg"] = $idcategory; $ANDLINES.=" AND p.idcategory LIKE '".$idcategory."%' "; } // TRUC DE MERDE POUR LES INTITULES // if((isset($_REQUEST["Size"]) && $_REQUEST["Size"]!="") || (isset($_REQUEST["Color"]) && $_REQUEST["Color"]!="") || (isset($_REQUEST["Field"]) && $_REQUEST["Field"]!="")){ $FROMLINE.=" , intitule_link il "; $ANDLINES.=" AND d.idarticle=il.idarticle "; } if(isset($_REQUEST["Size"]) && $_REQUEST["Size"]!=""){ $size=$_REQUEST["Size"]; $rsintit=DBUtil::query("SELECT idintitule_value as idintitule FROM intitule_value WHERE intitule_value_1='$size' LIMIT 1"); $idintitule_value=$rsintit->fields("idintitule"); $ANDLINES.=" AND il.idintitule_value=$idintitule_value"; } $queryOfBrand = " SELECT p.idproduct, p.name$lang AS name, p.description$lang AS description, p.desc_tech$lang AS desc_tech, p.desc_more$lang AS desc_more, p.text_commercial$lang AS text_commercial, p.space_msg_1, p.space_msg_2, p.space_msg_3, p.space_msg_4, p.space_msg_5, p.space_msg_6, p.idsupplier FROM product p, detail d $FROMLINE WHERE p.idbrand = $idmarque $ANDLINES AND p.available = 1 AND p.catalog_right <= '$catalog_right' AND p.idproduct=d.idproduct AND p.idproduct>0 AND d.stock_level<>0 GROUP BY p.idproduct ORDER BY p.display_product_order ASC"; $rsProductsOfBrand = DBUtil::query($queryOfBrand); $zobi=0; $arrayReferences = ""; $custom_page_subcontent->setData("baseURL",$GLOBAL_START_URL); $custom_page_subcontent->compile("subcontent_custom_pages.tpl"); $subcontent=$custom_page_subcontent->toString(); $subcontent="".$subcontent.""; $content=str_replace("",$subcontent,$content); $content_plus=str_replace("",$subcontent,$content_plus); //fonction de la mort ki tue pour la barre de gauche. Bisou bisouuuu $IdBrand=$idmarque; class LBCustomPages extends FlexyController{ function __construct($template,$IdBrand){ global $GLOBAL_START_URL,$GLOBAL_START_PATH; parent::__construct( $template ); $recupSizes=array(); $recupSizes=$this->GetIntitulesFromCategory($IdBrand,"Taille"); $recupColors=array(); $recupColors=$this->GetIntitulesFromCategory($IdBrand,"Couleur"); $recupMatieres=array(); $recupMatieres=$this->GetIntitulesFromCategory($IdBrand,"Matière"); $recupTrades=array(); $recupTrades=$this->GetTradesFromCategory($IdBrand); $recupCategories=array(); $recupCategories=$this->GetCategoriesOf("idbrand",$IdBrand); $recupAafficher=array(); $recupAafficher=$this->GetArrayOfCategories("idbrand",$IdBrand); $this->setData("searchSizes", $recupSizes); $this->setData("searchColors",$recupColors); $this->setData("searchMatieres",$recupMatieres); $this->setData("searchTrades",$recupTrades); $this->setData("searchCategories",$recupCategories); $this->setData("categoriesToShow",$recupAafficher); $this->initMenu(); //$outputImageMenu = $this->outputImageMenu(); $outputMenu = $this->outputMenu(); //$this->setData("outputImageMenu",$outputImageMenu); $this->setData("outputMenu",$outputMenu); } function initMenu($home = ""){ global $GLOBAL_START_URL,$GLOBAL_START_PATH; include_once("$GLOBAL_START_PATH/objects/CSSMenu.php" ); $this->navbabar = new CSSMenu(); $showHome = false; if($home!=""){ $showHome = true; } $this->navbabar->showHomeItem( $showHome ); } function addItemMenu($item,$link,$style = ""){ global $GLOBAL_START_URL,$GLOBAL_START_PATH; $this->navbabar->addStaticItem($item,$link,$style); } function outputMenu(){ global $GLOBAL_START_URL,$GLOBAL_START_PATH; //$this->navbabar->buildMenuCP(); $this->navbabar->buildMenu(); return $this->navbabar->getHTML(); } function outputImageMenu(){ global $GLOBAL_START_URL,$GLOBAL_START_PATH; $this->navbabar->buildImageMenuCP(); return $this->navbabar->getHTML(); } function GetIntitulesFromCategory($idbrand,$intitule){ global $lang; $rqTaille="SELECT idintitule_title FROM intitule_title WHERE intitule_title$lang LIKE '$intitule' LIMIT 1"; $rsTaile=DBUtil::query($rqTaille); $idTitleTaille=$rsTaile->fields("idintitule_title"); $arrayCountByTaille=array(); if($rsTaile->RecordCount()){ $rqToutesLesTailles="SELECT iv.intitule_value_1, COUNT( p.idproduct ) as count FROM product p, intitule_link il, intitule_value iv WHERE p.idproduct = il.idproduct AND il.idintitule_value=iv.idintitule_value AND il.idintitule_title=$idTitleTaille AND p.idbrand =$idbrand "; if( isset( $_POST[ "intitule_value" ] ) && $_POST[ "intitule_value" ]!="" ){ $intitvalue=$_POST[ "intitule_value" ]; $rqToutesLesTailles.="AND iv.intitule_value_1=$intitvalue "; } $rqToutesLesTailles.="GROUP BY il.idintitule_value ORDER BY iv.intitule_value_1 ASC"; $rsToutesLesTailles=DBUtil::query($rqToutesLesTailles); $i=0; while(!$rsToutesLesTailles->EOF()){ $arrayCountByTaille[$i]["name"]=$rsToutesLesTailles->fields("intitule_value_1"); $arrayCountByTaille[$i]["count"]=$rsToutesLesTailles->fields("count"); $i++; $rsToutesLesTailles->MoveNext(); } } return $arrayCountByTaille; } function GetTradesFromCategory($idbrand){ global $lang, $GLOBAL_START_PATH, $GLOBAL_START_URL; $rqTousLesMetiers=" SELECT t.idtrade, t.trade$lang as trade,image, COUNT( p.idproduct ) as count FROM product p, trade t, trade_product tp WHERE p.idproduct = tp.idproduct AND t.idtrade = tp.idtrade AND p.idbrand = $idbrand GROUP BY t.idtrade ORDER BY t.display ASC"; $rsTousLesMetiers=DBUtil::query($rqTousLesMetiers); $arrayCountByTrades=array(); $i=0; while(!$rsTousLesMetiers->EOF()){ $arrayCountByTrades[$i]["id"]=$rsTousLesMetiers->fields("idtrade"); $arrayCountByTrades[$i]["name"]=$rsTousLesMetiers->fields("trade"); $arrayCountByTrades[$i]["count"]=$rsTousLesMetiers->fields("count"); $imagePath = $GLOBAL_START_PATH."/www/".$rsTousLesMetiers->fields( "image" ); $imageUrl = $GLOBAL_START_URL."/www/".$rsTousLesMetiers->fields( "image" ); if($rsTousLesMetiers->fields( "image" ) != "" && file_exists($imagePath)){ $arrayCountByTrades[$i]["image"] = $imageUrl; }else{ $arrayCountByTrades[$i]["image"] = ""; } $i++; $rsTousLesMetiers->MoveNext(); } return $arrayCountByTrades; } function GetCategoriesOf($field,$value){ global $lang; $rsCatOf=DBUtil::query("SELECT p.idcategory as id,c.name$lang as name, COUNT( p.idproduct ) as count FROM product p, category c WHERE c.idcategory=p.idcategory AND p.$field=$value GROUP BY p.idcategory"); $arrayCountBy=array(); $i=0; while(!$rsCatOf->EOF()){ $arrayCountBy[$i]["id"]=$rsCatOf->fields("id"); $arrayCountBy[$i]["name"]=$rsCatOf->fields("name"); $arrayCountBy[$i]["count"]=$rsCatOf->fields("count"); $i++; $rsCatOf->MoveNext(); } return $arrayCountBy; } function GetArrayOfCategories($field,$value){ global $lang; $rsCatOf=DBUtil::query("SELECT p.idcategory as id FROM product p, category c WHERE c.idcategory=p.idcategory AND p.$field=$value GROUP BY p.idcategory ORDER BY p.idcategory"); $arrayCategs=array(); $i=0; while(!$rsCatOf->EOF()){ $stop = false; $child = $rsCatOf->fields("id"); while(!$stop){ $rsCat=DBUtil::query("SELECT idcategoryparent as parent FROM category_link WHERE idcategorychild = $child LIMIT 1"); if($rsCat->RecordCount() == 0 || $rsCat->fields("parent") == 0){ $stop = true; }else{ $stop = false; $child = $rsCat->fields("parent"); if (!in_array($rsCat->fields("parent"), $arrayCategs)) { $arrayCategs[$i]=$rsCat->fields("parent"); } $i++; } } $arrayCategs[$i]=$rsCatOf->fields("id"); $i++; $rsCatOf->MoveNext(); } return $arrayCategs; } }; $custom_page_left_bar = new LBCustomPages( "left_bar_custom_pages.tpl",$IdBrand ); $custom_page_left_bar->setData("IdBrand",$IdBrand); $custom_page_left_bar->setData("idcategory",$idcategory); $custom_page_left_bar->setData("scriptName",$scriptName); $custom_page_left_bar->setData("baseURL",$GLOBAL_START_URL); //$leftbarcontent=$custom_page_left_bar->string(); //remplacement des tag de barbares par le contenu compilé //$leftbarcontent="".$leftbarcontent.""; //$content=str_replace("",$leftbarcontent,$content); //enfin fini, je commençais a être chauve //OH MON DIEU! J AI PERDU UNE TOUFFE! }*/ function param_pagination($Idbrand){ ?>
    EOF() ) { $idcategory = $result->fields( "idcategory" ); if(!in_array($idcategory,$results)) { array_push( $results, $idcategory ); } $result->MoveNext(); } $total = count($results); $res1 = DBUtil::query( "SELECT per_page FROM custom_pages WHERE `idbrand` = $Idbrand LIMIT 1" ); $perpage = $res1->fields( "per_page" ); // nombre d'entrées à afficher par page if ($perpage== 0) $perpage = 6; if ($perpage >= $total ) $perpage = $total; $nbPages = ceil($total/$perpage); // calcul du nombre de pages $nbPages (on arrondit à l'entier supérieur avec la fonction ceil()) // Récupération du numéro de la page courante depuis l'URL avec la méthode GET // S'il s'agit d'un nombre on traite, sinon on garde la valeur par défaut : 1 $current = 1; if (isset($_POST["page"]) && is_numeric($_POST["page"])) { $page = intval($_POST["page"]); if ($page >= 1 && $page <= $nbPages) { // cas normal $current=$page; } else if ($page < 1) { // cas où le numéro de page est inférieure 1 : on affecte 1 à la page courante $current=1; } else { //cas où le numéro de page est supérieur au nombre total de pages : on affecte le numéro de la dernière page à la page courante $current = $nbPages; } } // $start est la valeur de départ du LIMIT dans notre requête SQL (dépend de la page courante) $start = ($current * $perpage) - $perpage; //stockage des paramètres à utiliser dans un tableau $params = array(); $params["start"] = $start; $params["perpage"] = $perpage; $params["total"] = $total; $params["nbpage"] = $nbPages; $params["current"] = $current; return $params; } function ListProducts($Idbrand, $idcategory){ global $GLOBAL_START_PATH, $GLOBAL_START_URL; include_once( "$GLOBAL_START_PATH/objects/productobject.php" ); include_once( dirname( __FILE__ ) . "/objects/URLFactory.php" ); //$params = param_pagination($Idbrand); //$start=$params["start"]; //$perpage=$params["perpage"]; $res = DBUtil::query("SELECT p.idproduct, p.name_1 AS name, p.idcategory, p.novelty, c.name_1 AS categoryName, p.idlabel, p.description_1 AS description, p.desc_tech_1 AS desc_tech, p.desc_more_1 AS desc_more, p.text_commercial_1, p.space_msg_1, p.space_msg_2, p.space_msg_3, p.space_msg_4, p.space_msg_5, p.space_msg_6, p.idbrand, p.idsupplier,d.sellingcost FROM product p, detail d, category c WHERE p.idcategory = c.idcategory AND p.available = 1 AND p.catalog_right <= 0 AND d.idproduct=p.idproduct AND p.idbrand= $Idbrand AND p.idproduct>0 AND p.idcategory = $idcategory GROUP BY p.idproduct ORDER BY p.novelty DESC "); $i = 0; $list = array(); while( !$res->EOF() ) { $idproduct = $res->fields( "idproduct" ); $productName = $res->fields( "name" ); $list[$i]["name"]=$productName; $productDescription = $res->fields( "description" ); $list[$i]["description"]=utf8_encode(strip_tags(substr($productDescription, 0, 200))); $productText_commercial = $res->fields( "text_commercial_1" ); //$list[$i]["text_commercial"]=utf8_encode(strip_tags(substr($productText_commercial, 0, 200))); $list[$i]["text_commercial"]=$productText_commercial; $productDate = $res->fields( "novelty" ); $list[$i]["date"]=$productDate; $productPrice = $res->fields( "sellingcost" ); $list[$i]["sellingcost"]=$productPrice; $rsreference = DBUtil::query("SELECT reference FROM detail WHERE idproduct = $idproduct LIMIT 1"); $productReferenceCount = $rsreference->RecordCount(); $list[$i]["referenceCount"]=$productReferenceCount; //Labels $idlabel = $res->fields( "idlabel" ); $list[$i]["idlabel"]=$idlabel; if($idlabel>0){ $rslabel = DBUtil::query("SELECT name, description, image FROM product_labels WHERE idlabel = $idlabel LIMIT 1"); if($rslabel->RecordCount()>0){ while(!$rslabel->EOF()){ $list[$i]["label"]=$rslabel->fields("name"); $list[$i]["labelDescription"]=$rslabel->fields("description"); $list[$i]["labelText_commercial"]=$rslabel->fields("text_commercial"); $list[$i]["labelImage"]="$GLOBAL_START_URL/www/labels/".$rslabel->fields("image"); $rslabel->MoveNext(); } }else{ $list[$i]["label"]=""; $list[$i]["labelDescription"]=""; $list[$i]["labelText_commercial"]=""; $list[$i]["labelImage"]=""; } }else{ $list[$i]["label"]=""; $list[$i]["labelDescription"]=""; $list[$i]["labelText_commercial"]=""; $list[$i]["labelImage"]=""; } $list[$i]["imageURL"]= URLFactory::getProductImageURI( $res->fields( "idproduct" ) ); //URLs $productURL = URLFactory::getProductURL( $idproduct); $list[$i]["productURL"]=$productURL; $lowerPrice = PRODUCT::getLowerPrice( $idproduct ); $pxmin = $lowerPrice ? Util::priceFormat( $lowerPrice ) : false; $list[$i]["pxmin"]=$pxmin; //promotions if(PRODUCT::hasPromotionInStock( $idproduct )) $list[$i]["haspromos"]="yes"; $i++; $res->MoveNext(); } return $list; } function NameBrand($Idbrand) { $rs = DBUtil::query("SELECT brand FROM brand WHERE idbrand = $Idbrand LIMIT 1"); $brand_name = $rs->fields("brand"); return $brand_name; } function NameCategOfBrand($Idbrand) { include_once( dirname( __FILE__ ) . "/objects/URLFactory.php" ); $rs = DBUtil::query("SELECT p.idcategory, c.name_1 FROM product p, category c WHERE p.idbrand = $Idbrand AND c.idcategory = p.idcategory AND p.available = 1"); $i = 0; $listcateg = array(); $results = array(); while( !$rs->EOF() ) { //print $Idbrand; $idcategory = $rs->fields( "idcategory" ); if(!in_array($idcategory,$results)) { array_push( $results, $idcategory ); $listcateg[$i]["id"]=$idcategory; $categoryName = $rs->fields( "name_1" ); $listcateg[$i]["name"]=$categoryName; //URLs $categoryURL = URLFactory::getCategoryURL( $idcategory ); $listcateg[$i]["categoryURL"]=$categoryURL; $i++; } $rs->MoveNext(); } return $listcateg; } function NameCategOfProduct($Idbrand) { include_once( dirname( __FILE__ ) . "/objects/URLFactory.php" ); $params = param_pagination($Idbrand); $start=$params["start"]; $perpage=$params["perpage"]; $rs = DBUtil::query("SELECT DISTINCT p.idcategory, c.name_1 FROM product p, category c WHERE p.idbrand = $Idbrand AND c.idcategory = p.idcategory AND p.available = 1 LIMIT $start, $perpage"); $i = 0; $categproduct = array(); $results = array(); while( !$rs->EOF() ) { $idcategory = $rs->fields( "idcategory" ); if(!in_array($idcategory,$results)) { array_push( $results, $idcategory ); $categproduct[$i]["id"]=$idcategory; $categoryName = $rs->fields( "name_1" ); $categproduct[$i]["name"]=$categoryName; //URLs $categoryURL = URLFactory::getCategoryURL( $idcategory ); $categproduct[$i]["categoryURL"]=$categoryURL; $categproduct[$i]["listprod"] = ListProducts( $Idbrand, $idcategory ); $i++; } $rs->MoveNext(); } return $categproduct; } $custom_page->setData("Content",stripslashes($content)); $custom_page->setData("Content_plus",stripslashes($content_plus)); //$custom_page->setData( "list", isset( $IdBrand ) ? ListProducts( intval( $IdBrand ) ) : null ); $custom_page->setData( "params", isset( $IdBrand ) ? param_pagination( $IdBrand ) : null ); $custom_page->setData( "brand_name", isset( $IdBrand ) ? NameBrand( $IdBrand ) : null ); $custom_page->setData( "listcateg", isset( $IdBrand ) ? NameCategOfBrand( $IdBrand ) : null ); $custom_page->setData( "categproduct", isset( $IdBrand ) ? NameCategOfProduct( $IdBrand ) : null ); $custom_page->setData("notArrayReferences","ok"); $custom_page->setData("arrayRefs",$arrayReferences); $custom_page->output(); //----------------------------------------------------------------------------------------------// // Fonctions pour la barre de gauche // //----------------------------------------------------------------------------------------------// function GetIntitulesFromCategory($idbrand,$intitule){ global $lang; $rqTaille="SELECT idintitule_title FROM intitule_title WHERE intitule_title$lang LIKE '$intitule' LIMIT 1"; $rsTaile=DBUtil::query($rqTaille); $idTitleTaille=$rsTaile->fields("idintitule_title"); $arrayCountByTaille=array(); if($rsTaile->RecordCount()){ $rqToutesLesTailles="SELECT iv.intitule_value_1, COUNT( p.idproduct ) as count FROM product p, intitule_link il, intitule_value iv WHERE p.idproduct = il.idproduct AND il.idintitule_value=iv.idintitule_value AND il.idintitule_title=$idTitleTaille AND p.idbrand =$idbrand "; if( isset( $_POST[ "intitule_value" ] ) && $_POST[ "intitule_value" ]!="" ){ $intitvalue=$_POST[ "intitule_value" ]; $rqToutesLesTailles.="AND iv.intitule_value_1=$intitvalue "; } $rqToutesLesTailles.="GROUP BY il.idintitule_value ORDER BY iv.intitule_value_1 ASC"; $rsToutesLesTailles=DBUtil::query($rqToutesLesTailles); $i=0; while(!$rsToutesLesTailles->EOF()){ $arrayCountByTaille[$i]["name"]=$rsToutesLesTailles->fields("intitule_value_1"); $arrayCountByTaille[$i]["count"]=$rsToutesLesTailles->fields("count"); $i++; $rsToutesLesTailles->MoveNext(); } } return $arrayCountByTaille; } function GetTradesFromCategory($idbrand){ global $lang, $GLOBAL_START_PATH, $GLOBAL_START_URL; $rqTousLesMetiers=" SELECT t.idtrade, t.trade$lang as trade,image, COUNT( p.idproduct ) as count FROM product p, trade t, trade_product tp WHERE p.idproduct = tp.idproduct AND t.idtrade = tp.idtrade AND p.idbrand = $idbrand GROUP BY t.idtrade ORDER BY t.display ASC"; $rsTousLesMetiers=DBUtil::query($rqTousLesMetiers); $arrayCountByTrades=array(); $i=0; while(!$rsTousLesMetiers->EOF()){ $arrayCountByTrades[$i]["id"]=$rsTousLesMetiers->fields("idtrade"); $arrayCountByTrades[$i]["name"]=$rsTousLesMetiers->fields("trade"); $arrayCountByTrades[$i]["count"]=$rsTousLesMetiers->fields("count"); $imagePath = $GLOBAL_START_PATH."/www/".$rsTousLesMetiers->fields( "image" ); $imageUrl = $GLOBAL_START_URL."/www/".$rsTousLesMetiers->fields( "image" ); if($rsTousLesMetiers->fields( "image" ) != "" && file_exists($imagePath)){ $arrayCountByTrades[$i]["image"] = $imageUrl; }else{ $arrayCountByTrades[$i]["image"] = ""; } $i++; $rsTousLesMetiers->MoveNext(); } return $arrayCountByTrades; } function GetCategoriesOf($field,$value){ global $lang; $rsCatOf=DBUtil::query("SELECT p.idcategory as id,c.name$lang as name, COUNT( p.idproduct ) as count FROM product p, category c WHERE c.idcategory=p.idcategory AND p.$field=$value GROUP BY p.idcategory"); $arrayCountBy=array(); $i=0; while(!$rsCatOf->EOF()){ $arrayCountBy[$i]["id"]=$rsCatOf->fields("id"); $arrayCountBy[$i]["name"]=$rsCatOf->fields("name"); $arrayCountBy[$i]["count"]=$rsCatOf->fields("count"); $i++; $rsCatOf->MoveNext(); } return $arrayCountBy; } function GetArrayOfCategories($field,$value){ global $lang; $rsCatOf=DBUtil::query("SELECT p.idcategory as id FROM product p, category c WHERE c.idcategory=p.idcategory AND p.$field=$value GROUP BY p.idcategory ORDER BY p.idcategory"); $arrayCategs=array(); $i=0; while(!$rsCatOf->EOF()){ $stop = false; $child = $rsCatOf->fields("id"); while(!$stop){ $rsCat=DBUtil::query("SELECT idcategoryparent as parent FROM category_link WHERE idcategorychild = $child LIMIT 1"); if($rsCat->RecordCount() == 0 || $rsCat->fields("parent") == 0){ $stop = true; }else{ $stop = false; $child = $rsCat->fields("parent"); if (!in_array($rsCat->fields("parent"), $arrayCategs)) { $arrayCategs[$i]=$rsCat->fields("parent"); } $i++; } } $arrayCategs[$i]=$rsCatOf->fields("id"); $i++; $rsCatOf->MoveNext(); } return $arrayCategs; } function SetGlobalReferencesJsDataCP($IdProduct,&$arrayReferences){ $Product = new PRODUCT($IdProduct); $details = $Product->GetRefArray(""); $IdCategory = $Product->GetCategoryID(); //echo print_r($details[0]); if(isset($details[0])){ $rows = $details[0]; foreach ($rows["id"] as $row => $idrow) { $idarticle = $rows["id"][ $row ]; $arrayReferences.="articles[ '$idarticle' ] = new Array();"; $arrayReferences.="articles[ '$idarticle' ][ 'reference' ] = '".jsFormat( $rows[ 'reference' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'weight' ] = '".jsFormat( $rows[ 'weight' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'unit' ] = '".jsFormat( $rows[ 'unit' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'lot' ] = '". jsFormat( $rows[ 'lot' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'delay' ] = '".jsFormat( $rows[ 'delay' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'promo' ] = '".jsFormat( $rows[ 'promo' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'hidecost' ] = '". jsFormat( $rows[ 'hidecost' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'hasPromo' ] = '". jsFormat( $rows[ 'hasPromo' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'promo_rate' ] = '". jsFormat( $rows[ 'promo_rate' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'promo_price' ] = '". jsFormat( $rows[ 'promo_price' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'isDestocking' ] = '". jsFormat( $rows[ 'isDestocking' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'destocking_price' ] = '". jsFormat( $rows[ 'destocking_price' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'destocking_rate' ] = '". jsFormat( $rows[ 'destocking_rate' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'stock_level' ] = '". jsFormat( $rows[ 'stock_level' ][ $row ] )."';"; $arrayReferences.="articles[ '$idarticle' ][ 'wtprice' ] = '". str_replace(" ¤","",jsFormat($rows[ "wtprice" ][ $row ] ))."';"; $arrayReferences.="articles[ '$idarticle' ][ 'IdProduct' ] = '".$IdProduct ."';"; $arrayReferences.="articles[ '$idarticle' ][ 'IdCategory' ] = '". $IdCategory ."';"; } foreach ($rows["hiddenFields"] as $rowx => $hiddenFields) { $idarticle = $rows["id"][$rowx]; foreach ($hiddenFields as $fieldname => $value) { if(htmlentities($fieldname)!="delay"){ $arrayReferences.="articles[ '$idarticle' ][ '".htmlentities($fieldname)."' ] = '".html_entity_decode(jsFormat( $value) )."' ;"; } } } } } function jsFormat($string) { return str_replace("'", "\'", htmlentities($string)); } ?>