-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhome.php
More file actions
46 lines (35 loc) · 1.14 KB
/
home.php
File metadata and controls
46 lines (35 loc) · 1.14 KB
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
<?php
require_once './init.php';
// If there's no loggin user, redirect to login page
if (!$current_user) header("Location: login.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Homepage</title>
</head>
<body>
<h1>Hello, <?= $current_user->name ?></h1>
<p>Your're level is <b><?= $current_user->level_name ?></b></p>
<ul>
<!-- If id_level is 1 (admin) -->
<?php if ($current_user->id_level == 1) : ?>
<li><a href="admin/dashboard">Dashboard</a></li>
<li><a href="admin/users">User List</a></li>
<li><a href="admin/products.php">Products</a></li>
<?php endif ?>
<!-- If id_level is 2 (cashier) -->
<?php if ($current_user->id_level == 2) : ?>
<li><a href="admin/orders">Order List</a></li>
<?php endif ?>
<!-- If id_level is 3 (customer) -->
<?php if ($current_user->id_level == 3) : ?>
<li><a href="admin/orders">Order List</a></li>
<?php endif ?>
</ul>
<a href="./logout.php">Logout</a>
</body>
</html>