-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
executable file
·92 lines (89 loc) · 3.54 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
<?php
if (!isset($_SESSION['currency'])) {
$_SESSION['currency'] = "GBP";
}
?>
<div class="header">
<div class="menuIcon" onclick="MenuBtn()">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
</div>
<div class="links">
<a href="index.php">
<p>Home</p>
</a>
<a href="shop.php">
<p>Shop</p>
</a>
<a href="about-us.php">
<p>About us</p>
</a>
<a href="contact-us.php">
<p>Contact us</p>
</a>
<div class="search-container-mobile">
<div class="search-bar-mobile">
<input class="search expandright" id="searchright" type="search" name="q" placeholder="Search eg: 'Instagram'">
<label class="button searchbutton" for="searchright"><span class="mglass">⚲</span></label>
</div>
<div class="results"></div>
</div>
<div class="currency-selector-mobile">
<p>Currency:</p>
<select class="currency-picker" name="currency" onchange="changeCurrency(value)">
<option value="GBP" <?= $_SESSION['currency'] == 'GBP' ? ' selected' : '' ?>>GBP</option>
<option value="EUR" <?= $_SESSION['currency'] == 'EUR' ? ' selected' : '' ?>>EUR</option>
<option value="USD" <?= $_SESSION['currency'] == 'USD' ? ' selected' : '' ?>>USD</option>
</select>
</div>
</div>
<a href="index.php" class="logo">
<img class="logoHeader" src="img/logo.webp" />
</a>
<div class="icons">
<div class="currency-selector">
<select class="currency-picker" name="currency" onchange="changeCurrency(value)">
<option value="GBP" <?= $_SESSION['currency'] == 'GBP' ? ' selected' : '' ?>>GBP</option>
<option value="EUR" <?= $_SESSION['currency'] == 'EUR' ? ' selected' : '' ?>>EUR</option>
<option value="USD" <?= $_SESSION['currency'] == 'USD' ? ' selected' : '' ?>>USD</option>
</select>
</div>
<div class="search-container">
<input class="search expandright" id="searchleft" type="search" name="q" placeholder="Поиск">
<label class="button searchbutton" for="searchleft"><span class="mglass">⚲</span></label>
<div class="results"></div>
</div>
<a href="cart.php" class="icon">
<img class="shop-icon" src="img/shop-icon.webp" />
<div class="cart">
<p><?php echo isset($_SESSION["cart"]) ? sizeof($_SESSION["cart"]) : "0" ?></p>
</div>
</a>
</div>
</div>
<script type="text/javascript">
$(function() {
var url = window.location.pathname;
var page = url.substring(url.lastIndexOf("/") + 1, url.length);
if (page == "") {
$(".links a").get(0).className += "selected";
}
$(".links a").each(function() {
let href = this.href.substring(this.href.lastIndexOf("/") + 1, this.href.length);
if (page == href) {
$(this).addClass("selected");
}
});
});
function MenuBtn() {
var x = document.getElementsByClassName("links").item(0);
document.getElementsByClassName("menuIcon").item(0).classList.toggle("change");
if (x.style.display === "block") {
x.style.display = "none";
} else {
x.style.display = "block";
}
}
</script>
<script type="text/javascript" src="js/search.js"></script>