-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.php
57 lines (50 loc) · 1.51 KB
/
dashboard.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
<?php
session_start();
// Mendapatkan role dari session atau dari tempat lain sesuai kebutuhan
if (isset($_SESSION['role_id'])) {
$role = $_SESSION['role_id'];
// Tentukan file sidebar yang akan dimuat berdasarkan role
if ($role === 1) {
$sidebar_file = 'components/sidebar_admin.php';
$home_file = 'pages/home_admin.php';
} elseif ($role === 2) {
$sidebar_file = 'components/sidebar_dokter.php';
$home_file = 'pages/home_dokter.php';
} else {
// Atur default jika $_SESSION['role_id'] tidak terdefinisi atau tidak sesuai
$sidebar_file = 'components/sidebar_pasien.php';
$home_file = 'pages/home_pasien.php';
}
} else {
// Atur default jika $_SESSION['role_id'] belum terdefinisi
$sidebar_file = 'components/sidebar_pasien.php';
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include('components/head.php'); ?>
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
<!-- Navbar -->
<?php include('components/navbar.php'); ?>
<!-- /.navbar -->
<!-- Main Sidebar Container -->
<?php include($sidebar_file); ?>
<!-- /.sidebar -->
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Main content -->
<?php include($home_file); ?>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<!-- Main Footer -->
<?php include('components/footer.php'); ?>
</div>
<!-- ./wrapper -->
<!-- REQUIRED SCRIPTS -->
<!-- ... -->
</body>
</html>