-
Notifications
You must be signed in to change notification settings - Fork 1
/
products-section.php
163 lines (121 loc) · 4.78 KB
/
products-section.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?php
if(basename($_SERVER['PHP_SELF']) == "products-section.php")
header("Location: error-pages/403.php");
?>
<?php
require_once("connection.php");
?>
<!-- PRODUCTS SECTION START -->
<section id="products-section" class="products-slider">
<div style="background-color: #f1f1f1; padding: 5px 0 15px 0;">
<!-- Today's Deal -->
<div class="container" id="todays-deal">
<h1 class="sub-heading">Today's Deal</h1>
<div class="owl-carousel owl-theme">
<?php
$query = "Select id, name, price, img_url from products WHERE id > 2 LIMIT 12";
$result = mysqli_query($connection, $query) or die("Query Failed");
while ($row = mysqli_fetch_array($result)) { ?>
<div class="item">
<a href="product-details.php?id=<?php echo $row['id']; ?>">
<img src="<?php echo $row['img_url']; ?>">
<h4 class="brand"><?php echo $row['name']; ?></h4>
<p class="price">₹<?php echo $row['price']; ?></p>
</a>
</div>
<?php } ?>
</div>
</div>
</div>
<!-- Mobiles -->
<div class="container" id="mobiles">
<h1 class="sub-heading">Latest Mobiles</h1>
<div class="owl-carousel owl-theme">
<?php
$query = "Select id, name, price, img_url from products where sub_cate_id = 1 ORDER BY id DESC";
$result = mysqli_query($connection, $query) or die("Query Failed");
while ($row = mysqli_fetch_array($result)) { ?>
<div class="item">
<a href="product-details.php?id=<?php echo $row['id']; ?>">
<img src="<?php echo $row['img_url']; ?>">
<h4 class="brand"> <?php echo $row['name']; ?> </h4>
<p class="price">₹ <?php echo $row['price']; ?></p>
</a>
</div>
<?php } ?>
</div>
</div>
<!-- Headphones -->
<div class="container" id="watches">
<h1 class="sub-heading">Best Headphones</h1>
<div class="owl-carousel owl-theme">
<?php
$query = "Select id,name, price, img_url from products Where sub_cate_id = 4 ORDER BY id DESC";
$result = mysqli_query($connection, $query) or die("Query Failed");
while ($row = mysqli_fetch_array($result)) { ?>
<div class="item">
<a href="product-details.php?id=<?php echo $row['id']; ?>">
<img src="<?php echo $row['img_url']; ?>">
<h4 class="brand"> <?php echo $row['name']; ?> </h4>
<p class="price">₹ <?php echo $row['price']; ?></p>
</a>
</div>
<?php } ?>
</div>
</div>
<!-- Watches -->
<div class="container" id="watches">
<h1 class="sub-heading">Best Watches</h1>
<div class="owl-carousel owl-theme">
<?php
$query = "Select id,name, price, img_url from products where sub_cate_id = 5 ORDER BY id DESC";
$result = mysqli_query($connection, $query) or die("Query Failed");
while ($row = mysqli_fetch_array($result)) { ?>
<div class="item">
<a href="product-details.php?id=<?php echo $row['id']; ?>">
<img src="<?php echo $row['img_url']; ?>">
<h4 class="brand"> <?php echo $row['name']; ?> </h4>
<p class="price">₹ <?php echo $row['price']; ?></p>
</a>
</div>
<?php } ?>
</div>
</div>
<!-- Refrigerator -->
<div class="container" id="refrigerator">
<h1 class="sub-heading">Best Refrigerator</h1>
<div class="owl-carousel owl-theme">
<?php
$query = "Select id, name, price, img_url from products where sub_cate_id = 9 ORDER BY id DESC";
$result = mysqli_query($connection, $query) or die("Query Failed");
while ($row = mysqli_fetch_array($result)) { ?>
<div class="item">
<a href="product-details.php?id=<?php echo $row['id']; ?>">
<img src="<?php echo $row['img_url']; ?>">
<h4 class="brand"> <?php echo $row['name']; ?> </h4>
<p class="price">₹ <?php echo $row['price']; ?></p>
</a>
</div>
<?php } ?>
</div>
</div>
<!-- Home & Kitchen -->
<div class="container">
<h1 class="sub-heading">Home & Kitchen</h1>
<div class="owl-carousel owl-theme">
<?php
$query = "Select id, name, price, img_url from products where sub_cate_id = 11 ORDER BY id DESC";
$result = mysqli_query($connection, $query) or die("Query Failed");
while ($row = mysqli_fetch_array($result)) { ?>
<div class="item">
<a href="product-details.php?id=<?php echo $row['id']; ?>">
<img src="<?php echo $row['img_url']; ?>">
<h4 class="brand"> <?php echo $row['name']; ?> </h4>
<p class="price">₹ <?php echo $row['price']; ?></p>
</a>
</div>
<?php } ?>
</div>
</div>
</section>
<!-- PRODUCTS SECTION END -->