-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
53 lines (51 loc) · 1.97 KB
/
header.php
File metadata and controls
53 lines (51 loc) · 1.97 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
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<nav>
<div class="main-wrapper">
<ul>
<li><a href="index.php">Home</a> </li>
<?php
//if user is logged in then show extra tabs
if(isset($_SESSION['email'])){
if(strcmp($_SESSION['type'], "Manager") == 0){
echo '
<li><a href="viewUsers.php">Edit Users</a></li>
<li><a href="addBook.php">Add Books</a></li>
<li><a href="view_books.php">Edit Books</a></li>
<li><a href="addKey.php">Add Keywords</a></li>
<li><a href="view_key.php">Edit Keywords</a></li>
';
}
echo ' <li><a href="userPage.php">User</a> </li>
<li><a href="cart.php">Cart</a> </li>';
}
?>
</ul>
<div class="nav-login">
<?php
if(isset($_SESSION['email'])){
echo '<form action="includes/logout-inc.php" method="post">
<button type="submit" name="submit">Logout</button>
</form>';
} else {
echo '<form action="includes/login-inc.php" method="post">
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<button type="submit" name="submit">Login</button>
</form>
<a href="signup.php">Sign Up</a>';
}
?>
</div>
</div>
</nav>
</header>