-
Notifications
You must be signed in to change notification settings - Fork 4
/
promotions.php
135 lines (116 loc) · 4.25 KB
/
promotions.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
<!DOCTYPE html>
<html>
<head>
<title>Yamaha</title>
<!-----------------CSS sheet----------------->
<link href="Resources/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-----------------Wrapper----------------->
<div id="wrapper">
<!-----------------Header & Navigation Bar----------------->
<?php include('header.php');
///////////////////////Display reviews///////////////////////
$select_highest = "SELECT * FROM `tblproducts` ORDER BY ProductDiscountAmount DESC LIMIT 5";
$result_select_highest = mysqli_query($con, $select_highest);
$select_all = "SELECT * FROM `tblproducts` WHERE ProductDiscountAmount > 0 ORDER BY ProductDiscountAmount DESC ";
$result_select_all = mysqli_query($con, $select_all);
?>
<!-----------------Main Frame----------------->
<div id="mainframe">
<div class="sub_framefullpage">
<!-----------------Products Frame----------------->
<h3>Promotions</h3>
<p><div class="row">
<div class="col_3">
<img src="Resources/designimages/promo1.jpg" style="width:100%">
</div>
<div class="col_3">
<img src="Resources/designimages/promo2.jpg" style="width:100%">
</div></p>
</div>
</div>
<!-----------------Latest Products----------------->
<div class="sub_framefullpage">
<h3>Highest Discounts Offered By Yamaha</h3>
<div class="productframe">
<?php
//Count number of rows
$no_of_rows=mysqli_num_rows($result_select_highest);
if($no_of_rows>0)
{
///////////Fetch products from variavle and display
while($data = mysqli_fetch_array($result_select_highest))
{
?>
<div class="product" style="width:23%;">
<?php if ($data['ProductDiscountAmount']!="0"){ ?>
<span class="product-discount-label">-<?php echo $data['ProductDiscountAmount'];?> %</span>
<?php } else {?> <span class="product-discount-label" style="background-color:#FFF; color:#FFF">-<?php echo $data['ProductDiscountAmount'];?> %</span>
<?php } ?>
<img src="<?php echo $data['ProductImage']; ?>" >
<br>
<br>
<div class="product_name">
<?php echo $data['ProductName']; ?>
</div>
<div class="product_price">
LKR:<?php echo $data['ProductPrice']; ?>
</div>
<a href="viewproduct.php?pid=<?php echo $data['ProductID']; ?>"><input name="" type="button" value="See Details"></a>
</form>
</div>
<?php } } else {?>
<h3>Oops! No Products Found!</h3>
<?php } ?>
</div>
</div>
<p><div class="row">
<div class="col_3">
<img src="Resources/designimages/promo3.jpg" style="width:100%">
</div>
<div class="col_3">
<img src="Resources/designimages/promo4.jpg" style="width:100%">
</div></p>
<!-----------------Recently Reviewed Products----------------->
<div class="sub_framefullpage">
<h3>All Discounted Products</h3>
<div class="productframe">
<?php
//Count number of rows
$no_of_rows=mysqli_num_rows($result_select_all);
if($no_of_rows>0)
{
///////////Fetch products from variavle and display
while($data = mysqli_fetch_array($result_select_all))
{
?>
<div class="product" style=" width:23%">
<?php if ($data['ProductDiscountAmount']!="0"){ ?>
<span class="product-discount-label">-<?php echo $data['ProductDiscountAmount'];?> %</span>
<?php } else {?> <span class="product-discount-label" style="background-color:#FFF; color:#FFF">-<?php echo $data['ProductDiscountAmount'];?> %</span>
<?php } ?>
<img src="<?php echo $data['ProductImage']; ?>" >
<br>
<br>
<div class="product_name">
<?php echo $data['ProductName']; ?>
</div>
<div class="product_price">
LKR:<?php echo $data['ProductPrice']; ?>
</div>
<a href="viewproduct.php?pid=<?php echo $data['ProductID']; ?>"><input name="" type="button" value="See Details"></a>
</form>
</div>
<?php } } else {?>
<h3>Oops! No Products Found!</h3>
<?php } ?>
</div>
</div>
<div class="clear"></div>
<!-----------------Footer----------------->
<?php include('Resources/footer.php');?>
</div>
</div>
</body>
</html>