-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhms-dashbord.php
85 lines (67 loc) · 2.55 KB
/
hms-dashbord.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php include('template-parts/dashbords/header.php');?>
<?php
session_start();
include "connect.php";
if(isset($_SESSION['username']) && isset($_SESSION['user_id']))
{ ?>
<div class="container-fluid">
<div class="row main-section">
<!-- If Admin Logged in -->
<?php if ($_SESSION ['user_type'] == 'admin') {?>
<?php
$user_type = $_SESSION['user_type'];
?>
<?php include('panels/admin.php'); ?>
<?php } elseif ($_SESSION ['user_type'] == 'staff') {?>
<?php
// Fetch the staff type and other details from the database
$user_id = $_SESSION['user_id'];
$query = "SELECT * FROM staff WHERE user_id = '$user_id'";
$result = mysqli_query($conn, $query);
$row = mysqli_fetch_assoc($result);
$staff_id = $row['staff_id'];
$staff_fname = $row['first_name'];
$staff_lname = $row['last_name'];
$staff_job = $row['job_title'];
$gender = $row['gender'];
$staff_pho = $row['phone_number'];
$staff_email = $row['email'];
$staff_avilable = $row['availability'];
// Add other details you want to fetch
if ($staff_job == 'Nurse') {
include('panels/nurse.php');
} elseif ($staff_job == 'Doctor') {
include('panels/doctor.php');
}
?>
<?php } elseif ($_SESSION ['user_type'] == 'patient') {?>
<?php
$user_id = $_SESSION['user_id'];
$query = "SELECT * FROM patients WHERE user_id = '$user_id'";
$resul = mysqli_query($conn, $query);
$row = mysqli_fetch_assoc($resul);
$user_type = $_SESSION['user_type'];
$patient_id = $row['patient_id'];
$patient_fname = $row['first_name'];
$patient_lname = $row['last_name'];
$patient_bday = $row['date_of_birth'];
$gender = $row['gender'];
$patient_add = $row['address'];
$patient_phone = $row['phone_number'];
$patient_email = $row['email'];
$patient_medical_h = $row['medical_history'];
?>
<?php include('panels/patients.php'); ?>
<?php }?>
</div>
</div>
<style>
.btn-back-home {
display: none;
}
</style>
</div>
<?php } else {
header("Location: index.php");
}?>
<?php include('template-parts/dashbords/footer.php'); ?>