-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
122 lines (121 loc) · 4.55 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
// Pour afficher les erreurs décommenté les lignes en dessous
/*ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);*/
session_start();
require_once "config/config.php";
require_once "controleur/controleur.php";
if (isset($_GET["action"])) {
if ($_GET["action"] == "chateau") {
chateau();
} elseif ($_GET["action"] == "chateaux" and isset($_GET["id"])) {
chateaux();
} elseif ($_GET["action"] == "visiteVirtuelle" and isset($_GET["id"])) {
visiteVirtuelle();
} elseif ($_GET["action"] == "carte" and isset($_GET["id"])) {
carte();
} elseif ($_GET["action"] == "contact") {
contact();
} elseif ($_GET["action"] == "formAchat") {
formAchat();
} elseif ($_GET["action"] == "formVente") {
formVente();
} elseif ($_GET["action"] == "blog") {
blog();
} elseif ($_GET["action"] == "blogs") {
blogs();
} elseif ($_GET["action"] == "login") {
login();
} elseif ($_GET["action"] == "verifLogin") {
verifLogin();
} elseif ($_GET["action"] == "legal") {
legal();
} elseif ($_GET["action"] == "admin") {
if (isset($_SESSION["login"])) {
admin();
} else {
header("Location: index.php?action=login");
}
} elseif ($_GET["action"] == "gestBien") {
if (isset($_SESSION["login"]) and str_contains($_SESSION["login"][1], "biens")) {
gestBien();
} else {
header("Location: index.php?action=login");
}
} elseif ($_GET["action"] == "gestBiens") {
if (isset($_SESSION["login"]) and str_contains($_SESSION["login"][1], "biens")) {
gestBiens();
} else {
header("Location: index.php?action=login");
}
} elseif ($_GET["action"] == "gestUti") {
if (isset($_SESSION["login"]) and str_contains($_SESSION["login"][1], "biens") and str_contains($_SESSION["login"][1], "blog")) {
gestUti();
} else {
header("Location: index.php?action=login");
}
} elseif ($_GET["action"] == "gestUtis") {
if (isset($_SESSION["login"]) and str_contains($_SESSION["login"][1], "biens") and str_contains($_SESSION["login"][1], "blog")) {
gestUtis();
} else {
header("Location: index.php?action=login");
}
} elseif ($_GET["action"] == "formContact") {
if (isset($_SESSION["login"])) {
formContact();
} else {
header("Location: index.php?action=login");
}
} elseif ($_GET["action"] == "gestBlog") {
if (isset($_SESSION["login"]) and str_contains($_SESSION["login"][1], "blog")) {
gestBlog();
} else {
header("Location: index.php?action=login");
}
} elseif ($_GET["action"] == "gestBlogs") {
if (isset($_SESSION["login"]) and str_contains($_SESSION["login"][1], "blog")) {
gestBlogs();
} else {
header("Location: index.php?action=login");
}
} elseif ($_GET["action"] == "unLogin") {
if (isset($_SESSION["login"])) {
unLogin();
} else {
header("Location: index.php?action=login");
}
} elseif ($_GET["action"] == "ajoutBien") {
if (isset($_SESSION["login"]) and str_contains($_SESSION["login"][1], "biens")) {
ajoutBien();
} else {
header("Location: index.php?action=login");
}
} elseif ($_GET["action"] == "modifBien") {
if (isset($_SESSION["login"]) and str_contains($_SESSION["login"][1], "biens")) {
modifBien();
} else {
header("Location: index.php?action=login");
}
} elseif ($_GET["action"] == "delBien" and isset($_GET["id"])) {
if (isset($_SESSION["login"]) and str_contains($_SESSION["login"][1], "biens")) {
delBien();
} else {
header("Location: index.php?action=login");
}
} elseif ($_GET["action"] == "ajoutUti") {
if (isset($_SESSION["login"]) and str_contains($_SESSION["login"][1], "biens") and str_contains($_SESSION["login"][1], "blog")) {
ajoutUti();
} else {
header("Location: index.php?action=login");
}
} elseif ($_GET["action"] == "modifUti") {
if (isset($_SESSION["login"]) and str_contains($_SESSION["login"][1], "biens") and str_contains($_SESSION["login"][1], "blog")) {
modifUti();
} else {
header("Location: index.php?action=login");
}
}
} else {
accueil();
}