-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.php
54 lines (46 loc) · 1.02 KB
/
admin.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
<?php
/**
* page d'adiministration
* @author afjnik hassan
*/
require("inc/functions.php");
/**
* si pas identifier revoi au login
*/
if(!isLoggedIn()) {
header("Location: login.php");
}
/**
* Si authentifier comme client on le redirige
*/
if(!isAdmin()) {
header("Location: index.php");
}
include("templates/header.php");
/**
* gestion des pages d'admin
*/
if (isAdmin()) {
if (!empty($_GET['pg'])) {
$pg = $_GET['pg'];
switch ($pg) {
case 'produits':
include('templates/admin-product.php');
break;
case 'clients':
include('templates/admin-clients.php');
break;
case 'commandes':
include('templates/admin-commandes.php');
break;
case 'edit':
include('templates/admin-edit-product.php');
break;
default:
echo "Bienvenue, maître";
break;
}
}
}
include("templates/footer.php");
?>