-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbody.php
449 lines (443 loc) · 22.2 KB
/
body.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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
<?php
if (!isset($_SESSION))
{
session_start();
}
date_default_timezone_set("Asia/Colombo");
include "config.php";
if(isset($_SESSION["login_usertype"]))
{//some one is logon
$system_usertype=$_SESSION["login_usertype"];
$system_username=$_SESSION["login_username"];
$system_userid=$_SESSION["login_userid"];
}
else
{//guest
$system_usertype="Guest";
}
?>
<!-- feature_part start-->
<!--
<section class="feature_part padding_top">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-8">
<div class="section_tittle text-center">
<h2>Featured Category</h2>
</div>
</div>
</div>
<div class="row align-items-center justify-content-between">
<div class="col-lg-7 col-sm-6">
<div class="single_feature_post_text">
<p>Premium Quality</p>
<h3>Latest foam Sofa</h3>
<a href="#" class="feature_btn">EXPLORE NOW <i class="fas fa-play"></i></a>
<img src="img/feature/feature_1.png" alt="">
</div>
</div>
<div class="col-lg-5 col-sm-6">
<div class="single_feature_post_text">
<p>Premium Quality</p>
<h3>Latest foam Sofa</h3>
<a href="#" class="feature_btn">EXPLORE NOW <i class="fas fa-play"></i></a>
<img src="img/feature/feature_2.png" alt="">
</div>
</div>
<div class="col-lg-5 col-sm-6">
<div class="single_feature_post_text">
<p>Premium Quality</p>
<h3>Latest foam Sofa</h3>
<a href="#" class="feature_btn">EXPLORE NOW <i class="fas fa-play"></i></a>
<img src="img/feature/feature_3.png" alt="">
</div>
</div>
<div class="col-lg-7 col-sm-6">
<div class="single_feature_post_text">
<p>Premium Quality</p>
<h3>Latest foam Sofa</h3>
<a href="#" class="feature_btn">EXPLORE NOW <i class="fas fa-play"></i></a>
<img src="img/feature/feature_4.png" alt="">
</div>
</div>
</div>
</div>
</section>-->
<!-- upcoming_event part start-->
<!-- product_list start-->
<!--
<section class="product_list section_padding">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-12">
<div class="section_tittle text-center">
<h2>awesome <span>shop</span></h2>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="product_list_slider owl-carousel">
<div class="single_product_list_slider">
<div class="row align-items-center justify-content-between">
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_1.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_2.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_3.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_4.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_5.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_6.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_7.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_8.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="single_product_list_slider">
<div class="row align-items-center justify-content-between">
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_1.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_2.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_3.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_4.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_5.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_6.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_7.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div class="single_product_item">
<img src="img/product/product_8.png" alt="">
<div class="single_product_text">
<h4>Quartz Belt Watch</h4>
<h3>$150.00</h3>
<a href="#" class="add_cart">+ add to cart<i class="fa fa-eye"></i></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>-->
<!-- product_list part start-->
<!-- awesome_shop start-->
<!--
<section class="our_offer section_padding">
<div class="container">
<div class="row align-items-center justify-content-between">
<div class="col-lg-6 col-md-6">
<div class="offer_img">
<img src="img/offer_img.png" alt="">
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="offer_text">
<h2>Weekly Sale on
60% Off All Products</h2>
<div class="date_countdown">
<div id="timer">
<div id="days" class="date"></div>
<div id="hours" class="date"></div>
<div id="minutes" class="date"></div>
<div id="seconds" class="date"></div>
</div>
</div>
<div class="input-group">
<input type="text" class="form-control" placeholder="enter email address"
aria-label="Recipient's username" aria-describedby="basic-addon2">
<div class="input-group-append">
<a href="#" class="input-group-text btn_2" id="basic-addon2">book now</a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>-->
<!-- awesome_shop part start-->
<!-- product_list part start-->
<section class="product_list best_seller section_padding">
<div class="container">
<?php
$sqlcategory="SELECT category_id,category_name FROM category";
$resultcategory=mysqli_query($con,$sqlcategory) or die ("Error in sqlcategory" . mysqli_error($con));
while($rowcategory=mysqli_fetch_assoc($resultcategory))
{
?>
<div class="row justify-content-center">
<div class="col-lg-12">
<div class="section_tittle text-center">
<h2><?php echo $rowcategory["category_name"]; ?></h2><!--for display category name in index-->
</div>
</div>
</div>
<div class="row align-items-center justify-content-between">
<div class="col-lg-12">
<div class="best_product_slider owl-carousel">
<?php
$x=1;
$sqlsubcategory="SELECT * FROM subcategory WHERE category_id='$rowcategory[category_id]'";
$resultsubcategory=mysqli_query($con,$sqlsubcategory) or die ("Error in $sqlsubcategory" . mysqli_error($con));
while($rowsubcategory=mysqli_fetch_assoc($resultsubcategory))
{
$sqlproduct="SELECT * FROM product WHERE subcategory_id='$rowsubcategory[subcategory_id]'";
$resultproduct=mysqli_query($con,$sqlproduct) or die ("Error in sqlproduct" . mysqli_error($con));
while($rowproduct=mysqli_fetch_assoc($resultproduct))
{
$sqlproductprice="SELECT price,offer FROM product_price WHERE product_id='$rowproduct[product_id]' AND end_date IS NULL";//for products which are still on sale
$resultproductprice=mysqli_query($con,$sqlproductprice) or die ("Error in sqlproductprice" . mysqli_error($con));
if(mysqli_num_rows($resultproductprice)>0)
{
$rowproductprice=mysqli_fetch_assoc($resultproductprice);
$price=$rowproductprice["price"];
$offer=$rowproductprice["offer"];
if($offer>0)//products which are applicable for offer
{
$unitprice=$price-(($price*$offer)/100);
$displayprice='<h3>LKR '.$unitprice.' <del>LKR '.$price.'</del></h3>';
//for current price(after the offer is applied ($unitprice)) and strikethrough/cut for old price
}
else
{
$unitprice=$price;
$displayprice='<h3>LKR '.$unitprice.'</h3>';//for current price(after the offer is applied)
}
$sqlproductimage="SELECT image FROM product_image WHERE product_id='$rowproduct[product_id]'";//for display product image in index
$resultproductimage=mysqli_query($con,$sqlproductimage) or die ("Error in sqlproductimage" . mysqli_error($con));
$rowproductimage=mysqli_fetch_assoc($resultproductimage);
?>
<div class="single_product_item">
<img src="file/product/<?php echo $rowproductimage['image'];?>" alt="">
<div class="single_product_text">
<h4><?php echo $rowproduct['name']; ?></h4>
<?php echo $displayprice; ?>
<a href="index.php?pg=single_product.php&productid=<?php echo $rowproduct['product_id']; ?>" class="add_cart">View More<i class="fa fa-eye"></i></a>
</div>
</div>
<?php
$x++;
if($x>4)
{
break 2;
}
}
}
}
?>
</div>
</div>
</div>
<p align="right"><b><span><?php echo '<a href="index.php?pg=public_product.php&categoryid='.$rowcategory["category_id"].'">More Products</a>'; ?></span></b></p>
<br><br>
<?php
}
?>
</div>
</section>
<!-- product_list part end-->
<!-- subscribe_area part start-->
<section class="subscribe_area section_padding">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-7">
<div class="subscribe_area_text text-center">
<h5>Join Our DECO NEEDS (PVT) LTD</h5>
<?php
if($system_usertype=="Guest")
{
?>
<h3>Register to get order with US</h3>
<center>
<a href="index.php?pg=register_customer.php" class="input-group-text btn_2" id="basic-addon2">Register Now</a>
</center>
<?php
}
else
{
?>
<h3>Make an order</h3>
<center>
<a href="index.php?pg=order_product.php&option=add" class="input-group-text btn_2" id="basic-addon2">Order Now</a>
</center>
<?php
}
?>
</div>
</div>
</div>
</div>
</section>
<!--::subscribe_area part end::-->
<!-- subscribe_area part start-->
<!--
<section class="client_logo padding_top">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-12">
<div class="single_client_logo">
<img src="img/client_logo/client_logo_1.png" alt="">
</div>
<div class="single_client_logo">
<img src="img/client_logo/client_logo_2.png" alt="">
</div>
<div class="single_client_logo">
<img src="img/client_logo/client_logo_3.png" alt="">
</div>
<div class="single_client_logo">
<img src="img/client_logo/client_logo_4.png" alt="">
</div>
<div class="single_client_logo">
<img src="img/client_logo/client_logo_5.png" alt="">
</div>
<div class="single_client_logo">
<img src="img/client_logo/client_logo_3.png" alt="">
</div>
<div class="single_client_logo">
<img src="img/client_logo/client_logo_1.png" alt="">
</div>
<div class="single_client_logo">
<img src="img/client_logo/client_logo_2.png" alt="">
</div>
<div class="single_client_logo">
<img src="img/client_logo/client_logo_3.png" alt="">
</div>
<div class="single_client_logo">
<img src="img/client_logo/client_logo_4.png" alt="">
</div>
</div>
</div>
</div>
</section>-->
<!--::subscribe_area part end::-->