-
Notifications
You must be signed in to change notification settings - Fork 0
/
navbar.php
115 lines (101 loc) · 2.72 KB
/
navbar.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
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
<?php
// Start the session if not already started
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
?>
<nav>
<header>
<h1><a href="index.php">Library Management System</a></h1>
</header>
<ul>
<?php if (isset($_SESSION['username'])): ?>
<li>Welcome, <?php echo htmlspecialchars($_SESSION['username']); ?>!</li>
<li><a href="dashboard.php">Dashboard</a></li>
<li><a href="add_book.php">Add Book</a></li>
<li><a href="search_books.html">Search Books</a></li>
<li><a href="logout.php" onclick="return confirm('Are you sure you want to log out?');">Logout</a></li>
<?php else: ?>
<li><a href="login.html">Log In</a></li>
<li><a href="register.html">Register</a></li>
<?php endif; ?>
</ul>
</nav>
<style>
body {
font-family: 'Cambria', serif;
background-color: #f4f4f4; /* Light grey background */
color: #333333; /* Dark text color */
margin: 0;
padding: 0;
}
nav {
background: #2C3E50; /* Dark blue */
color: #ffffff; /* White text */
padding: 10px;
text-align: center; /* Center align */
}
nav a {
color: #ffffff; /* White text */
text-decoration: none;
margin: 0 10px;
}
nav ul {
list-style-type: none;
padding: 0;
display: inline-block; /* Change list to inline-block */
}
nav ul li {
display: inline;
}
nav header h1 a {
color: #ffffff; /* White text */
text-decoration: none;
}
header {
background-color: #2C3E50; /* Dark blue */
color: #ffffff; /* White text */
text-align: center;
padding: 20px 0;
margin-bottom: 40px;
}
header h1 {
font-size: 2.5rem;
margin: 0;
}
main {
text-align: center;
padding: 30px 10px;
}
main h2 {
color: #2C3E50; /* Dark blue */
font-size: 2rem;
margin-bottom: 30px;
}
.actions {
display: flex;
justify-content: center;
gap: 20px;
}
.actions a {
background-color: #3498db; /* Blue button */
color: #ffffff; /* White text */
padding: 12px 20px;
text-decoration: none;
border-radius: 4px;
font-size: 1.1rem;
transition: background-color 0.3s;
}
.actions a:hover {
background-color: #2980b9; /* Darker blue on hover */
}
footer {
background-color: #2C3E50; /* Dark blue */
color: #ffffff; /* White text */
text-align: center;
padding: 10px;
position: absolute;
bottom: 0;
width: 100%;
}
</style>