-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
155 lines (133 loc) · 5.32 KB
/
header.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<!-- Set the character encoding for the document -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Set the title of the webpage -->
<title>Todo list</title>
<!-- Link to Bootstrap CSS for styling and responsive design -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<!-- Internal CSS for styling the body -->
<style>
/* Ensure the footer is always at the bottom */
html, body {
height: 100%;
}
body{
/* Remove padding from the body */
padding:0;
display: flex;
flex-direction: column;
/* Remove margin from the body */
margin:0;
/* Set the background image for the body */
background:url('background.jpg');
/* Ensure the background image covers the entire body */
background-size:cover;
/* Prevent the background image from repeating */
background-repeat:no-repeat;
}
.content {
/* flex: 1; */
}
</style>
</head>
<body></body>
<nav class="navbar navbar-expand-lg navbar-light bg-light ">
<div class="container-fluid">
<a class="navbar-brand" href="/">Todo List</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="index.php">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="add.php">Add Task</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.php">About</a>
</li>
<?php if(isset($_SESSION['user_id'])): ?>
<!-- Links for authenticated users -->
<li class="nav-item">
<a class="nav-link" href="profile.php">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link" href="logout.php" onclick="return confirm('Are you sure you want to logout?');">Logout</a>
</li>
<?php else: ?>
<!-- Links for guests -->
<li class="nav-item">
<a class="nav-link" href="login.php">Login</a>
</li>
<li class="nav-item">
<a class="nav-link" href="register.php">Register</a>
</li>
<?php endif; ?>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<!-- Show delete alert message if a task was successfully deleted -->
<?php
if(isset($_SESSION['delete_success'])) { // Check if the 'delete_success' session variable is set
?>
<div class="alert alert-warning text-dark mx-auto mt-4" role="alert" style="width:66%;">
<?=$_SESSION['delete_success'];?> <!-- Display the delete success message -->
</div>
<?php
unset($_SESSION['delete_success']); // Unset the 'delete_success' session variable after displaying the message
}
?>
<!-- Show update alert message if a task was successfully updated -->
<?php
if(isset($_SESSION['upadate_success'])) { // Check if the 'upadate_success' session variable is set
?>
<div class="alert alert-warning text-dark mx-auto mt-4" role="alert" style="width:66%;">
<?=$_SESSION['upadate_success'];?> <!-- Display the update success message -->
</div>
<?php
unset($_SESSION['upadate_success']); // Unset the 'upadate_success' session variable after displaying the message
}
?>
<!-- Show add alert message if a task was successfully added -->
<?php
if(isset($_SESSION['add_success'])) { // Check if the 'add_success' session variable is set
?>
<div class="alert alert-success text-dark mx-auto mt-4" role="alert" style="width:66%;">
<?=$_SESSION['add_success'];?> <!-- Display the add success message -->
</div>
<?php
unset($_SESSION['add_success']); // Unset the 'add_success' session variable after displaying the message
}
?>
<!-- Show updated alert message if a task was successfully updateded -->
<?php
if(isset($_SESSION['update_success'])) { // Check if the 'update_success' session variable is set
?>
<div class="alert alert-success text-dark mx-auto mt-4" role="alert" style="width:66%;">
<?=$_SESSION['update_success'];?> <!-- Display the updated success message -->
</div>
<?php
unset($_SESSION['update_success']); // Unset the 'update_success' session variable after displaying the message
}
?>
<!-- Show add alert message if there was a failure in adding a task -->
<?php
if(isset($_SESSION['add_failure'])) { // Check if the 'add_failure' session variable is set
?>
<div class="alert alert-danger text-dark mx-auto mt-4" role="alert" style="width:66%;">
<?=$_SESSION['add_failure'];?> <!-- Display the add failure message -->
</div>
<?php
unset($_SESSION['add_failure']); // Unset the 'add_failure' session variable after displaying the message
}
?>
</div>
<div class="content mt-3"></div>