-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
65 lines (63 loc) · 2.24 KB
/
header.php
File metadata and controls
65 lines (63 loc) · 2.24 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
<?php
// Include the configuration file
include("config.php");
// Start the session
session_start();
// Handle logout request
if (isset($_POST['logout'])) {
// Destroy the session and redirect to the login page
session_destroy();
header("Location: login.php");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css">
</head>
<body>
<header class="header">
<div class="flex">
<a href="admin_pannel.php" class="logo"><img src="img/logo.png" alt="Logo"></a>
<nav class="navbar">
<a href="home.php">Home</a>
<a href="about.php">About</a>
<a href="shop.php">Shop</a>
<a href="order.php">Order</a>
<a href="contact.php">Contact</a>
</nav>
<div class="icons">
<i class="bi bi-person" id="user-btn"></i>
<a href="wishlist.php"><i class="bi bi-heart"></i></a>
<a href="cart.php"><i class="bi bi-cart"></i></a>
<i class="bi bi-list" id="menu-btn"></i>
</div>
<div class="user-box">
<p>Username:
<span>
<?php
// Display username if set, otherwise show "Guest"
echo isset($_SESSION['user_name']) ? htmlspecialchars($_SESSION['user_name']) : 'Guest';
?>
</span>
</p>
<p>Email:
<span>
<?php
// Display email if set, otherwise show "Not Available"
echo isset($_SESSION['user_email']) ? htmlspecialchars($_SESSION['user_email']) : 'Not Available';
?>
</span>
</p>
<form method="post">
<button type="submit" name="logout" class="logout-btn">Log Out</button>
</form>
</div>
</div>
</header>
</body>
</html>