-
Notifications
You must be signed in to change notification settings - Fork 2
/
header.php
59 lines (52 loc) · 1.83 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
<?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>
';
}
}
$user_id = NULL;
if(isset($_SESSION['user_id'])){
$user_id = $_SESSION['user_id'];
}
?>
<?php
$cart_rows_number = 0;
if($user_id !== NULL){
$select_cart_number = mysqli_query($conn, "SELECT * FROM `cart` WHERE user_id = '$user_id'") or die('query failed');
$cart_rows_number = mysqli_num_rows($select_cart_number);
}
?>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css" />
<link rel="stylesheet" href="usercss/home.css">
</head>
<header class="header">
<div class="header-1">
<a href="home.php" class="logo"><i class=" fas fa-book"></i> Book<span>Store</span></a>
<!-- <form action="" class="search-form">
<a href="search_page.php" class="fas fa-search"></a>
<label for="search-box" class="fas fa-search"></label>
</form> -->
<div class="icons">
<a href="search_page.php" class="fas fa-search"></a>
<a href="#" class="fas fa-heart"></a>
<a id="user-btn" href="userprofile.php" class="fas fa-user"></a>
<a href="cart.php" class="fas fa-shopping-cart cart">(<?php echo $cart_rows_number; ?>)</a>
</div>
</div>
<!-- navi -->
<div class="header-2">
<nav class="navbar">
<a href="home.php">Home</a>
<a href="feature.php">Featured</a>
<a href="shop.php">Shop</a>
<a href="latestproduct.php">latest product</a>
</nav>
</div>
</header>