1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
<?php
ob_start();
list($k, $l, $m) = explode('/', $_SERVER['REQUEST_URI']);
if(empty($m)){
header('Status: 301 Moved Permanently', false, 301);
header('Location: ./index.html');
exit();
}
include('./includes/bdd_connect.php');
include('./includes/functions.php');
//Smarty
include('./includes/xSmarty/Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = './includes/myViews_tpl/';
$smarty->compile_dir = './includes/myViews_c/';
$smarty->config_dir = './includes/xSmarty/configs/';
$smarty->cache_dir = './includes/xSmarty/cache/';
$smarty->left_delimiter = '<!--{';
$smarty->right_delimiter = '}-->';
//Architecture MVC
define('CONTROLERS', './includes/myControlers/');
define('MODELS', './includes/myModels/');
define('VIEWS', './includes/myViews_tpl/');
include(MODELS.'general.php');
if(isset($_GET['view'])){
switch($_GET['view']){
case '404':
$smarty->assign('title', 'Page non trouvée');
$inc = CONTROLERS.'404.php';//fonctions liées à gammes
$display = '404.tpl';
break;
case 'gamme'://page gamme.
//////////////////////////
//LA PARTIE DE TEST POUR LE TITRE EST ICI:
//////////////////////////
$inc = CONTROLERS.'gamme.php';//fonctions liées à gammes
$display = 'gamme.tpl';
break;
//////////////////////////////////////////////////
case 'actualites'://page gamme.
$smarty->assign('title', 'Actualités');
$inc = CONTROLERS.'actualites.php';//fonctions liées à actualites
$display = 'actualites.tpl';
break;
case 'articles'://page gamme.
$smarty->assign('title', 'Articles');
$inc = CONTROLERS.'articles.php';//fonctions liées à articles
$display = 'articles.tpl';
break;
case 'contact':
$smarty->assign('title', 'Contact');
$inc = CONTROLERS.'contact.php';//fonctions liées à contact
$display = 'contact.tpl';
break;
case 'produit':
$smarty->assign('title', 'Produit');
$inc = CONTROLERS.'produit.php';//fonctions liées à produit
$display = 'produit.tpl';
break;
case 'faq':
$smarty->assign('title', 'Foire aux questions');
$inc = CONTROLERS.'faq.php';//fonctions liées à la faq
$display = 'faq.tpl';
break;
case 'qui-sommes-nous':
$smarty->assign('title', 'Qui sommes nous');
$inc = CONTROLERS.'qui.php';//fonctions liées à qui-sommes-nous
$display = 'qui.tpl';
break;
case 'presse':
$smarty->assign('title', 'Revues de presse');
$inc = CONTROLERS.'presse.php';//fonctions liées à presse
$display = 'presse.tpl';
break;
case 'revendeurs':
$smarty->assign('title', 'Revendeurs');
$inc = CONTROLERS.'revendeurs.php';//fonctions liées aux revendeurs
$display = 'revendeurs.tpl';
break;
case 'poules':
$smarty->assign('title', 'Les poules');
$inc = CONTROLERS.'poules.php';//fonctions liées à poules
$display = 'poules.tpl';
break;
default:
$smarty->assign('title', 'Accueil');
$inc = CONTROLERS.'accueil.php';//fonctions liées à l'accueil
$display = 'accueil.tpl';
}//fin switch
}else{//si view pas defini = page accueil $smarty->display('menu.tpl');
$smarty->assign('title', 'Accueil');
$inc = CONTROLERS.'accueil.php';///fonctions liées à l'accueil
$display = 'accueil.tpl';
}
///////////////////////////////j'affiche la page!
$smarty->assign('title', $title);
$smarty->display('header.tpl');
include(CONTROLERS.'ariane.php');//fonctions liées à l'affichage du fil d'ariane
include(CONTROLERS.'caroussel_actu.php');//fonctions liées à l'affichage des actualités.
//////////////affichage du menu/////////////
include(CONTROLERS.'menu.php');
$smarty->display('menu.tpl');
////////////////////////////////////////////
require_once $inc;//inclus la page
$smarty->display($display);
////////////Affichage du pied de page////////
include(CONTROLERS.'footer.php');///fonctions liées au pied de page
$smarty->display('footer.tpl');
/////////////////////////////////////////////
ob_end_flush();
?> |
Partager