-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
107 lines (86 loc) · 2.03 KB
/
index.php
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
<?php
if(!isset($_SESSION)){
session_start();
}
require('controller/frontend.php');
try{
$pages = scandir('view/frontend/');
if (isset($_GET['page'])) {
/* page home */
if ($_GET['page'] == 'home') {
$home = new PageHome;
$home -> home();
}
elseif ($_GET['page'] == 'menu') {
$menu = new PageMenu;
$menu -> menu();
}
elseif ($_GET['page'] == 'operation') {
$operation = new PageOperation;
$operation -> operation();
}
elseif ($_GET['page'] == 'promo') {
$promo = new PagePromo;
$promo -> promo();
}
elseif ($_GET['page'] == 'article') {
$article = new PageArticle;
$article -> article();
}
elseif ($_GET['page'] == 'recap') {
$recap = new PageRecap;
$recap -> recap();
}
elseif ($_GET['page'] == 'commande') {
$commande = new PageCommande;
$commande -> commande();
}
elseif ($_GET['page'] == 'reservation') {
$reservation = new PageReservation;
$reservation -> reservation();
}
elseif ($_GET['page'] == 'prevision') {
$prevision = new PagePrevision;
$prevision -> prevision();
}
elseif ($_GET['page'] == 'jsonclient') {
if(isset($_GET['term'])){
$client = new PageOperation;
$client -> jsonStat0($_GET['term'] );
}
}
elseif ($_GET['page'] == 'jsonstat1') {
if(isset($_GET['term'])){
$stat1 = new PageOperation;
$stat1 -> jsonStat1($_GET['term'] );
}
}
elseif ($_GET['page'] == 'jsonstat2') {
if(isset($_GET['term'])){
$stat2 = new PageOperation;
$stat2 -> jsonStat2($_GET['term'] );
}
}
elseif ($_GET['page'] == 'jsonstat3') {
if(isset($_GET['term'])){
$stat3 = new PageOperation;
$stat3 -> jsonStat3($_GET['term'] );
}
}
/* search page exist */
elseif(in_array($_GET['page'],$pages)){
$page=$_GET['page'];
}
else{
throw new Exception('Ce n\' est pas la bonne page');
}
}
else{
$home = new PageHome;
$home -> home();
}
}
catch(Exception $e) {
require('view/frontend/error.php');
}
?>