forked from alizeear/almy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
37 lines (32 loc) · 860 Bytes
/
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
<?php
session_start();
include "include/almyDb.class";
$db = almyDb::getDB();
// pour le dev, nous rend admin connecté
if(isset($_GET['dev']))
$_SESSION['id'] = 1;
// si l'user est pas connecté, et qu'il n'y a pas de requette de connexion, la page d'accueil est affiché
if((!isset($_SESSION['id'])) && ((!isset($_GET['do'])) || ($_GET['do'] != "login"))) {
include "controllers/show_c.php";
include "view/show_v.php";
}
else {
if(!isset($_GET['do']) && (isset($_SESSION['id']))) {
include "controllers/admin_c.php";
include "view/admin_v.php";
}else{
switch ($_GET['do']) {
case 'login':
include "controllers/connexion_c.php";
break;
case 'logout':
include "controllers/deconnexion_c.php";
break;
default:
include "controllers/show_c.php";
include "view/show_v.php";
break;
}
}
}
?>