-
Notifications
You must be signed in to change notification settings - Fork 0
/
rooms.php
54 lines (41 loc) · 1.54 KB
/
rooms.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 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 include('users/admin/rooms.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'];
$staff_pho = $row['phone_number'];
$staff_email = $row['email'];
// Add other details you want to fetch
if ($staff_job == 'Nurse') {
include('users/nurce/rooms.php');
} elseif ($staff_job == 'Doctor') {
include('users/doctor/rooms.php');
}
?>
<?php }else {?>
<?php echo "<h2> Opps Wrog User type <h2>"?>
<?php } ?>
</div>
</div>
</div>
<?php } else {
header("Location: index.php");
}?>
<?php include('template-parts/dashbords/footer.php'); ?>