-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
73 lines (64 loc) · 2.78 KB
/
header.php
File metadata and controls
73 lines (64 loc) · 2.78 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
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
?>
<?php require_once 'php/User.php'; ?>
<!DOCTYPE html>
<html>
<head>
<title>
Alba Wildlife Cruises
</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Ferry Industries">
<meta name="author" content="Ali Mac">
<script src="js/main.js"></script>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<header>
<!--Title, Background Image, Button for Login-->
<div class="jumbotron " style="background-image: url('assets/imgs/boatimage.jpg')">
<div class="row">
<div class="col">
<h1 class="display-3" style="">Alba Wildlife Cruises</h1>
</div>
<div class="col" style="text-align:right">
<?php require_once 'php/LoginHandler.php'; ?>
<?php $LoginHandler = new LoginHandler(); ?>
<?php $sessionID = $LoginHandler->isLoggedIn(); ?>
<?php $currentUser = $LoginHandler->getUser($sessionID);?>
<?php if($currentUser["is_admin"] == 1){ ?>
<?php if(basename($_SERVER['PHP_SELF']) != "admin.php"){ ?>
<button class="btn btn-danger" onclick="location.href='admin.php';">Admin Page</button>
<?php }else{ ?>
<button class="btn btn-primary" onclick="location.href='index.php';">Back to Index Page</button>
<?php } ?>
<?php } ?>
<?php if($currentUser["userID"] != null){ ?><h4><a href="customer.php?id=<?php echo $currentUser["userID"]; ?>"><?php echo $currentUser["firstname"]." ".$currentUser["lastname"]; ?></a> | <a href="logout.php">Logout</a></h4><?php }else{ ?>
<button type="button" class="btn btn-primary" onclick="location.href='login.php';">Login/Register</button>
<?php } ?>
</div>
</div>
</div>
<div class="row" style="text-align:center;">
<div class="col" style="background-color:black; font-color:white; padding-top:15px; padding-bottom:15px;">
<a href="index.php">Home</a>
</div>
<div class="col" style="background-color:black; font-color:white; padding-top:15px; padding-bottom:15px;">
<a href="customer.php">Customer</a>
</div>
<?php if($currentUser["userID"] != null){ ?>
<div class="col" style="background-color:black; font-color:white; padding-top:15px; padding-bottom:15px;">
<a href="logout.php">Logout</a>
</div>
<?php }else{ ?>
<div class="col" style="background-color:black; font-color:white; padding-top:15px; padding-bottom:15px;">
<a href="login.php">Login</a>
</div>
<?php } ?>
</div>
</header>