-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
113 lines (103 loc) · 4.62 KB
/
header.php
File metadata and controls
113 lines (103 loc) · 4.62 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
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
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/all.min.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/NewAdStyle.css">
<link href="https://fonts.googleapis.com/css?family=Lora:400,700|Montserrat:300" rel="stylesheet">
<title>Fleurtop</title>
<link rel="apple-touch-icon" sizes="180x180" href="/fleurtop/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/fleurtop/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/fleurtop/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
</head>
<body>
<nav>
<a class="logo" href="index">
<h2 class="nav-title">FLEURT </h2>
<img src="images/Logo green2.png" alt="">
<h2 class="nav-title">P</h2>
</a>
<ul class="nav-links" id="nav-links">
<li><a href="adpagina" class="nav" id="link1">Aanbod</a></li>
<li><a href="blogpage" class="nav" id="link2">Blog</a></li>
<li><a href="hoewerkthet" class="nav" id="link3">Hoe werkt het?</a></li>
<li><a href="overons" class="nav" id="link4">Over ons</a></li>
<?php
$id = $_SESSION['userId'];
if (isset($id)) {
require 'includes/dbh.inc.php';
$sql = $conn->query("SELECT admin FROM User WHERE idUser = '$id'") or die($conn->error);
/* fetch associative array */
$row = $sql->fetch_assoc();
echo '<li><a href="profilepage" class="nav" id="link5"><i class="fas fa-user"></i> Mijn profiel</a></li>';
//if user is an admin, add dashboard tab to navbar
if($row['admin'] == 1){
echo '<li><a href="dashboard" class="nav" id="link6"><i class="fas fa-user-friends"></i> Dashboard</a></li>';
}
echo '<form action="includes/logout.inc.php" method="post">
<li><button class="logout_button" type="submit" name="logout-submit">Uitloggen</button></li>
</form>';
}
else {
echo '<li><a href="loginpagina" class="nav" id="link7">Login/Register</a></li>';
}
?>
</ul>
<div class="burger">
<div class="line1"></div>
<div class="line2"></div>
<div class="line3"></div>
</div>
</nav>
<script>
var current = document.getElementsByClassName("active");
function headerSwitch(pageLink){
// If there's no active class
if (current.length > 0) {
current[0].className = current[0].className.replace(" active", "");
}
var activeLink = document.getElementById(pageLink);
// Add the active class to the current/clicked button
activeLink.className += " active";
}
switch(window.location.href) {
case "https://www.roy-van-der-lee.nl/fleurtop/adpagina":
headerSwitch("link1");
break;
case "https://www.roy-van-der-lee.nl/fleurtop/blogpage":
headerSwitch("link2");
break;
case "https://www.roy-van-der-lee.nl/fleurtop/hoewerkthet":
headerSwitch("link3");
break;
case "https://www.roy-van-der-lee.nl/fleurtop/overons":
headerSwitch("link4");
break;
case "https://www.roy-van-der-lee.nl/fleurtop/profilepage":
headerSwitch("link5");
break;
case "https://www.roy-van-der-lee.nl/fleurtop/dashboard":
headerSwitch("link6");
break;
case "https://www.roy-van-der-lee.nl/fleurtop/loginpagina":
headerSwitch("link7");
break;
default:
// If there's no active class
if (current.length > 0) {
current[0].className = current[0].className.replace(" active", "");
}
}
</script>
</body>
</html>