-
Notifications
You must be signed in to change notification settings - Fork 1
/
header.php
99 lines (59 loc) · 2.85 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
93
94
95
96
97
98
99
<?php $page = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1); ?>
<?php
if(!session_id())
session_start();
?>
<html>
<head>
<!-- font awesome cdn link -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
<body>
<header>
<nav class="nav" >
<div class="nav-logo">
<a href="index.php"><h1 style="margin-top:20px;"><span class="text-primary">Clover</span>Emporium</h1></a>
</div>
<div class="nav-menu flex" id="navMenu">
<ul>
<li><a href="index.php" class="link <?= $page == 'index.php' ? 'active':''; ?>">Home</a></li>
<li>
<div class="dropdown">
<button class="dropbtn noHover"><span class="link <?= $page == 'womens.php' || $page == 'mens.php' || $page == 'kids.php' ? 'active':''; ?> " >Products <i class="fa-solid fa-angle-down"></i></span></button>
<div class="dropdown-content">
<a href="womens.php">Women's Collection</a>
<a href="mens.php">Men's Collection</a>
<a href="kids.php">Kids' Collection</a>
</div>
</div>
<li><a href="about.php" class="link <?= $page == 'about.php' ? 'active':''; ?>">About</a></li>
<li><a href="contact.php" class="link <?= $page == 'contact.php' ? 'active':''; ?>">Contact</a></li>
<li><a href="search.php" class="link <?= $page == 'search.php' ? 'active':''; ?>">Search <i class="fa-solid fa-magnifying-glass"></i></a></li>
<?php
if(isset($_SESSION['login'])&&$_SESSION['login']==true){
echo "<li>
<a href='cart.php' class='link cart'>Cart <i class='fa-solid fa-cart-shopping'></i> </a>";
echo "<a href='logout.php' class='link'>Logout <i class='fa-solid fa-arrow-right-from-bracket'></i></a></li> ";
}
else{
echo "<li><a href='login.php' class='link'>Login <i class='fa-solid fa-arrow-right-to-bracket'></i></a></li>";
}
echo"</ul>";
?>
<div class="nav-menu-btn">
<i class="bx bx-menu" onclick="myMenuFunction()"></i>
</div>
</div>
</nav>
<script>
function myMenuFunction() {
var i = document.getElementById("navMenu");
if(i.className === "nav-menu") {
i.className += " responsive";
} else {
i.className = "nav-menu";
}
}
</script>
</header>
</body>