-
Notifications
You must be signed in to change notification settings - Fork 4
/
pnb.php
173 lines (169 loc) · 6.56 KB
/
pnb.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
<!DOCTYPE html>
<html>
<head>
<title>Explorer Style</title>
<link href="Resources/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-----------------Wrapper----------------->
<div id="wrapper">
<!-----------------Header & Navigation Bar----------------->
<?php include('header.php');?>
<!-----------------Side Bar----------------->
<div class="sidebar">
<div class="col_1">
<!-----------------Search Products----------------->
<h2>Search Products</h2>
<div class="box">
<ul>
<form method="post">
<li><input type="text" name="searchproduct" required></li>
<li><input id="5" type="submit" name="search" value="Search"></li>
</form>
</ul>
</div>
<!-----------------Display Category And Filter By Category----------------->
<h2>Categories</h2>
<div class="box">
<ul>
<form action="" method="post">
<?php
//Count number of rows
$no_of_categories=mysqli_num_rows($result_select_category);
if($no_of_categories > 0)
{
///////////Fetch products from variavle and display
while($category = mysqli_fetch_array($result_select_category))
{
?>
<li><input id="<?php echo $category['CategoryName']; ?>" type="submit" name="categoryvalues[]" value="<?php echo $category['CategoryName']; ?>" class="category_btn"></li>
<?php } } else {?>
<h3>Oops! Category Unavailable!</h3>
<?php } ?>
</div>
</ul>
</div>
</div>
<!-----------------Main Frame----------------->
<div id="mainframe">
<div class="sub_frame">
<label class = "labelhome">Your Bike Type</label>
<?php
if(!isset($_SESSION['bikeselected']))
{
$_SESSION['bikeselected']='';
}
else
{
echo $_SESSION['bikeselected'];
}
?>
<?php if($_SESSION['bikeselected'] ==''){ ?>
<select name="selectproductbiketype" id="mySelect" style="width:75%">
<?php
//Count number of rows
$no_of_bikes=mysqli_num_rows($result_productbiketype);
if($no_of_bikes>0)
{
///////////Fetch products from variavle and display
while($bike_data = mysqli_fetch_array($result_productbiketype))
{
?>
<option value="<?php echo $bike_data['ProductBikeType']; ?>"><?php echo $bike_data['ProductBikeType']; ?></option>
<?php } } else {?>
<h3>Oops! No Bikes!</h3>
<?php } ?>
</select>
<input name="productbiketype" type="submit" value="Select" >
<?php } else {?>
<input name="productbiketypechange" type="submit" value="X">
<?php } ?>
<!-----------------Sorting Products Options----------------->
<h3><?php echo $CATEGORY; ?> <?php echo $MESSAGE; ?></h3>
<?php
//if category variable is empty dont display sort option
if($CATEGORY != '')
{
?>
<!-----------------Filter Products by bike----------------->
Sort By: <select name="sort" onChange="AutoClickCategory()">
<option value="ASC,ProductName">----</option>
<option value="ASC,ProductName">Product Name: A-Z</option>
<option value="DESC,ProductName">Product Name: Z-A</option>
<option value="ASC,ProductPrice">Price: Low to High</option>
<option value="DESC,ProductPrice">Price: High to Low</option>
</select>
<?php }?>
<br>
<br>
<!-----------------Display Products And View Products----------------->
<div class="productframe">
<?php
//Count number of rows
$no_of_rows=mysqli_num_rows($result_products);
if($no_of_rows>0)
{
///////////Fetch products from variavle and display
while($data = mysqli_fetch_array($result_products))
{
?>
<!-----------------Products----------------->
<div class="product">
<?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>
<!-----------------Products----------------->
<!-----------------Footer----------------->
<div class="footer">
<div class="col_2">
<h2>About Yamaha</h2>
<ul>
<li><a href="aboutus.php">About us</a></li>
<li><a href="aboutus.php">Privacy Policy</a></li>
<li><a href="aboutus.php">Terms of use</a></li>
</ul>
</div>
<div class="col_2">
<h2>Information</h2>
<ul>
<li><a href="aboutus.php">Help & FAQs</a></li>
<li><a href="aboutus.php">Shipping and delivery</a></li>
</ul>
</div>
<div class="col_2">
<h2>Contact Us</h2>
<ul>
<li>Hotline:</li>
<li>Email:</li>
<li>Services</li>
</ul>
</div>
</div>
</div>
</div>
<script>
function AutoClickCategory(){
document.getElementById('<?php echo $CATEGORY; ?>').click();
}
</script>
</body>
</html>