This repository has been archived by the owner on Jan 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
85 lines (78 loc) · 4.34 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
<?php
session_start();
if(isset($_COOKIE["cartList"])) { // Check of de cookie bestaat
$cartListItems = json_decode($_COOKIE["cartList"]); // Decode de cookie
} else {
$cartListItems = array(); // Maak een lege array
}
$cartCount = count($cartListItems); // Tel de items in de array
?>
<header>
<div class="navbar">
<div class="nav-logo" id="falling-element">
<img onclick="javascript:window.location.href= '../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../'" id="NerdyGadgetsLogo" src="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../images/logo_small_white.png" alt="logo" height="100%">
</div>
<a href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../" id="falling-element">
<div class="nav-item">
<p><span class="material-symbols-sharp">home</span>NERDY-GADGETS</p>
</div>
</a>
<div class="nav-searchbar" id="falling-element">
<form action="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../search/" method="get">
<input type="text" name="query" id="query" placeholder="Zoek een product">
</form>
<h1 class="mobile-show">Nerdy Gadgets</h1>
</div>
<a href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../search" id="falling-element2">
<div class="nav-item">
<p><span class="material-symbols-sharp">view_list</span>CATALOGUS</p>
</div>
</a>
<script>
document.getElementById('falling-element2').addEventListener('click',
function(event) {
// Maakt een random nummer tussen 1-10
var randomNumber = Math.floor(Math.random() * 10) + 1;
// als de randomnummer 1 is dan redirect het naar de pagina secretlink
if (randomNumber === 1) {
event.preventDefault(); // laat link niet zien
window.location.href = '../SECRETLINK/SECRETLINK.php'
}
});
</script>
<div class="small-head-icons" id="falling-element">
<a href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../cart">
<div class="nav-item">
<p><span class="material-symbols-sharp">shopping_cart</span></p>
<p class="user-text-header" id="cartcount"> <?php echo $cartCount ?> </p>
</div>
</a>
<?php
if (isset($_SESSION["first_name"])):?>
<a href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../account/accountscreen.php">
<div class="nav-item">
<p><span class="material-symbols-sharp">account_circle</span></p>
<p class="user-text-header"> <?= htmlspecialchars($_SESSION["first_name"]) ?> </p>
</div>
</a>
<a href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../account/logout.php">
<div class="nav-item">
<p><span class="material-symbols-sharp">logout</span></p>
</div>
</a>
<?php
if ($_SESSION["first_name"] == "Mario"){
print("its a me");
print("<img src='../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../mario.gif'>". "<br>");
}
?>
<?php else: ?>
<a href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../account/login.php">
<div class="nav-item">
<p><span class="material-symbols-sharp">login</span></p>
</div>
</a>
<?php endif;?>
</div>
</div>
</header>