-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
139 lines (118 loc) · 3.08 KB
/
header.php
File metadata and controls
139 lines (118 loc) · 3.08 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>BookBuddy</title>
<link rel="stylesheet" href="css/style.css" />
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
background-color:rgb(40, 126, 184);
padding: 10px 20px;
position: sticky;
top: 0px;
z-index: 1000;
}
.navbar .logo img {
max-height: 60px; /* Adjust this value for logo size */
width: auto; /* Keep aspect ratio */
}
.navbar ul {
display: flex;
list-style: none;
}
.navbar ul li {
margin: 0px 15px;
}
.navbar ul li a {
color: white;
text-decoration: none;
font-size: 16px;
font-weight: 500;
transition: color 0.3s;
}
.navbar ul li a:hover {
color: #ffc107;
}
.dropdown {
position: relative;
}
.dropdown-content {
display: none;
position: absolute;
right: 0;
background-color: white;
min-width: 200px;
box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content div, .dropdown-content a {
color: #333;
padding: 10px;
text-decoration: none;
display: block;
border-bottom: 1px solid #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
.dropdown-content a:hover {
background-color: #f0f0f0;
}
@media screen and (max-width: 768px) {
.navbar {
flex-direction: column;
align-items: flex-start;
}
.navbar ul {
flex-direction: column;
width: 100%;
}
.navbar ul li {
margin: 10px 0;
}
}
</style>
</head>
<body>
<header class="navbar">
<div class="logo">
<a href="index.php"><img src="images/Logo.png" alt="BookBuddy"></a>
</div>
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="team.php">Team</a></li>
<?php if (isset($_SESSION["user_id"])): ?>
<?php if ($_SESSION["role"] === "admin"): ?>
<li><a href="admin_panel.php">Admin Panel</a></li>
<?php else: ?>
<li><a href="cart_view.php">Cart</a></li>
<li><a href="orders.php">My Orders</a></li>
<?php endif; ?>
<li class="dropdown">
<a href="#">Welcome, <?= $_SESSION["role"] === "admin" ? "Admin " : ""; ?><?= htmlspecialchars($_SESSION["user_name"]); ?> ▾</a>
<div class="dropdown-content">
<div>Username: <?= htmlspecialchars($_SESSION["user_name"]); ?></div>
<div>Email: <?= htmlspecialchars($_SESSION["email"] ?? 'Not Available'); ?></div>
<a href="logout.php" style="color: red;">Logout</a>
</div>
</li>
<?php else: ?>
<li><a href="login.php">Login</a></li>
<li><a href="register.php">Register</a></li>
<?php endif; ?>
</ul>
</header>
</body>
</html>