-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilter_prod_stock.php
168 lines (118 loc) · 6.28 KB
/
filter_prod_stock.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
<?php
Session_start();
?>
<!DOCTYPE html>
<head>
<title>Argjentina Bike Sklep</title>
<link rel="SHORTCUT ICON" href="images/favicon.png" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="eng-GB" />
<meta http-equiv="Cache-control" content="private" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="expires" content="-1" />
<meta name="robots" content="all" />
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
background-color: #101010;
}
.style2 {font-size: 12}
.style3 {
font-size: 10px;
font-style: italic;
}
-->
</style></head>
<body>
<!-- Banner settings -->
<center><table width="951" border="1">
<thead>
<tr>
<th height="202" colspan="2" rules="all" background="images/logo.png"></th>
</tr>
</thead>
<tfoot>
<tr>
<!-- Footer settings - Left side -->
<th height="100" colspan="2" background="images/footer.png" >
<div align="left"> <font color="white">Powered by</font> <font color="CornflowerBlue">R</font><font color="white">eday</font></a></div>
<div align="left"> <font color="white">Theme by</font> <font color="CornflowerBlue">J</font><font color="white">acek</font></a></div><br><br>
<!-- Footer settings - Right side -->
<div align="right"><a style="text-decoration:none;" href="backdoor.html"><font
color="CornflowerBlue">A</font><font color="white">dmin</font> <font color="CornflowerBlue">P</font><font color="white">anel</font></a>
</tr>
</tfoot>
<tbody>
<!-- Horizontal navigation - Left side -->
<tr>
<th height="30" colspan="1" background="images/nav_background.jpg">
<div align="left"><a style="text-decoration:none;" href="index.php"><font color="CornflowerBlue">H</font><font color="white">ome</font></a> -
<a style="text-decoration:none;" href="mailto:[email protected]"><font color="CornflowerBlue">C</font><font color="white">ontact</font></a> -
<a style="text-decoration:none;" href="Products.php"><font color="CornflowerBlue">P</font><font color="white">roducts <font color="CornflowerBlue">B</font>ikes</font></a> -
<!-- Horizontal navigation - Right side -->
<th><div align="center"><a style="text-decoration:none;" href="basket.html"><font color="CornflowerBlue">B</font><font color="white">asket</font></a> -
<a style="text-decoration:none;" href="login_register.html"><font color="CornflowerBlue">L</font><font color="white">ogin </font><font color="white">/ </font><font color="CornflowerBlue">R</font><font color="white">egister</font></a>
- <a style="text-decoration:none;" href="logout.php"><font color="CornflowerBlue">L</font><font color="white">ogout</font></a>
</div>
</th>
</tr>
<tr>
<!-- Body page -->
<td width="711" valign="top" style="background-color: #FFFFFF" >
<font size="+3"><center>
<strong><i>Products</i></strong>
</center></font><br>
</br>
</br>
<!-- Sorting Filter -->
<a href="filter_prod_price_decreasing.php">Click me to Filter Products by Price decreasing</a></br>
<a href="filter_prod_price_increasing.php">Click me to Filter Products by Price increasing</a></br>
<a href="filter_prod_stock.php">Click me to Filter Products by Stock</a></br>
<?php
//Connection to DB
$mongoClient = new MongoClient();
$db = $mongoClient->Products;
$collection = $db->catalog;
//Mongo DB Cursor obj
$mdbc = $db->catalog->find();
$mdbc->sort(array ('stock_count' => -1));
?>
<div align="left"><p style="padding: 10px;"><i><font size="+1"><b><span style="color: CornflowerBlue">Our bikes</span></b></font></i><br><br>
<!-- Product Loop Script Alpha -->
<?php
//starting loop
foreach($mdbc as $doc) {
?>
<!-- Generated Content using Jaceks Layout HTML-->
<strong><?php echo $doc['name'] ?></strong><br>
<img src="<?php echo $doc['image_url']?>" height="316" width="500"><br>
<strong>Stock: <?php echo $doc['stock_count']?></strong><br><br>
<strong>About this product</strong><p><?php echo $doc['description']?></p><br><br>
<strong>Delivery</strong> - Fast and Free<br><br>
<strong>Price</strong> - £<?php echo $doc['price'] ?><br><br>
<strong><select>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></strong>
<button type="button">Add to basket</button><br><br><br>
<?php
//Ending Loop
}
?>
<!-- Vertical Navigation -->
<td width="240" valign="top" background="images/nav_background.jpg">
<center>
<span style="color: CornflowerBlue"><b> ------</b></span> <span style="color: CornflowerBlue"><b>R</b></span><span style="color: white"><b>ecommended</b></span> <span style="color: CornflowerBlue"><b>B</b></span><span style="color: white"><b>ikes</b></span> <span style="color: CornflowerBlue"><b>------ </b></span><br><br>
<br>
<br>
</center>
</td>
</tr>
</tbody>
</table></center>
</body>
</html>