-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
64 lines (56 loc) · 2.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
<?php
if(isset($message)){
foreach($message as $message){
echo '
<div class="message">
<span>'.$message.'</span>
<i class="fas fa-times" onclick="this.parentElement.remove();"></i>
</div>
';
}
}
?>
<header class="header">
<div class="flex">
<a href="home.php" class="logo">BookStore.</a>
<nav class="navbar">
<ul>
<li><a href="home.php">home</a></li>
<li><a href="#">pages +</a>
<ul>
<li><a href="about.php">about</a></li>
<li><a href="contact.php">contact</a></li>
</ul>
</li>
<li><a href="shop.php">shop</a></li>
<li><a href="orders.php">orders</a></li>
<li><a href="#">account +</a>
<ul>
<li><a href="login.php">login</a></li>
<li><a href="register.php">register</a></li>
</ul>
</li>
</ul>
</nav>
<div class="icons">
<div id="menu-btn" class="fas fa-bars"></div>
<a href="search_page.php" class="fas fa-search"></a>
<div id="user-btn" class="fas fa-user"></div>
<?php
$select_wishlist_count = mysqli_query($conn, "SELECT * FROM `wishlist` WHERE user_id = '$user_id'") or die('query failed');
$wishlist_num_rows = mysqli_num_rows($select_wishlist_count);
?>
<a href="wishlist.php"><i class="fas fa-heart"></i><span>(<?php echo $wishlist_num_rows; ?>)</span></a>
<?php
$select_cart_count = mysqli_query($conn, "SELECT * FROM `cart` WHERE user_id = '$user_id'") or die('query failed');
$cart_num_rows = mysqli_num_rows($select_cart_count);
?>
<a href="cart.php"><i class="fas fa-shopping-cart"></i><span>(<?php echo $cart_num_rows; ?>)</span></a>
</div>
<div class="account-box">
<p>username : <span><?php echo $_SESSION['user_name']; ?></span></p>
<p>email : <span><?php echo $_SESSION['user_email']; ?></span></p>
<a href="logout.php" class="delete-btn">logout</a>
</div>
</div>
</header>