-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.php
45 lines (42 loc) · 1.25 KB
/
menu.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
<!DOCTYPE html>
<html>
<head>
<link rel = "stylesheet" href = "Styles\menu.css">
</head>
<body>
<ul class="menu">
<li class = "menu-item"><a href = "homepage.php">Home</a></li>
<!-- <li class = "menu-item"><a href = "about.php">About</a></li> -->
<?php
session_start();
$admin=$_SESSION["isadmin"];
echo" <li class = 'menu-item'><a href = 'ticket.php'>Ticket Booking</a></li>";
echo"<li class = 'menu-item'><a href = 'feedback.php'>FeedBack</a></li>";
?>
<li class = "menu-item2">
<?php
// Check if the user is logged in
if (isset($_SESSION["username"]))
{
if($admin==1)
{
header("Location: admin.php");
exit();
}
$username = $_SESSION["username"];
echo "<label class = 'mainusername'>User: " . $_SESSION["username"]."<label>";
}
else
{
// If not logged in, redirect to login page
header("Location: index.php");
exit();
}
?>
</li>
<li class = "menu-item2">
<a href=logout.php><button class=logout>Logout</button></a>
</li>
</ul>
</body>
</html>