-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuser.php
More file actions
65 lines (59 loc) · 1.85 KB
/
Copy pathuser.php
File metadata and controls
65 lines (59 loc) · 1.85 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
session_start();
include 'app/env.php';
include 'app/session.php';
if (!isset($_SESSION['unique_user'])) {
?>
<script>
alert('Anda harus login untuk mengakses halaman ini!');
window.location.href = 'login';
</script>
<?php
return false;
}
if (isset($_SESSION['unique_user']) && $_SESSION['type_user'] == "admin") {
?>
<script>
alert('Anda tidak mempunyai akses ke halaman ini!');
window.location.href = 'beranda_admin';
</script>
<?php
return false;
} else if (isset($_SESSION['unique_user']) && $_SESSION['type_user'] == "guru") {
?>
<script>
alert('Anda tidak mempunyai akses ke halaman ini!');
window.location.href = 'beranda_guru';
</script>
<?php
return false;
}
include 'app/get_data.php';
include 'base_url.php';
if (isset($_GET['views_user']) && $_GET['views_user'] == 'beranda') {
$title = 'Beranda';
$icon = 'mdi mdi-view-dashboard';
} else if (isset($_GET['views_user']) && $_GET['views_user'] == 'daftar_buku') {
$title = 'Daftar Buku';
$icon = 'mdi mdi-book';
} else if (isset($_GET['views_user']) && $_GET['views_user'] == 'daftar_peminjaman') {
$title = 'Daftar Peminjaman';
$icon = 'mdi mdi-book-open';
} else {
$title = 'Beranda';
$icon = 'mdi mdi-view-dashboard';
}
include 'views/layout/header.php';
include 'views/layout/navbar.php';
include 'views/layout/sidebar.php';
if (isset($_GET['views_user']) && $_GET['views_user'] == 'beranda') {
include 'views/pages/user/beranda.php';
} else if (isset($_GET['views_user']) && $_GET['views_user'] == 'daftar_buku') {
include 'views/pages/user/daftar_buku.php';
} else if (isset($_GET['views_user']) && $_GET['views_user'] == 'daftar_peminjaman') {
include 'views/pages/user/daftar_peminjaman.php';
} else {
include 'views/pages/user/beranda.php';
}
include 'views/layout/footer.php';
?>