Bonjour erreur php

Résolu/Fermé
tracker6 Messages postés 4 Date d'inscription dimanche 6 septembre 2015 Statut Membre Dernière intervention 7 septembre 2015 - Modifié par tracker6 le 6/09/2015 à 14:58
tracker6 Messages postés 4 Date d'inscription dimanche 6 septembre 2015 Statut Membre Dernière intervention 7 septembre 2015 - 7 sept. 2015 à 17:45
bonjour besoin aide svp merci

Parse error: syntax error, unexpected '$canonicalUrl' (T_VARIABLE) in /home/ayjakeyb/public_html/description.php on line 1

///////////////

<?php
include('configuration/configuration.php');
include('includes/plug.php');
/*
--

Author: Marc D.
Email: markus@shghf-cart-software-solrfgtn.com
Copyright (c) Copyright France.com
  • /

include("includes/lang/lang_".$_SESSION['lang'].".php");
$promoIs="";
$displayLogos = "yes";


// Round corner title
$activeRoundedCornersDesc = 'no';

//--------------------
// Add Review into bdd
//--------------------
if(isset($_POST['actionReviews']) AND $_POST['actionReviews'] = "sendReviews" AND isset($_POST['clientV']) AND $_POST['clientV']=="" AND isset($_POST['message']) AND $_POST['message']!=="" AND isset($_POST['note']) AND $_POST['note']!=="") {
// Date
$date_sent = date("Y-m-d H:i:s");
// Delete tags
$_POST['message'] = strip_tags($_POST['message']);
if($reviewsManuelValidation=="oui") {
$validate = "vno";
$messageModAlert = VALIDATE_MESSAGE;
}
else {
$validate = "vyes";
}
// Add to bdd
mysqli_query( $GLOBALS['db'], "INSERT INTO btk_reviews
(guest,
email,
city,
country,
date_sent,
message,
note,
account,
lang,
visible,
prod_id
)
VALUES
('".$_POST['pseudo']."',
'".trim($_POST['email'])."',
'".$_POST['ville']."',
'".$_POST['pays']."',
'".$date_sent."',
'".str_replace("'","’",substr(strip_tags($_POST['message']),0,$reviewsCaractersMax))."',
'".$_POST['note']."',
'".$_POST['account']."',
'".$_SESSION['lang']."',
'".$validate."',
'".$_POST['prod_id']."'
)") or die (mysqli_error($GLOBALS['db']));

// Send email to Admin
$toW1 = $mailInfo;
$fromW1 = $mailInfo;
$subjectW1 = AVIS_ARTICLE." - ".$_POST['account']." - ".$http."://".$www2.$domaineFull;

$messageW1 = COMPTE_CLIENT.": ".$_POST['account']."\r\n";
$messageW1.= ADRESSE_EMAIL.": ".$_POST['email']."\r\n";
$messageW1.= EVALUATION.": ".$_POST['note']."\r\n";
$messageW1.= ARTICLE.": ".$http."://".$www2.$domaineFull."/description.php?id=".$_POST['prod_id']."\r\n";
$messageW1.= MESSAGE.": ".str_replace("'","’",$_POST['message'])."\r\n";

mail($toW1, $subjectW1, rep_slash($messageW1),
"Return-Path: $fromW1\r\n"
."From: $fromW1\r\n"
."Reply-To: $fromW1\r\n"
."X-Mailer: PHP/" . phpversion());

// Confirm message
$messageAlert = MESSAGE_SENT2;
if(isset($messageModAlert) AND !empty($messageModAlert)) $messageAlert.= ".<br />".$messageModAlert;
}

//-------------
// Function check values from options
//-------------
function testValues($xxz, $valueName) {
GLOBAL $optionNum, $passVariationsToJs;
$_stock[$xxz] = 0;
if($optionNum==1 AND isset($passVariationsToJs) AND count($passVariationsToJs)>0) {
foreach($passVariationsToJs AS $items2) {
$passVariationsToJsExplode2 = explode(":>",$items2);
if(trim($passVariationsToJsExplode2[0]) == trim($valueName)) {
$passVariationsToJsExplode3 = explode(",",$passVariationsToJsExplode2[1]);
$_stock[$xxz] = $passVariationsToJsExplode3[0];
}
}
}
return $_stock[$xxz];
}

//------------------------------------
// Function Ramdom grey color carousel
//------------------------------------
function rand_color() {
$a = dechex(mt_rand(175,240));
$hexa = $a.$a.$a;
return $hexa;
}

//-------------------------------------
// Function addToFavori et sendToFriend
//-------------------------------------
function add_file() {
GLOBAL $_SESSION, $rowp;
## Afficher message sur l'envoi des fichiers
if($rowp['products_sendfile']=="yes" AND $rowp['products_forsale']=='yes') {
print "<div id='infoSendFiles' style='display:none;'><div class='paddingH20'>".VOS_FICHIERS_SERONT."</div></div>";
print "<div class='sendFilesBut text-right'>";
print "<a href='".$_SESSION['ActiveUrl']."#infoSendFiles' class='facebox btn btn-custom white'><i class='fa fa-info-circle fa-15x marginR5 valignCenter'></i>".SEND_FILE."</a>";
print "</div>";
}
}

//---------------------------
// Afficher produits affilies
//---------------------------
function AfficheProdAffilie() {
GLOBAL $tt , $rowp, $_SESSION, $url_rw, $devise2Visible;
include('configuration/configuration.php');

print "<div class='row marginV5 marginT20'>";

reflectType(PRODUITS_AFFILIES);

print "<div class='col-md-12'>";
print "<div id='owl-container' class='marginV5 marginT20'>";


$addToQuery = ($displayOutOfStock=="non")? " AND p.products_qt>'0'" : "";

$expRel = explode("|", $rowp['products_related']);
$expRelNb = count($expRel)-1;

print "<div id='owl' class='owl-carousel marginT10'>";

for($i = 0; $i <= $expRelNb; $i++) {

$queryRel = mysqli_query( $GLOBALS['db'], "SELECT p.products_forsale, p.products_alternative_prizes, p.products_won, p.products_lot_num, p.products_tax, p.products_deee, p.products_options, p.products_qt, p.products_ref, p.products_name_".$_SESSION['lang'].", p.products_id, p.products_image, p.categories_id, p.products_desc_".$_SESSION['lang'].", p.products_price, s.specials_new_price, s.specials_last_day, s.specials_first_day, s.specials_visible
FROM products as p
LEFT JOIN specials as s
ON (p.products_id = s.products_id)
WHERE p.products_id = '".$expRel[$i]."'
".$addToQuery."
AND p.products_visible = 'yes'
AND p.products_forsale = 'yes'
ORDER BY p.products_name_".$_SESSION['lang']."
");

if(mysqli_num_rows($queryRel) > 0) {

print "<div class='owlProdContainer rowOverImg'>";
$rowRel = mysqli_fetch_array($queryRel);
// URL RW
$urlAffDesc = "description.php?id=".$rowRel['products_id']."&path=".$rowRel['categories_id'];
if($url_rw==1) $urlAffDesc = rw_link($urlAffDesc,$rowRel['products_name_'.$_SESSION['lang']]);
// Verifier si cet article est dans le panier
$isThere = (isset($_SESSION['prod_list']) AND preg_match("#(,|)".$rowRel['products_id']."\+#", $_SESSION['prod_list']))? "yes" : "no";


if($displayRelatedImage == "oui") {
if(!empty($rowRel['products_image'])) {
if($rowRel['products_image'] == "im/no_image_small.gif") $rowRel['products_image'] = "im/lang".$_SESSION['lang']."/no_image.png";
$image_resize_related = resizeImage($rowRel['products_image'],$ImageSizeDescRelated,0);

print "<div class='text-center'>";
print "<a href='".$urlAffDesc."'>";
// Is server GD open ?
if($gdOpen == "non") {
print "<img src='".$rowRel['products_image']."' style='max-height:".$image_resize_related[1]."px' alt='".$rowRel['products_name_'.$_SESSION['lang']]."' class='img-responsive center-block lazyOwl' data-src='".$rowRel['products_image']."' />";
}
else {
$infoImage = infoImageFunction($rowRel['products_image'],9000,$ImageSizeDescRelated);
print "<img src='miniImageGen.php?backColor=".$backGdColor."&extension=".$infoImage[0]."&imageSource=".$rowRel['products_image']."&largeurOrigin=".$infoImage[1]."&hauteurOrigin=".$infoImage[2]."&largeur=".$infoImage[3]."&hauteur=".$infoImage[4]."' alt='".$rowRel['products_name_'.$_SESSION['lang']]."' class='img-responsive center-block' />";
}
print "</a>";
print "</div>";
}
}

// Procuct name
print "<div class='text-center marginT10 elipsis'>";
print "<a href='".$urlAffDesc."'>".$rowRel['products_name_'.$_SESSION['lang']]."</a>";
print "</div>";

// price
if(isset($_SESSION['account']) OR $displayPriceInShop == "oui") {
print "<div class='text-center'>";

$new_price = $rowRel['specials_new_price'];
$old_price = $rowRel['products_price'];
$promoIs = "";
if(empty($new_price) OR $new_price == '') {
$price = "<span class=\"biger11em bold\">".$old_price." ".$symbolDevise."</span>";
$clientPrice = $old_price;
if(isset($_SESSION['reduc']) AND $_SESSION['reduc'] > 0) {
$price2 = (($rowRel['products_lot_num']>0)? VOTRE_MISE : VOTRE_PRIX).": <span class='bold biger11em'>".newPrice($old_price,$_SESSION['reduc'])." ".$symbolDevise."</span>";
}
}
else {
if($rowRel['specials_visible']=="yes") {
$today = mktime(0,0,0,date("m"),date("d"),date("Y"));

$dateMaxCheck = explode("-",$rowRel['specials_last_day']);
$dateMax = mktime(0,0,0,$dateMaxCheck[1],$dateMaxCheck[2],$dateMaxCheck[0]);
$dateDebutCheck = explode("-",$rowRel['specials_first_day']);
$dateDebut = mktime(0,0,0,$dateDebutCheck[1],$dateDebutCheck[2],$dateDebutCheck[0]);

if($dateDebut <= $today AND $dateMax >= $today) {
$econPourcent = (1-($rowRel['specials_new_price']/$rowRel['products_price']))*100;
$econPourcent = sprintf("%0.2f",$econPourcent)."%";
$itMiss = round((mktime(0,0,0,$dateMaxCheck[1],$dateMaxCheck[2],$dateMaxCheck[0]) - mktime(0,0,0,date("m"),date("d"),date("Y")))/86400);
$promoIs = 'yes';
$price = "<span class=\"strike marginR10\">".$old_price." ".$symbolDevise."</span><span class=\"biger11em text-red bold\">".$new_price." ".$symbolDevise."</span>";
$clientPrice = $new_price;
}
else {
$price = "<span class=\"biger11em bold\">".$old_price." ".$symbolDevise."</span>";
$clientPrice = $old_price;
}
}
else {
$price = "<span class=\"biger11em bold\">".$old_price." ".$symbolDevise."</span>";
$clientPrice = $old_price;
}

// Votre prix
if(isset($_SESSION['reduc']) AND $_SESSION['reduc'] > 0) {
$price2 = "<span class='small90'>".(($rowRel['products_lot_num']>0)? VOTRE_MISE : VOTRE_PRIX)."</span>: <span class='bold biger11em'>".newPrice($clientPrice,$_SESSION['reduc'])." ".$symbolDevise."</span>";
}
}
// Price
print "<div class='text-center marginT5'>".$price."</div>";

// Your price
if(isset($price2)) print "<div class='text-center'>".$price2."</div>";

// Afficher devise 2
if($devise2Visible == "oui" AND $clientPrice > 0) {
print "<div id='div_currency' class='text-center marginT5'>";
print curPrice($clientPrice, $symbolDevise2, "center");
print "</div>";
}

print "</div>";



//Bouton caddie
if((isset($_SESSION['account']) OR $activeEcom=="oui") AND !isset($_SESSION['devisNumero'])) {
if($rowRel['products_qt'] > 0) {
if($isThere == "yes") {
if($rowRel['products_options'] == 'no') {
print "<div class='text-center marginT10'>";
print "<a class='btn btn-custom red btn-md' href='add.php?amount=0&ref=".$rowRel['products_ref']."&id=".$rowRel['products_id']."&name=1&productTax=".$rowRel['products_tax']."&deee=".$rowRel['products_deee']."'>";
print "<i class='fa fa-times marginR5'></i>".RETIRER_DU_CADDIE;
print "</a>";
print "</div>";
}
else {
print "<div class='text-center marginT10'>";
print "<a href='".$urlAffDesc."' class='btn btn-custom red btn-md'>";
print "<i class='fa fa-eye marginR5'></i>".VOIR_OPTIONS;
print "</a>";
print "</div>";
}
}
else {
if($rowRel['products_options'] == 'no') {
print "<div class='text-center marginT10'>";
print "<form action='add.php' method='get'>";

print "<table class='table center-table' style='width:auto;'><tr>";
if($raffleActive == "oui" AND $rowRel['products_lot_num'] > 0) {
print "<td>".addQt($rowRel['products_lot_num'], 1, "normal");
} else {
print "<td style='padding-top:2px !important;'><input type='number' name='amount' value='1' min='0' class='input-sm numeric' />";
}
print "</td>";
print "<td>";
print "<button type='submit' class='btn btn-custom addtocart btn-md marginL5 boottip defaultColor' title='".AJOUTER_AU_CADDIE."'><i class='fa fa-shopping-cart marginR5'></i></button>";
print "</td>";
print "</tr></table>";

print "<input type='hidden' value='".$rowRel['products_id']."' name='id' />";
print "<input type='hidden' value='".$rowRel['products_ref']."' name='ref' />";
print "<input type='hidden' value='1' name='name' />";
print "<input type='hidden' value='".$rowRel['products_tax']."' name='productTax' />";
print "<input type='hidden' value='".$rowRel['products_deee']."' name='deee' />";
print "<input type='hidden' value='1' name='tabz' />";
print "</form>";
print "</div>";
}
else {
print "<div class='text-center marginT10'>";
print "<a href='".$urlAffDesc."' class='btn btn-custom default btn-md'>";
print "<i class='fa fa-eye marginR5'></i>".VOIR_OPTIONS;
print "</a>";
print "</div>";
}
}
}
else {
if($actRes=="non") {
print "<div class='text-center marginT10'>";
print "<i class='fa fa-ban text-red fa-2x boottip defaultColor' data-trigger='click hover' title='".NOT_IN_STOCK."'></i>";
print "</div>";
}
else {
print "<div class='text-center marginT10'>";
print "<a href='".$urlAffDesc."'><i class='fa fa-ban text-red fa-2x boottip defaultColor' title='".EN_COMMANDE."'></i></a>";
print "</div>";
}
}
}
else {
if(!isset($_SESSION['devisNumero'])) print "<div class='text-center marginT10'><a href='".$_SESSION['url_toAccount']."' class='btn btn-custom black btn-md'><i class='fa fa-sign-in marginR5'></i>".ENREG."</a></div>";
}

// Nombre de lot
if($rowRel['products_lot_num']>0 AND $raffleActive == "oui") {

print "<div class='marginT10 text-center text-gray noradius marginV20'>";
print LE2." <span class='bold'>".addOrdinalNumberSuffix($rowRel['products_lot_num'], $_SESSION['lang'])."</span> ".BUYER."<br />".GAGNEZ."<span class='bold'> ".$rowRel['products_won']." ".$symbolDevise."</span>";
// Montant compensatoire
if($rowRel['products_alternative_prizes']!=='') {
$extraPrizesArray = explode("|",$rowRel['products_alternative_prizes']);
$smallerPrizesDiv = "";
$ii = 1;
foreach($extraPrizesArray AS $extraprizes) {
$explodePrizes = explode(":", $extraprizes);
$smallerPrizesDiv.= "<div>".$ii++.". ".LE2." <b>".addOrdinalNumberSuffix($explodePrizes[0], $_SESSION['lang'])."</b> ".BUYER.", ".minuscule(GAGNEZ)." <b>".sprintf("%0.2f",$explodePrizes[1])." ".$symbolDevise."</b></div>";
}
// Set div infos
if(isset($smallerPrizesDiv) AND !empty($smallerPrizesDiv)) {
print "<div id='smallerPrizes".$rowRel['products_id']."' style='display:none;'>";
print "<div class='paddingB10' style='line-height:1.75em'>";
print "<div class='text-center bold'>".maj(RUNNERS_UP)."</div>";
print "<div class='text-center'>".$rowRel['products_name_'.$_SESSION['lang']]."</div>";
print "<hr class='hr marginH10' />";
print "<div>".$smallerPrizesDiv."</div>";
print "</div>";
print "</div>";
print "<div class='marginT2' style='font-size:12px;'><a href='".$_SESSION['ActiveUrl']."#smallerPrizes".$rowRel['products_id']."' class='facebox'><span class='text-gray'>".RUNNERS_UP." (".((count($extraPrizesArray) > 0)? "<b>".count($extraPrizesArray)."</b>" : "").")</span></a></div>";
}
}
print "</div>";

}
}

print "</div>";
}
}
print "</div>";

print "</div>"; // End owl-container
print "</div>"; // End col-md-12

print "</div>"; // End row
}

//-------------
// path rand() if products_id is not set
//-------------
if(!isset($_GET['id']) OR $_GET['id']=='') {
$pathQuery = mysqli_query( $GLOBALS['db'], "SELECT products_id, categories_id
FROM products
WHERE products_ref != 'GC100'
AND products_visible = 'yes'
AND products_forsale = 'yes'
ORDER BY rand() limit 1") or die (mysqli_error($GLOBALS['db']));
if(mysqli_num_rows($pathQuery)>0) {
$pathResult = mysqli_fetch_array($pathQuery);
$_GET['id'] = $pathResult['products_id'];
$_GET['path'] = $pathResult['categories_id'];
$_SESSION['ActiveUrl'] = $_SERVER["SCRIPT_NAME"]."?id=".$_GET['id']."&path=".$_GET['path'];
}
else {
header("Location: catalog.php");
}
}

//-------------
// Get reviews number if activated
//-------------
if($reviewsDisplay=="oui") {
$reviewsRequestTotal = mysqli_query( $GLOBALS['db'], "SELECT id FROM btk_reviews WHERE visible='vyes' AND lang='".$_SESSION['lang']."' AND prod_id='".$_GET['id']."'") or die(mysqli_error($GLOBALS['db']));
$reviewsRequestTotalNum = mysqli_num_rows($reviewsRequestTotal);
}

//-------------
// Get path if not set
//-------------
if(!isset($_GET['path'])) {
$queryGetPath = mysqli_query( $GLOBALS['db'], "SELECT categories_id FROM products WHERE products_id = '".$_GET['id']."'");
$getPathw = mysqli_fetch_array($queryGetPath);
$_GET['path'] = $getPathw['categories_id'];
}

//-------------
// current url
//-------------
if($_SERVER['REQUEST_URI']) {
if(!isset($_SESSION['ActiveUrl'])) $_SESSION['ActiveUrl'] = $_SERVER['REQUEST_URI'];
}
else {
if(!isset($_SESSION['ActiveUrl'])) $_SESSION['ActiveUrl'] = $_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];
}

//-------------
// Mise a jour bdd products_viewed
//-------------
if(!isset($_GET['a']) AND isset($_GET['id']) AND ($lastViewVisible=="oui" OR $lastViewCartVisible=="oui")) {
mysqli_query( $GLOBALS['db'], "UPDATE products SET products_viewed = products_viewed+1 WHERE products_id='".$_GET['id']."'");
}

//-------------
// Last view
//-------------
if($lastViewVisible=="oui" OR $lastViewCartVisible=="oui" OR $displayHistoryCatalog=="oui" OR $displayHistoryCategories=="oui" OR $displayHistoryList=="oui" OR $displayHistoryDesc=="oui") {
if(isset($_SESSION['lastView'])) {
if(!preg_match("#z".$_GET['id']."z#",$_SESSION['lastView'])) {
$_SESSION['lastView'].= "z".$_GET['id']."z";
}
else {
$_SESSION['lastView'] = str_replace($_GET['id']."z", "", $_SESSION['lastView']);
$_SESSION['lastView'].= "z".$_GET['id'];
}
}
else {
$_SESSION['lastView'] = "z".$_GET['id']."z";
}
$_SESSION['lastView'] = str_replace("zz","z",$_SESSION['lastView']);
}

//-------------
// Navigation precedent|suivant
//-------------
$classBy="products_id";
if(isset($_GET['sort'])) {
if($_GET['sort']=="id") {$classBy = "products_id";}
if($_GET['sort']=="Id") {$classBy = "products_id";}
if($_GET['sort']=="Ref") {$classBy = "products_ref";}
if($_GET['sort']=="Article") {$classBy = "products_name_".$_SESSION['lang'];}
if($_GET['sort']=="Prix") {$classBy = "products_price";}
if($_GET['sort']=="Compagnie") {$classBy = "fournisseurs_id";}
if($_GET['sort']=="Les_plus_populaires") {$classBy = "products_viewed";}
if($_GET['sort']=="specials_last_day") {$classBy = "specials_last_day";}
}
else {
$_GET['sort'] = $defaultOrder;
if($_GET['sort']=="id") {$classBy = "products_id";}
if($_GET['sort']=="Id") {$classBy = "products_id";}
if($_GET['sort']=="Ref") {$classBy = "products_ref";}
if($_GET['sort']=="Article") {$classBy = "products_name_".$_SESSION['lang'];}
if($_GET['sort']=="Prix") {$classBy = "products_price";}
if($_GET['sort']=="Compagnie") {$classBy = "fournisseurs_id";}
if($_GET['sort']=="Les_plus_populaires") {$classBy = "products_viewed";}
if($_GET['sort']=="specials_last_day") {$classBy = "specials_last_day";}

if(isset($_GET['target']) AND $_GET['target'] == "promo") {
$_GET['sort'] = "specials_last_day";
$classBy = "specials_last_day";
}
}

$asc = "DESC";
if($classBy == "products_name_".$_SESSION['lang']) $asc = "ASC";
if($classBy == "products_viewed") $asc = "ASC";

$addToQuery = ($displayOutOfStock=="non")? " AND p.products_qt>'0'" : "";
if(isset($productsIntoCategory)) unset($productsIntoCategory);
if(isset($select)) unset($select);

if(isset($_GET['path'])) {
$queryPath = mysqli_query( $GLOBALS['db'], "SELECT p.products_id
FROM products as p
LEFT JOIN specials as s
ON (p.products_id = s.products_id)
WHERE p.categories_id = '".$_GET['path']."'
AND p.products_visible = 'yes'
".$addToQuery."
OR p.categories_id_bis LIKE '%|".$_GET['path']."|%'
ORDER BY ".$classBy." ".$asc);
$queryPathNum = mysqli_num_rows($queryPath);
}

if(isset($_GET['target'])) {
// target promo
if($_GET['target']=="promo") {
if(isset($_GET['view'])) {
if(isset($_GET['tow']) AND $_GET['tow']=="flash") {
$addQueryFlash = " AND (TO_DAYS(s.specials_last_day)-TO_DAYS(NOW())) <= '".$seuilPromo."'";
$AddQuery = " AND p.categories_id = ".$_GET['view']." OR p.categories_id_bis LIKE '%|".$_GET['view']."|%'";
} else {
$addQueryFlash = "";
$AddQuery = " AND p.categories_id = ".$_GET['view']." OR p.categories_id_bis LIKE '%|".$_GET['view']."|%'";
}
}
else {
if(isset($_GET['tow']) AND $_GET['tow']=="flash") {
$addQueryFlash = " AND (TO_DAYS(s.specials_last_day)-TO_DAYS(NOW())) <= '".$seuilPromo."'";
$AddQuery = "";
}
else {
$addQueryFlash = "";
$AddQuery = "";
}
}
$selectP = "SELECT p.products_id,
IF(s.specials_new_price<p.products_price
AND s.specials_last_day >= NOW()
AND s.specials_first_day <= NOW(),
s.specials_new_price, p.products_price) as ord
FROM products as p
INNER JOIN specials as s
ON (p.products_id = s.products_id)
LEFT JOIN categories as c
ON (p.categories_id = c.categories_id)
LEFT JOIN fournisseurs as f
ON (p.fournisseurs_id = f.fournisseurs_id)
WHERE s.specials_visible='yes'
AND p.products_visible='yes'
AND c.categories_visible='yes'
AND p.products_ref != 'GC100'
".$addToQuery."
".$addQueryFlash."
AND p.products_forsale='yes'
AND TO_DAYS(s.specials_first_day) <= TO_DAYS(NOW())
AND TO_DAYS(NOW()) <= TO_DAYS(s.specials_last_day)";

$select = $selectP." ".$AddQuery;
$asc = "ASC";
$amb="p.";
if($classBy == "products_id") $asc = "DESC";
if($classBy == "products_ref") $asc = "DESC";
if($classBy == "products_name_".$_SESSION['lang']) $asc = "DESC";
if($classBy == "products_price") $asc = "ASC";
if($classBy == "fournisseurs_id") $asc = "DESC";
if($classBy == "products_viewed") $asc = "DESC";
if($classBy == "specials_last_day") {$asc = "ASC"; $amb="s.";}

$select.= " ORDER BY ".$amb.$classBy.", s.specials_first_day ".$asc;
$queryPath = mysqli_query( $GLOBALS['db'], $select) or die (mysqli_error($GLOBALS['db']));
$queryPathNum = mysqli_num_rows($queryPath);
}
// target news
if($_GET['target']=="new") {
$AddQuery = (isset($_GET['view']))? " AND p.categories_id = ".$_GET['view']." OR categories_id_bis LIKE '%|".$_GET['view']."|%'" : "";
$selectP = "SELECT p.products_id,
IF(s.specials_new_price<p.products_price
AND s.specials_last_day >= NOW()
AND s.specials_first_day <= NOW(),
s.specials_new_price, p.products_price) as ord
FROM products as p
LEFT JOIN specials as s
ON (p.products_id = s.products_id)
LEFT JOIN fournisseurs as f
ON (p.fournisseurs_id = f.fournisseurs_id)
LEFT JOIN categories as c
ON (p.categories_id = c.categories_id)
WHERE TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= '".$nbre_jour_nouv."'
AND p.products_visible='yes'
AND p.products_ref != 'GC100'
".$addToQuery."
AND c.categories_visible='yes'
";
$select = $selectP." ".$AddQuery;
$asc = "ASC";
$amb="p.";
if($classBy == "products_id") $asc = "DESC";
if($classBy == "products_ref") $asc = "DESC";
if($classBy == "products_name_".$_SESSION['lang']) $asc = "DESC";
if($classBy == "products_price") $asc = "DESC";
if($classBy == "fournisseurs_id") $asc = "DESC";
if($classBy == "products_viewed") $asc = "ASC";
if($classBy == "specials_last_day") {$asc = "ASC"; $amb="s.";}

$select .= " ORDER BY ".$amb.$classBy." ".$asc;
$queryPath = mysqli_query( $GLOBALS['db'], $select);
$queryPathNum = mysqli_num_rows($queryPath);
}
// target favorite
if($_GET['target']=="favorite") {
$AddQuery = (isset($_GET['view']))? " AND p.categories_id = ".$_GET['view']." " : "";
$selectP = "SELECT p.products_id,
IF(s.specials_new_price < p.products_price
AND s.specials_last_day >= NOW()
AND s.specials_first_day <= NOW(),
s.specials_new_price, p.products_price) as ord
FROM products as p
LEFT JOIN specials as s
ON (p.products_id = s.products_id)
LEFT JOIN fournisseurs as f
ON (p.fournisseurs_id = f.fournisseurs_id)
LEFT JOIN categories as c
ON (p.categories_id = c.categories_id)
WHERE p.products_visible='yes'
".$addToQuery."
AND c.categories_visible='yes'
AND p.products_exclusive = 'yes'
AND p.products_ref != 'GC100'
";
$select = $selectP." ".$AddQuery;
$asc = "ASC";
$amb="p.";
if($classBy == "products_id") $asc = "DESC";
if($classBy == "products_ref") $asc = "DESC";
if($classBy == "products_name_".$_SESSION['lang']) $asc = "ASC";
if($classBy == "products_price") $asc = "DESC";
if($classBy == "fournisseurs_id") $asc = "DESC";
if($classBy == "products_viewed") $asc = "ASC";
if($classBy == "specials_last_day") {$asc = "ASC"; $amb="s.";}

$select .= " ORDER BY ".$amb.$classBy." ".$asc;
$queryPath = mysqli_query( $GLOBALS['db'], $select);
$queryPathNum=mysqli_num_rows($queryPath);
}
// target reward
if($_GET['target']=="rew") {
$AddQuery = (isset($_GET['view']))? " AND p.categories_id = ".$_GET['view']." " : "";
$selectP = "SELECT p.products_id,
IF(s.specials_new_price<p.products_price
AND s.specials_last_day >= NOW()
AND s.specials_first_day <= NOW(),
s.specials_new_price, p.products_price) as ord
FROM products as p
LEFT JOIN specials as s
ON (p.products_id = s.products_id)
LEFT JOIN fournisseurs as f
ON (p.fournisseurs_id = f.fournisseurs_id)
LEFT JOIN categories as c
ON (p.categories_id = c.categories_id)
WHERE p.products_visible='yes'
".$addToQuery."
AND c.categories_visible='yes'
AND p.products_ref != 'GC100'
AND products_lot_num > 0
AND products_won > 0
";
$select = $selectP." ".$AddQuery;
$asc = "ASC";
$amb="p.";
if($classBy == "products_id") $asc = "DESC";
if($classBy == "products_ref") $asc = "DESC";
if($classBy == "products_name_".$_SESSION['lang']) $asc = "ASC";
if($classBy == "products_price") $asc = "DESC";
if($classBy == "fournisseurs_id") $asc = "DESC";
if($classBy == "products_viewed") $asc = "ASC";
if($classBy == "specials_last_day") {$asc = "ASC"; $amb="s.";}

$select .= " ORDER BY ".$amb.$classBy." ".$asc;
$queryPath = mysqli_query( $GLOBALS['db'], $select);
$queryPathNum=mysqli_num_rows($queryPath);
}
// target author
if($_GET['target'] == "author") {
$AddQuery = (isset($_GET['authorid']))? " AND p.fabricant_id = ".$_GET['authorid']." " : "";
$selectP = "SELECT p.products_id,
IF(s.specials_new_price<p.products_price
AND s.specials_last_day >= NOW()
AND s.specials_first_day <= NOW(),
s.specials_new_price, p.products_price) as ord
FROM products as p
LEFT JOIN specials as s
ON (p.products_id = s.products_id)
LEFT JOIN fournisseurs as f
ON (p.fournisseurs_id = f.fournisseurs_id)
LEFT JOIN categories as c
ON (p.categories_id = c.categories_id)
WHERE p.products_visible='yes'
".$addToQuery."
AND c.categories_visible='yes'
AND p.products_ref != 'GC100'
";
$select = $selectP." ".$AddQuery;
$asc = "ASC";
$amb="p.";
if($classBy == "products_id") $asc = "DESC";
if($classBy == "products_ref") $asc = "DESC";
if($classBy == "products_name_".$_SESSION['lang']) $asc = "ASC";
if($classBy == "products_price") $asc = "DESC";
if($classBy == "fournisseurs_id") $asc = "DESC";
if($classBy == "products_viewed") $asc = "ASC";
if($classBy == "specials_last_day") {$asc = "ASC"; $amb="s.";}

$select .= " ORDER BY ".$amb.$classBy." ".$asc;
$queryPath = mysqli_query( $GLOBALS['db'], $select);
$queryPathNum=mysqli_num_rows($queryPath);
}
}

// target search
if(isset($_GET['advCat']) OR isset($_GET['advComp']) OR isset($_GET['search_query'])) {
$addQuery55 = "";
if(isset($_GET['search_query'])) {
$ChercherSeparateur = explode("!",$_GET['search_query']);
$countChercherSeparateur = count($ChercherSeparateur);
if($countChercherSeparateur > 1) {
for($i=0; $i<=$countChercherSeparateur-1; $i++) {
$addQuery55 .=" AND (
p.products_desc_".$_SESSION['lang']." like '%".$ChercherSeparateur[$i]."%'
OR p.products_ref like '%".$ChercherSeparateur[$i]."%'
OR p.products_name_".$_SESSION['lang']." like '%".$ChercherSeparateur[$i]."%'
OR f.fournisseurs_company like '%".$ChercherSeparateur[$i]."%'
OR p.products_ean like '%".$ChercherSeparateur[$i]."%'
OR p.products_garantie_".$_SESSION['lang']." like '%".$ChercherSeparateur[$i]."%'
OR p.products_note_".$_SESSION['lang']." like '%".$ChercherSeparateur[$i]."%'";
$addQuery55 .=")";
}
}
else {
$addQuery55 = " AND (
p.products_desc_".$_SESSION['lang']." like '%".$_GET['search_query']."%'
OR p.products_ref like '%".$_GET['search_query']."%%'
OR p.products_name_".$_SESSION['lang']." like '%".$_GET['search_query']."%%'
OR f.fournisseurs_company like '%".$_GET['search_query']."%%'
OR p.products_ean like '%".$_GET['search_query']."%%'
OR p.products_garantie_".$_SESSION['lang']." like '%".$_GET['search_query']."%%'
OR p.products_note_".$_SESSION['lang']." like '%".$_GET['search_query']."%%'";
$addQuery55 .=")";
}
}
if(isset($_GET['advCat']) AND $_GET['advCat']!=="all") {
$addQuery55 .= " AND p.categories_id = ".$_GET['advCat'];;
}
if(isset($_GET['advComp']) AND $_GET['advComp']!=="all") {
$addQuery55 .= " AND p.fabricant_id = ".$_GET['advComp'];
}

if(isset($_GET['advCat'])) {
$addQuery55p = " OR p.categories_id_bis LIKE '%|".$_GET['advCat']."|%'";
if(isset($_GET['search_query']) AND !empty($_GET['search_query'])) $addQuery55p = '';
$addQuery55 .= $addQuery55p;
}

$queryVar55 = "SELECT p.products_id,
IF(s.specials_new_price < p.products_price
AND s.specials_last_day >= NOW()
AND s.specials_first_day <= NOW(),
s.specials_new_price, p.products_price) as ord
FROM products as p
LEFT JOIN categories as c
ON (p.categories_id = c.categories_id)
LEFT JOIN fournisseurs as f
ON (p.fournisseurs_id = f.fournisseurs_id)
LEFT JOIN specials as s
ON (p.products_id = s.products_id)
WHERE p.products_visible = 'yes'
".$addQuery55;

$queryVar55 .= " ORDER BY ".$classBy." DESC";
$queryPath = mysqli_query( $GLOBALS['db'], $queryVar55);
$queryPathNum = mysqli_num_rows($queryPath);
}

// requete
$productsIntoCategory = array();
if(isset($queryPathNum) AND $queryPathNum>0) {
while($resultPath = mysqli_fetch_array($queryPath)) {
$productsIntoCategory[] = $resultPath['products_id'];
}
if($_GET['sort']!==$defaultOrder AND $_GET['sort']!=="specials_last_day") {
$productsIntoCategory = array_reverse($productsIntoCategory);
if(isset($_GET['target']) AND $_GET['target']=="promo") $productsIntoCategory = array_reverse($productsIntoCategory);
}
}


// --------------------------------
// End Navigation precedent|suivant
// --------------------------------

// MAIN REQUEST
$result = mysqli_query( $GLOBALS['db'], "SELECT p.products_alternative_prizes, p.products_won, p.products_lot_num, p.products_sendfile, p.products_delay_1, p.products_delay_2, p.products_delay_1a, p.products_delay_2a, p.products_delay_1b, p.products_delay_2b, p.products_forsale, p.products_name_".$_SESSION['lang'].", p.products_deee, p.products_exclusive, p.fabricant_id, p.afficher_fabricant, p.products_garantie_".$_SESSION['lang'].", p.products_options, p.products_id, p.categories_id, p.fournisseurs_id, p.afficher_fournisseur, p.products_desc_".$_SESSION['lang'].", p.products_price, p.products_weight, p.products_note_".$_SESSION['lang'].", p.products_ref, p.products_im, p.products_image, p.products_image2, p.products_image3, p.products_image4, p.products_image5, p.products_option_note_".$_SESSION['lang'].", p.products_visible, p.products_taxable, p.products_tax, p.products_date_added, p.products_qt, p.products_viewed, p.products_qt, p.products_download, p.products_related, s.specials_new_price, s.specials_last_day, s.specials_first_day, s.specials_visible, f.fournisseurs_company, f.fournisseurs_link, f.fournisseurs_logo, c.categories_name_".$_SESSION['lang'].", c.categories_id, c.parent_id
FROM products as p
LEFT JOIN specials as s
ON (p.products_id = s.products_id)
LEFT JOIN fournisseurs as f
ON (p.fournisseurs_id = f.fournisseurs_id)
LEFT JOIN categories as c
ON (p.categories_id = c.categories_id)
WHERE p.products_id = '".$_GET['id']."'
AND products_visible = 'yes'");
$resultNum = mysqli_num_rows($result);
$rowp = mysqli_fetch_array($result);
$stockGeneral = $rowp['products_qt'];

//-------------
// Mettre toutes les combinaisons+stock dans un array Si articles avec options
//-------------
if($rowp['products_options']=='yes' AND $rowp['products_forsale']=='yes') {



// Search for defaults attributes
$optionQueryZ = mysqli_query( $GLOBALS['db'], "SELECT pr.products_option, po.products_options_name
FROM products_id_to_products_options_id as pr
LEFT JOIN products_options as po
ON(pr.products_options_id = po.products_options_id)
WHERE pr.products_id = '".$rowp['products_id']."'
ORDER BY po.products_options_name
ASC");
$optionNumZ = mysqli_num_rows($optionQueryZ);
while($optionResultZ = mysqli_fetch_array($optionQueryZ)) {
$oZ[$optionResultZ['products_options_name']] = $optionResultZ['products_option']."|";
}
$optionNumZ = count($oZ);
$valuesZ = array_values($oZ);

for($x=1; $x<=$optionNumZ; $x++) {
$optZ = explode(",",$valuesZ[$x-1]);
$aaZ = count($optZ);
if(isset($totalOptionPriceZ)) unset($totalOptionPriceZ);
for($xx=1; $xx<=$aaZ-1; $xx++) {
$optionFinalZ = explode("::",$optZ[$xx-1]);
$deleteCar = array("+","-"," ");
$totalOptionPriceZ[] = str_replace($deleteCar,"",$optionFinalZ[1]);
if($optionFinalZ[1]=='+0.00') {
// Put defaults attributes into $optArray variable
if(!isset($optArray[$x])) $optArray[$x] = $optionFinalZ[0];
}
}
}





// Search for all attributes combinaisons
$optQuery = mysqli_query( $GLOBALS['db'], "SELECT * FROM products_options_stock WHERE products_options_stock_prod_id = '".$_GET['id']."' ORDER BY products_options_stock_prod_name ASC");
if(mysqli_num_rows($optQuery)>0) {
while($optResult = mysqli_fetch_array($optQuery)) {
$downl = ($rowp['products_download']=='yes')? "download" : "";
//$variations[clean_word($optResult['products_options_stock_prod_name'])] = trim($optResult['products_options_stock_stock'].",".$optResult['products_options_stock_active'].",".$optResult['products_options_stock_ref'].",".$downl.",".$optResult['products_options_stock_im']);
$variations[$optResult['products_options_stock_prod_name']] = trim($optResult['products_options_stock_stock'].",".$optResult['products_options_stock_active'].",".$optResult['products_options_stock_ref'].",".$downl.",".$optResult['products_options_stock_im']);
}
if(isset($variations) AND count($variations)>0) {
foreach($variations AS $key => $value) {
$passVariationsToJs[] = trim($key).":>".trim($value);
}
$toPass = implode('!*!', $passVariationsToJs);
}
else {
$toPass = "";
}
}
else {
$toPass = "";
}




// Search for stock and reference for defaults attributes
if(isset($optArray) AND count($optArray)>0) {
$optionsByDefault = trim(implode(" | ", $optArray));
if(isset($passVariationsToJs) AND count($passVariationsToJs)>0) {
foreach($passVariationsToJs AS $items) {
$passVariationsToJsExplode = explode(":>",$items);
if(trim($passVariationsToJsExplode[0])==$optionsByDefault) $optionInfosArray = $passVariationsToJsExplode[1];
}
if(isset($optionInfosArray)) {
$optionInfosArrayExplode = explode(",",$optionInfosArray);
// Stock
$rowp['products_qt'] = $optionInfosArrayExplode[0];
##if($rowp['products_qt']==0) $stockOptionByDefault = 0;
// (option active) ?
$optionActive = ($optionInfosArrayExplode[1]=="no")? 0 : 1;
// Reference
if(isset($optionInfosArrayExplode[2]) AND !empty($optionInfosArrayExplode[2])) $rowp['products_ref'] = $optionInfosArrayExplode[2];
if($optionActive==0) $rowp['products_ref'] = SEGUN_OPTIONS;
// Images
$imageExplode = explode("|", $optionInfosArrayExplode[4]);
if(isset($imageExplode[0]) AND !empty($imageExplode[0])) {
$rowp['products_image'] = $imageExplode[0];
$rowp['products_image2'] = "";
$rowp['products_image3'] = "";
$rowp['products_image4'] = "";
$rowp['products_image5'] = "";
}
if(isset($imageExplode[1]) AND !empty($imageExplode[1])) $rowp['products_image2'] = $imageExplode[1];
if(isset($imageExplode[2]) AND !empty($imageExplode[2])) $rowp['products_image3'] = $imageExplode[2];
if(isset($imageExplode[3]) AND !empty($imageExplode[3])) $rowp['products_image4'] = $imageExplode[3];
if(isset($imageExplode[4]) AND !empty($imageExplode[4])) $rowp['products_image5'] = $imageExplode[4];
}
}
}
}

// article discontinue
$discontinue = ($rowp['products_forsale']=="no")? "<div class='badge badgeRed bold marginT15'>- ".OUT_OF_STOCK." -</div>" : "";

if(isset($_GET['path'])) {
$result3 = mysqli_query( $GLOBALS['db'], "SELECT categories_name_".$_SESSION['lang']." FROM categories WHERE categories_id = '".$_GET['path']."'");
$cat_name3 = mysqli_fetch_array($result3);
}
else {
$result3 = mysqli_query( $GLOBALS['db'], "SELECT categories_name_".$_SESSION['lang']." FROM categories WHERE categories_id = '".$rowp['parent_id']."'");
$cat_name3 = mysqli_fetch_array($result3);
$path = $rowp['parent_id'];
}


$page = (!isset($_GET['page']) OR $_GET['page']=="")? 0 : $_GET['page'];
$sort = (!isset($_GET['sort']))? $defaultOrder : $_GET['sort'];

if(!isset($_GET['target'])) {
$categorie = $cat_name3['categories_name_'.$_SESSION['lang']];
$catTitle = getSubCatId($_GET['path']);
$BarreMenuHautTitre = getSubCatName($catTitle)." > ".$rowp['products_name_'.$_SESSION['lang']];
}
if(isset($_GET['target']) AND $_GET['target'] == "new") {
$categorie = NOUVEAUTESMAJ;
$BarreMenuHautTitre = NOUVEAUTES. " > ".$rowp['products_name_'.$_SESSION['lang']];
}
if(isset($_GET['target']) AND $_GET['target'] == "promo") {
$categorie = maj(PROMOTIONS);
$BarreMenuHautTitre = PROMOTIONS." > ".$rowp['products_name_'.$_SESSION['lang']];
}
if(isset($_GET['target']) AND $_GET['target'] == "author") {
$categorie = $cat_name3['categories_name_'.$_SESSION['lang']];
$BarreMenuHautTitre = $categorie." > ".$rowp['products_name_'.$_SESSION['lang']];
}
if(isset($_GET['target']) AND $_GET['target'] == "favorite") {
$categorie = maj(COEUR);
$BarreMenuHautTitre = COEUR." > ".$rowp['products_name_'.$_SESSION['lang']];
}
if(isset($_GET['tow']) AND $_GET['tow']=="flash") {
$categorie = maj(VENTES_FLASH);
$BarreMenuHautTitre = $categorie." > ".$rowp['products_name_'.$_SESSION['lang']];
}
if(isset($_GET['target']) AND $_GET['target'] == "rew") {
$categorie = REW_PROD;
$BarreMenuHautTitre = REW_PROD. " > ".$rowp['products_name_'.$_SESSION['lang']];
}

$title = strip_tags($BarreMenuHautTitre);

// Get description and keywords metaTags
if(isset($_GET['id'])) {
$findCatFromProductQuery = mysqli_query( $GLOBALS['db'], "SELECT products_meta_title_".$_SESSION['lang'].", products_meta_description_".$_SESSION['lang'].", products_desc_".$_SESSION['lang'].", categories_id, products_name_".$_SESSION['lang']."
FROM products
WHERE products_id = '".$_GET['id']."'");
$findCatFromProductResult = mysqli_fetch_array($findCatFromProductQuery);

$idPath = $findCatFromProductResult['categories_id'];
$idName = strip_tags($findCatFromProductResult['products_name_'.$_SESSION['lang']]);
if($findCatFromProductResult['products_desc_'.$_SESSION['lang']] !== "") {
$carToDel = array("\t","\r\n","\n","/t",'"',"'");
$metaDesc = strip_tags($findCatFromProductResult['products_desc_'.$_SESSION['lang']]);
$metaDesc = str_replace($carToDel, " ", $metaDesc);
$metaDesc = (strlen($metaDesc) >= 200)? " | ".trim(substr($metaDesc, 0, 199)) : " | ".trim($metaDesc);
}
else {
$metaDesc = "";
}

$catTitle20 = getSubCatId($idPath);
$titrePath = getSubCatName($catTitle20);

$keysFromTitle = $idName.", ".str_replace(" | ",", ",$titrePath).", ".$store_name;
$descFromTitle = $idName." ".str_replace(' | ',' ',$titrePath).$metaDesc;

$description = strip_tags($descFromTitle);
$keywords = strip_tags($keysFromTitle);

if($findCatFromProductResult['products_meta_title_'.$_SESSION['lang']] !=="") $title = $findCatFromProductResult['products_meta_title_'.$_SESSION['lang']];
if($findCatFromProductResult['products_meta_description_'.$_SESSION['lang']] !=="") $description = $findCatFromProductResult['products_meta_description_'.$_SESSION['lang']];
}

// doctype
include('includes/doctype.php');
?>
<html>

<head>
<?php
/* Set Canonical URL */
$canonicalUrl = "description.php?path=".$_GET['id'];
if($url_rw==1) $canonicalUrl = rw_link($canonicalUrl,$rowp['products_name_'.$_SESSION['lang']]);
print "<link rel='canonical' href='".$http."://".$www2.$domaineFull."/".$canonicalUrl."' />";

include("includes/header.php");

if($lightbox == "oui" OR $displayStock == "oui") {?>

<link rel="stylesheet" type="text/css" href="js/slimbox/css/slimbox2.css" />
<script type="text/javascript" src="js/slimbox/js/slimbox2.js"></script>
<?php }

include("js/custom.js.php");
?>

<script type="text/javascript"><!--
<?php if($rowp['products_options'] == "yes") { ?>
// Dynamic Image
function displayImage(im_aj, prodName_aj) {
if(typeof(im_aj)!="undefined" && im_aj!=="") {
var lightbox = "<?php print $lightbox;?>";
var lang = "<?php print $_SESSION['lang'];?>";
var xhr = null;
if (window.XMLHttpRequest) {
xhr=new XMLHttpRequest();
}
else {
xhr=new ActiveXObject("Microsoft.XMLHTTP");
}

xhr.onreadystatechange=function() {
if (xhr.readyState==4 && xhr.status==200) {
document.getElementById('div_im').style.display='block';
document.getElementById('div_im1').style.display='none';
document.getElementById('div_miniIm').style.display='none';
document.getElementById("div_im").innerHTML = xhr.responseText;
if(lightbox=='oui') {
$(document).ready(function() {
$("a[data-rel^='lightbox']").slimbox({}, null, function(el) {
return (this == el) || ((this.attributes['data-rel'].value.length > 8) && (this.attributes['data-rel'].value == el.attributes['data-rel'].value));
});
});
}
}
}
xhr.open('get', "includes/ajax1.php?ajax_im="+im_aj+"&ajax_name="+prodName_aj+"&lang="+lang, true);
xhr.send(null);
}
else {
document.getElementById('div_im').style.display='none';
document.getElementById('div_im1').style.display='block';
document.getElementById('div_miniIm').style.display='block';
}
}

<?php if((isset($_SESSION['account']) OR $displayPriceInShop=='oui') AND $rowp['products_forsale']=="yes") { ?>
// Dynamic Ref
function afficher_ref(ref) {
if(ref!='') {
var affiche_ref = "";
affiche_ref = affiche_ref + "<div class='text-gray marginT5'>";
affiche_ref = affiche_ref + "<b><?php print REF;?></b>: " + ref;
affiche_ref = affiche_ref + "</div>";
document.getElementById('div_ref1').style.display='none';

}
else {
document.getElementById('div_ref1').style.display='block';
}
// Ecrase le resultat precedent
var div = document.getElementById("div_ref");
while (div.childNodes[0]) {
div.removeChild(div.childNodes[0]);
}
// Afficher resultat message
var div = document.createElement('div');
div.innerHTML = affiche_ref;
var passagesortieZ = document.getElementById("div_ref");
passagesortieZ.appendChild(div);
document.getElementById('div_ref1').style.display='none';
}
// Dynamic Price
function displayPrice(p, pDiscount, fp, ref, state, downl) {
var fp=fp.toFixed(2);
var p=p.toFixed(2);
var pDiscount=pDiscount.toFixed(2);
var symbolDevise2 = "<?php print $symbolDevise2;?>";
var devise2Visible = "<?php print $devise2Visible;?>";
var tauxDevise2 = "<?php print $tauxDevise2;?>";
var reference = ref;
var affiche_prixFinal = "";
var displayExpedShip = "<?php print $displayDelivery;?>";

if(pDiscount>0) {
fp1 = p-(p*pDiscount/100);
fp1 = fp1.toFixed(2);
}
else {
fp1 = p;
}

// Reference
if(reference!='') {
afficher_ref(reference);
}

// Afficher disponibilite
if(state!='') {
afficher_state(state, downl);
}

// Afficher expedition/livraison
if(state!='' && displayExpedShip=='oui') {
afficher_exped(state, downl);
}

if(fp1!=fp) {
// Prix
affiche_prixFinal = affiche_prixFinal + "<div class='marginT5'><span class='text-gray strike'>" + fp1 + " <?php print $symbolDevise;?></span><span class='bold marginL10'>" + fp + " <?php print $symbolDevise;?></span></div>";

// Devise 2
if(devise2Visible == "oui" && fp>0) {
currencyPrice = fp*tauxDevise2;
affiche_prixFinal = affiche_prixFinal + "<div class='text-gray small marginT5'>[" + currencyPrice.toFixed(2) + " " + symbolDevise2 + "]</div>";
document.getElementById('div_currency').style.display='none';
}
else {
document.getElementById('div_currency').style.display='block';
}

// Ecrase le resultat precedent
var div=document.getElementById("affiche_prix");
while (div.childNodes[0]) {
div.removeChild(div.childNodes[0]);
}
// Afficher resultat message
var div = document.createElement('div');
div.innerHTML = affiche_prixFinal;
var passagesortieZ = document.getElementById("affiche_prix");
passagesortieZ.appendChild(div);
document.getElementById('affiche_prix').style.display='block';
document.getElementById('div_price').style.display='none';
}
else {
document.getElementById('affiche_prix').style.display='none';
document.getElementById('div_price').style.display='block';
if(devise2Visible == "oui") {document.getElementById('div_currency').style.display='block';}
}
}

// Dynamic stock
function afficher_state(state, downl) {
if(state!='') {
var affiche_state = "";
if(state=="<?php print EN_STOCK;?>") affState = "<a href='javascript:void(0);' data-tooltip='<?php print EN_STOCK;?>'><i class='fa fa-check-circle text-green biger170 marginV5'></i></a>";
if(state=="<?php print EN_COMMANDE;?>") affState = "<a href='javascript:void(0);' data-tooltip='<?php print EN_COMMANDE;?>'><i class='fa fa-plus-circle text-blue biger170 marginV5'></i></a>";
if(state=="<?php print DECLINAISON_EPUISEE;?>") affState = "<a href='javascript:void(0);' data-tooltip='<?php print DECLINAISON_EPUISEE;?>'><i class='fa fa-ban text-red biger170 marginV5'></i></a>";
if(state=="no exists") affState = "<a href='javascript:void(0);' data-tooltip='<?php print DECLINAISON_NON_REPERTORIEE;?>'><i class='fa fa-ban text-red biger170 marginV5'></i></a>";
if(downl=="download") affState = "<a href='javascript:void(0);' data-tooltip='<?php print EN_STOCK;?>'><i class='fa fa-check-circle text-green biger170 marginV5'></i></a>";

affiche_state = affiche_state + "<?php print STOCK_STATUS;?> " + affState;
document.getElementById('div_state1').style.display='none';
}
else {
document.getElementById('div_state1').style.display='block';
}

// Ecrase le resultat precedent
var div = document.getElementById("div_state");
while (div.childNodes[0]) {
div.removeChild(div.childNodes[0]);
}
// Afficher resultat message
var div = document.createElement('div');
div.innerHTML = affiche_state;
var passagesortieZ = document.getElementById("div_state");
passagesortieZ.appendChild(div);
document.getElementById('div_state1').style.display='none';
}

<?php if($displayDelivery=="oui") { ?>
// Dynamic display shipping and delivery date
function afficher_exped(state, downl) {
if(state!='') {
var affiche_exp = "";
var products_delay_1 = <?php print $rowp['products_delay_1'];?>;
var products_delay_2 = <?php print $rowp['products_delay_2'];?>;
var products_delay_1b = <?php print $rowp['products_delay_1b'];?>;
var products_delay_2b = <?php print $rowp['products_delay_2b'];?>;
var products_delay_1a = <?php print $rowp['products_delay_1a'];?>;
var products_delay_2a = <?php print $rowp['products_delay_2a'];?>;
var actRes = '<?php print $actRes;?>';

if(state=="<?php print EN_STOCK;?>") {
affExped = "<div class='text-gray marginT15 small90'><b><?php print DELAI_EXPEDITION;?>:</b> <?php print ENTRE;?> <?php print $rowp['products_delay_1'];?> <?php print ET;?> <?php print $rowp['products_delay_2'];?> <?php print JOURS_OUVRES;?></div>";
if(products_delay_1==0 && products_delay_2 > products_delay_1) {
sous = products_delay_2*24;
affExped = "<div class='text-gray marginT15 small90'><b><?php print DELAI_EXPEDITION;?>:</b> <?php print SOUS;?> " + sous + "H.</div>";
}
affLiv = "<b><?php print DATE_LIVRAISON;?>:</b> <?php print ESTIMATION_FIN_COMMANDE;?>";
}
if(state=="<?php print EN_COMMANDE;?>") {
affExped = "<div class='text-gray marginT15 small90'><b><?php print DELAI_EXPEDITION;?>:</b> <?php print ENTRE;?> <?php print $rowp['products_delay_1b'];?> <?php print ET;?> <?php print $rowp['products_delay_2b'];?> <?php print JOURS_OUVRES;?></div>";
if(products_delay_1b==0 && products_delay_2b > products_delay_1b) {
sous = products_delay_2b*24;
affExped = "<div class='text-gray marginT15 small90'><b><?php print DELAI_EXPEDITION;?>:</b> <?php print SOUS;?> " + sous + "H.</div>";
}
affLiv = "<b><?php print DATE_LIVRAISON;?>:</b> <?php print ESTIMATION_FIN_COMMANDE;?>";
}
if(state=="<?php print DECLINAISON_EPUISEE;?>") {
affExped = "<div class='text-gray marginT15 small90'><b><?php print DELAI_EXPEDITION;?>:</b> <?php print ENTRE;?> <?php print $rowp['products_delay_1a'];?> <?php print ET;?> <?php print $rowp['products_delay_2a'];?> <?php print JOURS_OUVRES;?></div>";
if(actRes=='non') affExped = "";
if(products_delay_1a==0 && products_delay_2a > products_delay_1a) {
if(actRes=='oui') {
sous = products_delay_2a*24;
affExped = "<div class='text-gray marginT15 small90'><b><?php print DELAI_EXPEDITION;?>:</b> <?php print SOUS;?> " + sous + "H.</div>";
}
}
affLiv = "";
}
if(state=="no exists") {
affExped = "";
affLiv = "";
}
if(downl=="download") {
affExped = "";
affLiv = "<div class='text-gray marginT15 small90'><b><?php print DATE_LIVRAISON;?>:</b> <?php print EN_TELECHARGEMENT_A_LA_CONFIRMATION_DU_PAIEMENT;?></div>";
}

affiche_exp = affiche_exp + "<div class='marginT10 small90'>";
affiche_exp = affiche_exp + "<div class='text-gray'>";
affiche_exp = affiche_exp + affExped;
if(affLiv!="") {
affiche_exp = affiche_exp + "</div>";
affiche_exp = affiche_exp + "<div class='text-gray'>";
affiche_exp = affiche_exp + affLiv;
}
affiche_exp = affiche_exp + "</div>";
affiche_exp = affiche_exp + "</div>";
document.getElementById('display_liv').style.display='none';
}
else {
document.getElementById('display_liv').style.display='block';
}
// Ecrase le resultat precedent
var div = document.getElementById("div_exped");
while (div.childNodes[0]) {
div.removeChild(div.childNodes[0]);
}
// Afficher resultat message
var div = document.createElement('div');
div.innerHTML = affiche_exp;
var passagesortieZ = document.getElementById("div_exped");
passagesortieZ.appendChild(div);
document.getElementById('display_liv').style.display='none';
}
<?php }?>

<?php }?>

<?php }?>
<?php if($displayRelated == "oui" AND !empty($rowp['products_related'])) { ?>
// Related products container height
$(document).ready(function($) {
var h = $(".owl-wrapper-outer").height();
$(".owlProdContainer").css({"height" : h+"px"});
});
<?php }?>
--></script>

</head>


<body>

<?php include("includes/headerScript.php");?>

<!-- Sidebar for small device -->
<?php include("includes/sidebar.php");?>

<div id='toPush'>

<!-- No script -->
<?php include('includes/noscript.php'); /** No script */ ?>


<!-- ================================
HTML HEADER 1
================================= -->

<?php include('includes/header1.php');?>


<!-- ================================
HTML HEADER 2
================================= -->

<?php include('includes/header2.php');?>


<!-- ================================
HTML HEADER 3
================================= -->

<?php include('includes/header3.php');?>


<!-- ================================
MENU HORZ
================================= -->
<?php
// Menu mega
if($megaMenuMod=="oui") { include('includes/menu_mega.php'); }
// Menu horizontal
if($menuCssVisibleHorizon=="oui") { include('includes/menu_categories_layer_H.php'); }
// Menu tabulation
if($menuVisibleTab=="oui") { include('includes/menu_tab.php'); }
?>

<!-- ================================
HTML CONTENT
================================= -->

<div class="container" id="content_container">
<div class="row">

<?php if($colomnLeft == "oui") {?>
<!-- ============ COLUMN LEFT ============== -->
<div class="col-md-2" id="col_left">
<div class='marginL5'>
<?php include('includes/column_left.php');?>

</div>
</div>
<?php }?>

<!-- ============ CONTENT ============== -->
<div class="col-md-<?php echo $col_content;?>" id="content">

<?php if($tableDisplay == "oui") {?>
<ol class="breadcrumb top">
<li><a href="<?php print $_SESSION['url_toCatalog'];?>"><i class="fa fa-home fa-15x"></i></a></li>
<?php
if(isset($_GET['target']) AND !isset($_GET['tow'])) $targetF = $_GET['target'];
if(isset($_GET['target']) AND isset($_GET['tow'])) $targetF = $_GET['tow'];
if(!isset($_GET['target'])) $targetF = "";
$pathF = (!isset($_GET['path']))? "" : $_GET['path'];
getPath2($pathF, $catId=0, $_SESSION['tree2'], $targetF, $_SESSION['lang'], $pathF, $rowp['products_name_'.$_SESSION['lang']]);
?>

</ol>

<div class="dotted-divider marginT10"></div>
<?php }?>




<?php
if($resultNum>0) {
//-------------
// TABLE CENTRE
//-------------

$refdet = maj($rowp['products_ref']);

// Verification date & prix de promo
if(!empty($rowp['specials_new_price'])) {
if($rowp['specials_visible']=="yes") {
$today = mktime(0,0,0,date("m"),date("d"),date("Y"));
$dateMaxCheck = (!empty($rowp['specials_last_day']))? explode("-",$rowp['specials_last_day']) : explode("-","0-0-0");
$dateMax = mktime(0,0,0,$dateMaxCheck[1],$dateMaxCheck[2],$dateMaxCheck[0]);
$dateDebutCheck = (!empty($rowp['specials_first_day']))? explode("-",$rowp['specials_first_day']) : explode("-","0-0-0");
$dateDebut = mktime(0,0,0,$dateDebutCheck[1],$dateDebutCheck[2],$dateDebutCheck[0]);

if($dateDebut <= $today AND $dateMax >= $today) {
$delayPassed = "no";
$itMiss = round((mktime(0,0,0,$dateMaxCheck[1],$dateMaxCheck[2],$dateMaxCheck[0]) - mktime(0,0,0,date("m"),date("d"),date("Y")))/86400);
$promoIs = "yes";
}
else {
$delayPassed = "yes";
$EnPromo = "";
$promoIs = "no";
}
}
else {
$EnPromo = "";
$promoIs = "no";
}
}
else {
$EnPromo = "";
$promoIs = "no";
}
// Verification prix promo
if(isset($delayPassed) AND $delayPassed == "no" AND $rowp['products_forsale']=="yes") {
$itMiss = round((mktime(0,0,0,$dateMaxCheck[1],$dateMaxCheck[2],$dateMaxCheck[0]) - mktime(0,0,0,date("m"),date("d"),date("Y")))/86400);
$jour = ($itMiss>1)? JOURS."s": JOURS;
$endPromotion = $dateMaxCheck[1]."/".$dateMaxCheck[2]."/".$dateMaxCheck[0]." 12:00 PM";
$econPourcent = (1-($rowp['specials_new_price']/$rowp['products_price']))*100;
$econPourcent = sprintf("%0.2f",$econPourcent)."%";
$econPourcent2 = sprintf("%0.0f",$econPourcent)."%";
?><script type="text/javascript">TargetDate = "<?php print $endPromotion;?>";BackColor = "none";ForeColor = "#FFF";CountActive = true;DisplayFormat = "%%D%% <?php print strtolower($jour);?> %%H%%:%%M%%:%%S%%";FinishMessage = "Stop !";</script><?php

/** Promo star banner -X% */
$EnPromo2 = "<div style='width:100px; height:68px; background-image:url(im/promoPriceOn.png); background-position:top center; background-repeat:no-repeat;'>";
$EnPromo2.= "<div class='text-center' style='color:#CC0000; padding:19px 0 0 3px; font-size:20px; font-weight:400;'><b>-".$econPourcent2."</b></div>";
$EnPromo2.= "</div>";

if($itMiss > $seuilPromo) {
$EnPromo = $EnPromo2;
}
else {
if($activeSeuilPromo == "oui") {
$aa = '<script type="text/javascript" src="js/countdown.js"></script>';
$EnPromo = "<div class='flashbox'>".PLUS_QUE." ".$aa."</div>";

2 réponses

tracker6 Messages postés 4 Date d'inscription dimanche 6 septembre 2015 Statut Membre Dernière intervention 7 septembre 2015
7 sept. 2015 à 09:38
Bonjour
personne ?

merci de votre aide
0
tracker6 Messages postés 4 Date d'inscription dimanche 6 septembre 2015 Statut Membre Dernière intervention 7 septembre 2015
7 sept. 2015 à 14:09
je pense qu'il manque un ( ; ) mais je ne vois pas ou vue erreur

Parse error: syntax error, unexpected '$canonicalUrl' (T_VARIABLE) in /home/ayjakeyb/public_html/description.php on line 1

????

voici le lien du script
https://code.empreintesduweb.com/9722.html
merci pour votre aide
0
tracker6 Messages postés 4 Date d'inscription dimanche 6 septembre 2015 Statut Membre Dernière intervention 7 septembre 2015
7 sept. 2015 à 17:45
j'ai Résolu !

Parse error: syntax error, unexpected \'$canonicalUrl\' (T_VARIABLE) in /home/ayjakeyb/public_html/description.php on line 1

Ce problème vient du votre client FTP.
Uplaodez du fichier description.php en mode binaire.

voila si ça peut aider pour les autre si ils on le meme souci
0