-
Notifications
You must be signed in to change notification settings - Fork 1
/
products.php
128 lines (108 loc) · 4.56 KB
/
products.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
require_once('private/initialize.php');
$product_set = find_all_product();
$layout = get_style_by_view(1);
$count = 0;
if (user_is_logged_in()) { // if user is logged in
$cart = get_cart_by_email($_SESSION["user_email"]);
// count item is shopping cart
foreach ($cart as $key => $value) {
$count++;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="Indoor plants, windsor, personal garden, zen garden, home decoration - plants">
<meta name="description" content="Windosr local indoor plants">
<meta name="author" content="SiChao Chen, Arthur Wei, Zaiqing Zhang, Zixun Wang">
<link rel="stylesheet" href="css/style.css">
<title>Shop</title>
<!-- load style from database -->
<style>
body {
background-color: <?php echo $layout["background_color"]; ?>;
}
.topnav {
background-color: <?php echo $layout["margin_color"]; ?>;
}
.topnav a {
color: <?php echo $layout["margin_text_color"]; ?>;
}
.container_footer {
background-color: <?php echo $layout["margin_color"]; ?>;
color: <?php echo $layout["margin_text_color"]; ?>;
}
.container_footer .footer_text {
color: <?php echo $layout["margin_text_color"]; ?>;
}
.copyright {
color: <?php echo $layout["margin_text_color"]; ?>;
}
</style>
</head>
<body>
<!-- Header -->
<header>
<div class="topnav" id="myTopnav">
<a href="index.php"><img src="images/logo.png" alt="logo" class="logo"></a>
<a href="index.php" class="htext htext2">Home</a>
<a href="products.php" class="htext">Shop</a>
<a href="account/account.php" class="htext">Account</a>
<a href="account/cart.php" class="htext"><?php if ($count != 0) {
echo "Cart•";
} else {
echo "Cart";
} ?></a>
<a href="javascript:void(0);" style="font-size:15px;" class="icon" onclick="header_menu()">☰</a>
<a href="contact.php" class="htext">Contact</a>
<a href="shipping-policy.php" class="htext_bottom">Shipping Policy</a>
<a href="privacy-policy.php" class="htext_bottom">Privacy Policy</a>
<a href="return-policy.php" class="htext_bottom">Return Policy</a>
</div>
</header>
<div class="center_block80">
<br>
<h1 class="page_title">Products</h1>
<hr>
<br><br><br>
<!-- Display all product -->
<?php while ($product = mysqli_fetch_assoc($product_set)) { ?>
<a style="color: #000000;" href="product.php<?php echo ('?id=' . h(u($product['product_id']))); ?>">
<div class="product_gallery">
<div class="card">
<img style="width:100%;" src="admin/product/images/<?php echo h($product['product_img']); ?>" alt="Image of Product">
<h1 style="margin-bottom: 0;"><?php echo h($product['product_name']); ?></h1>
<p class="price">$<?php echo h($product['product_price']); ?></p>
</div>
</div>
</a>
<?php } ?>
</div>
<div style="clear: both;"><br><br><br></div>
<footer>
<div class="container_footer">
<br>
<a href="index.php"><img src="images/logo.png" alt="logo" class="footer_logo"></a>
<div class="center">
<a href="contact.php" class="footer_text">Contact</a>
<a href="shipping-policy.php" class="footer_text">Shipping Policy</a>
<a href="privacy-policy.php" class="footer_text">Privacy Policy</a>
<a href="return-policy.php" class="footer_text">Return Policy</a>
<a href="terms-and-conditions.php" class="footer_text">Term and Conditions</a>
</div>
<p class="copyright">Copyright ©
<script>
document.write(new Date().getFullYear())
</script> WEB | All Rights Reserved
</p>
</div>
</footer>
<script src="js/script.js"></script>
</body>
</html>
<?php db_disconnect($db); ?>