-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
354 lines (303 loc) · 15.4 KB
/
index.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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
<?php
include_once "template/header.php";
include_once "admin/system/function.php";
include_once "system/function.php";
$sql = "SELECT items.*, brand.name as bn FROM items INNER JOIN brand ON brand.id=items.brand_id";
$items = itemsAll($sql);
//for discount item
$sql="SELECT items.*, brand.name as bn FROM items INNER JOIN brand ON brand.id=items.brand_id WHERE discount != '' order by rand() LIMIT 8";
$discountitems = itemsAll($sql);
$sql = "SELECT * FROM subcategories";
$subcategories = getItems($sql);
// var_dump($subcategories);
$sql = "SELECT * FROM brand";
$brands = getItems($sql);
$sql = "SELECT * from items LEFT JOIN brand ON items.brand_id = brand.id";
$statement=$connect->prepare($sql);
$statement->execute();
$itembrand=$statement->fetch();
// foreach($itembrand as $brand){
// $brand_name = $brand['name'];
// var_dump($brand_name);
// }
?>
<!-- slider -->
<div class="slider mb-5">
<div id="carouselExampleFade" class="carousel slide carousel-fade" data-bs-ride="carousel">
<div class="carousel-inner ban-parent">
<div class="carousel-item active">
<img src="assets/frontend/img/slider/slide1.png" class="d-block w-100" alt="slider image">
</div>
<div class="carousel-item">
<img src="assets/frontend/img/slider/slide2.png" class="d-block w-100" alt="slider image">
</div>
<div class="carousel-item">
<img src="assets/frontend/img/slider/slide3.png" class="d-block w-100" alt="slider image">
</div>
<div class="carousel-item">
<img src="assets/frontend/img/slider/slide4.png" class="d-block w-100" alt="slider image">
</div>
<div class="ban-child">
<div class="ban-inner">
<div class="ban-title animate__animated animate__fadeInDown">
<h1>One Mart Online Shop</h1>
</div>
<div class="ban-content">
<p class="animate__animated animate__slideInLeft">Just For You.</p>
<p class="animate__animated animate__slideInRight">Make your enjoy shopping</p>
</div>
<div class="ban-btn animate__animated animate__slideInUp">
<a href="products.php">Shop Now</a>
</div>
</div>
</div>
</div>
<button class="carousel-control-prev slider-btn" type="button" data-bs-target="#carouselExampleFade" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next slider-btn" type="button" data-bs-target="#carouselExampleFade" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</div>
<!-- Product -->
<div class="product pt-5 pb-5">
<div class="container-sm">
<div class="row">
<h3 class="title text-center">Deals Of The Day</h3>
<!-- <div class="line"></div> -->
</div>
<div class="row mb-3 card-slide">
<?php foreach($items as $item){
$ai_id=$item['id'];
$ai_codeno=$item['codeno'];
$ai_name=$item['name'];
$ai_photo=$item['photo'];
$ai_price=$item['price'];
$ai_discount=$item['discount'];
$ai_description=$item['description'];
$brand_id=$item['brand_id'];
$brand_name=$item['bn'];
?>
<div class="col-md-4 col-lg-2 my-3">
<div class="card">
<div class="buy">
<button type="button" title="Add to wishlist">
<i class="far fa-heart"></i>
</button>
</div>
<a href="product_details.php?id=<?= $ai_id?>" class="img-frame" type="button">
<img src="admin/uploads/<?= $ai_photo ?>" class="card-img p-3" height=160 alt="...">
</a>
<div class="card-body p-card-body">
<h5 class="card-title"><?= $ai_name ?><a href="brand.php?bid=<?= $brand_id ?>" class="badge bg-info logo-brand"><?php echo $brand_name; ?></a></h5>
<p class="card-text"><?= substr($ai_description, 0, 50) ?> <a href="#" class="view_btn" data-id="<?= $ai_id ?>" data-name="<?= $ai_name ?>" data-photo="<?= $ai_photo ?>" data-description="<?= $ai_description ?>"
data-price="<?= $ai_price ?>" data-discount="<?= $ai_discount ?>" data-photo="<?= $ai_photo ?>" data-codeno="<?= $ai_codeno ?>" data-bs-toggle="modal" data-bs-target="#cartModal">more...</a></p>
<div class="price">
<?php if($ai_discount) {?>
<span class="current_price"><?= $ai_discount ?> MMK</span><br>
<span class="old_price"><del><?= $ai_price ?> MMK</del></span>
<?php }else{?>
<span class="current_price"><?= $ai_price ?> MMK</span><br>
<?php } ?>
</div>
</div>
<div class="order_btn">
<button class="btn btn-danger btn-sm cart_btn addtocart" data-id="<?= $ai_id ?>" data-name="<?= $ai_name ?>" data-price="<?= $ai_price ?>" data-discount="<?= $ai_discount ?>" data-photo="<?= $ai_photo ?>" data-codeno="<?= $ai_codeno ?>" data-brand="<?= $brand_name ?>"><i class="fa fa-cart-arrow-down"></i></button>
<button class="btn btn-primary btn-sm cart_btn view_btn" data-id="<?= $ai_id ?>" data-name="<?= $ai_name ?>" data-photo="<?= $ai_photo ?>" data-description="<?= $ai_description ?>" data-price="<?= $ai_price ?>" data-discount="<?= $ai_discount ?>" data-photo="<?= $ai_photo ?>" data-codeno="<?= $ai_codeno ?>" data-brand="<?= $brand_name ?>" data-bs-toggle="modal" data-bs-target="#cartModal"><i class="fas fa-eye"></i></button>
</div>
</div>
</div>
<?php } ?>
</div>
<!-- Pagination -->
<div class="loading">
<a href="products.php"><span>See More</span>
</a>
</div>
</div>
</div>
<!-- Discount Product -->
<div class="product pt-5 pb-3">
<div class="container-sm">
<div class="row">
<h3 class="title text-center">Discount Product</h3>
<!-- <div class="line"></div> -->
</div>
<div class="row mb-3 card-slide" id="">
<?php foreach($discountitems as $item){
$ai_id=$item['id'];
$ai_name=$item['name'];
$ai_photo=$item['photo'];
$ai_price=$item['price'];
$ai_discount=$item['discount'];
$ai_description=$item['description'];
$brand_id=$item['brand_id'];
$brand_name=$item['bn'];
?>
<div class="col-md-4 col-lg-2 my-3">
<div class="card">
<div class="buy">
<button type="button" title="Add to wishlist">
<i class="far fa-heart"></i>
</button>
</div>
<a href="product_details.php?id=<?= $ai_id?>" class="img-frame" type="button">
<img src="admin/uploads/<?= $ai_photo ?>" class="card-img p-3" height=160 alt="...">
</a>
<div class="card-body p-card-body">
<h5 class="card-title"><?= $ai_name ?><a href="brand.php?bid=<?= $brand_id ?>" class="badge bg-info logo-brand"><?php echo $brand_name; ?></a></h5>
<p class="card-text"><?= substr($ai_description,0, 50) ?> <a href="#" class="view_btn" data-id="<?= $ai_id ?>" data-name="<?= $ai_name ?>" data-photo="<?= $ai_photo ?>" data-description="<?= $ai_description ?>"
data-price="<?= $ai_price ?>" data-discount="<?= $ai_discount ?>" data-photo="<?= $ai_photo ?>" data-codeno="<?= $ai_codeno ?>" data-bs-toggle="modal" data-bs-target="#cartModal">more...</a></p>
<div class="price">
<?php if($ai_discount) {?>
<span class="current_price"><?= $ai_discount ?> MMK</span><br>
<span class="old_price"><del><?= $ai_price ?> MMK</del></span>
<?php }else{?>
<span class="current_price"><?= $ai_price ?> MMK</span><br>
<?php } ?>
</div>
</div>
<div class="order_btn">
<button class="btn btn-danger btn-sm cart_btn addtocart" data-id="<?= $ai_id ?>" data-name="<?= $ai_name ?>" data-price="<?= $ai_price ?>" data-discount="<?= $ai_discount ?>" data-photo="<?= $ai_photo ?>" data-codeno="<?= $ai_codeno ?>" data-brand="<?= $brand_name ?>"><i class="fa fa-cart-arrow-down"></i></button>
<!-- <a href="product_details.php?id=<?= $ai_id?>" type="button" class="btn btn-danger btn-sm cart_btn"><i class="fa fa-cart-arrow-down"></i></a> -->
<button class="btn btn-primary btn-sm cart_btn view_btn" data-id="<?= $ai_id ?>" data-name="<?= $ai_name ?>" data-photo="<?= $ai_photo ?>" data-description="<?= $ai_description ?>" data-price="<?= $ai_price ?>" data-discount="<?= $ai_discount ?>" data-photo="<?= $ai_photo ?>" data-codeno="<?= $ai_codeno ?>" data-brand="<?= $brand_name ?>" data-bs-toggle="modal" data-bs-target="#cartModal"><i class="fas fa-eye"></i></button>
</div>
</div>
</div>
<?php } ?>
</div>
<!-- Pagination -->
<div class="loading">
<a href="products.php"><span>See More</span>
</a>
</div>
</div>
</div>
<div class="latest pt-5 pb-3 mb-3">
<div class="container-sm">
<div class="row mb-3">
<h3 class="title text-center">New Arrivals</h3>
</div>
<nav class="d-flex align-items-center justify-content-center mt-5">
<div class="nav nav-tabs my-tabs" id="nav-tab" role="tablist">
<button class="latestBtn my-btn" id="nav-home-tab" data-bs-toggle="tab" data-bs-target="#nav-home" type="button" role="tab" aria-controls="nav-home" aria-selected="true">Electrionic Devices</button>
<button class="latestBtn my-btn" id="nav-profile-tab" data-bs-toggle="tab" data-bs-target="#nav-profile" type="button" role="tab" aria-controls="nav-profile" aria-selected="false">Fashion</button>
</div>
</nav>
<div class="custom-content tab-content custom-tab my-content" id="nav-tabContent">
<div class="tab-pane active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab">
<div class="late-card">
<div class="circle"></div>
<div class="late-content">
<h2>Apple Watch</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Nihil minus beatae iusto saepe dolores harum odit similique, vero at natus perferendis alias</p>
<a href="#">Buy Now</a>
</div>
<img src="assets/frontend/img/product/shoe4.png" alt="">
</div>
</div>
<div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab">
<div class="late-card">
<div class="circle"></div>
<div class="late-content">
<h2>T-shirt</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Nihil minus beatae iusto saepe dolores harum odit similique, vero at natus perferendis alias</p>
<a href="#">Buy Now</a>
</div>
<img src="assets/frontend/img/product/shirt3.png" alt="">
</div>
</div>
</div>
</div>
</div>
</div>
<!-- product ad -->
<div class="product_ad pt-5">
<div class="container">
<div class="row">
<div class="ad-slide">
<div class="ad-img">
<img src="assets/frontend/img/promotion/fashion.jpg" alt="promotion">
</div>
<div class="ad-img">
<img src="assets/frontend/img/promotion/electronic.jpg" alt="promotion">
</div>
<div class="ad-img">
<img src="assets/frontend/img/promotion/fashion.jpg" alt="promotion">
</div>
<div class="ad-img">
<img src="assets/frontend/img/promotion/electronic.jpg" alt="promotion">
</div>
</div>
</div>
</div>
<!-- <div class="ad ad_three">
<img src="assets/frontend/img/promotion/weekly_promo.jpg" alt="promotion" width="100%" height="100%">
</div> -->
</div>
<!-- brand slide -->
<div class="brand pt-5">
<div class="container-fluid">
<div class="row">
<h3 class="title text-center mb-4">Top Brands</h3>
<div class="line"></div>
</div>
<div class="row mb-4">
<div class="brand-slide">
<?php foreach($brands as $brand){ ?>
<div class="brand-img">
<img src="admin/uploads/<?= $brand->photo ?>" alt="">
</div>
<?php }?>
</div>
</div>
</div>
</div>
<!-- View Cart Modal -->
<div class="modal fade" id="cartModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered my-model">
<div class="modal-content">
<div class="modal-header">
<!-- <h3 class="modal-title modal-codeno" id="exampleModalLabel"></h3> -->
<div class="logo">
<img src="" alt="">
</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" id="modal-div">
<div class="wrapper row">
<div class="preview col-lg-6">
<div class="image-box modal-photo"></div>
</div>
<div class="details col-lg-6">
<h3 class="product-title modal-name"></h3>
<div class="rating">
<div class="stars">
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star"></span>
<span class="fa fa-star"></span>
</div>
<span class="review-no">41 reviews</span>
</div>
<p class="product-description modal-description"></p>
<div class="price-tab"></div>
<div class="action mb-3">
<button type="button" id="addtocart" class="btn btn-primary add-to-cart addtocart"><i class="fas fa-cart-arrow-down"></i> add to cart</button>
<button type="button" id="buynow" class="btn btn-success add-to-cart buynow"><i class="fas fa-credit-card"></i> Buy now</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
include_once "template/footer.php";
?>