-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeaturedproduct2.php
More file actions
210 lines (181 loc) · 5.24 KB
/
Copy pathfeaturedproduct2.php
File metadata and controls
210 lines (181 loc) · 5.24 KB
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<?php include('connection.php');
$sql = "SELECT * FROM `products`";
$result = mysqli_query($conn, $sql);
?>
<!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">
<title>Featured | Product</title>
<link rel="icon" href="webimage/shopicon.png" type="image/png">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">
<link rel="stylesheet" href="css/slick-theme.css">
<link rel="stylesheet" href="css/slick.css">
</head>
<body>
<div class="container">
<p class="featuredpro">Featured Products</p>
<hr>
<div class="responsive">
<?php
while ($data = mysqli_fetch_assoc($result)) {
$myimage = $data['image'];
?>
<!-- Our code will be here -->
<div class="carousel-item carousel">
<div class="img-fluid">
<img src="<?php echo 'images/' . $myimage; ?>" class="img-fluid w-100 p-4" alt="" srcset="" style="width: 300px; height: 300px;">
<h5 class="card-title text-center"><?php echo substr($data['product_name'], 0, 20); ?></h5>
<p class="card-text txt3 text-center">Price: <span style="font-size: 25px;font-weight:bold">৳</span><?php echo $data['price']; ?></p>
<div class="button">
<a href="productdetails.php?id=<?php echo $data['product_id']; ?>" class="btn btn-primary">Buy Now</a>
</div>
</div>
</div>
<?php
}
?>
</div>
<!-- Arrow Prev Next -->
<div class="arrow_prev" style="float: left;">
<span><i class="fa-solid fa-circle-chevron-left"></i></i></span>
</div>
<div class="arrow_next" style="float: right;">
<span> <i class="fa-solid fa-circle-chevron-right"></i></i></span>
</div>
</div>
<script src="js/bootstrap.min.js"></script>
<!-- Above the slick.. -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="js/slick.js"></script>
<script>
$('.responsive').slick({
prevArrow: '.arrow_prev',
nextArrow: '.arrow_next',
arrows: true,
speed: 500,
slidesToShow: 4,
slidesToScroll: 4,
responsive: [{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
dots: true
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
});
</script>
</body>
</html>
<!-- Stling the Caroseul -->
<style>
.carousel {
display: flex;
justify-content: center;
}
.featuredpro {
font-size: 50px;
text-align: center;
font-weight: 600;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
padding: 5px;
}
.button {
display: flex;
justify-content: center;
}
.arrow_prev {
position: absolute;
top: 240%;
left: 20px;
}
.arrow_next {
position: absolute;
top: 240%;
right: 20px;
}
.arrow_prev span,
.arrow_next span {
font-size: 55px;
color: red;
display: block;
width: 50px;
height: 50px;
text-align: center;
line-height: 50px;
}
/* For Responsive */
/* Large Devices Desktops */
@media (max-width: 1399.98px) {
.arrow_prev {
top: 270%;
}
.arrow_next {
top: 270%;
}
}
/* small desktop */
@media (max-width: 1199.98px) {
.arrow_prev {
top: 249%;
}
.arrow_next {
top: 249%;
}
}
/* For Tablet */
@media (max-width: 991.98px) {
.arrow_prev {
top: 285%;
}
.arrow_next {
top: 285%;
}
}
/* For Landscape */
@media (max-width: 767.98px) {
.arrow_prev {
top: 285%;
}
.arrow_next {
top: 285%;
}
}
/* Phone */
@media (max-width: 575.98px) {
.arrow_prev {
top: 295%;
}
.arrow_next {
top: 295%;
}
}
@media (max-width: 414.98px) {
.arrow_prev {
top: 285%;
}
.arrow_next {
top: 285%;
}
}
</style>