-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproducts.php
More file actions
274 lines (270 loc) · 10.1 KB
/
products.php
File metadata and controls
274 lines (270 loc) · 10.1 KB
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
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Sabka Dukan</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- Custom Theme files -->
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/menu.css" rel="stylesheet" type="text/css" media="all" /> <!-- menu style -->
<link href="css/animate.min.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/owl.carousel.css" rel="stylesheet" type="text/css" media="all"> <!-- carousel slider -->
<!-- //Custom Theme files -->
<!-- font-awesome icons -->
<link href="css/font-awesome.css" rel="stylesheet">
<!-- //font-awesome icons -->
<!-- js -->
<script src="js/jquery-2.2.3.min.js"></script>
<script src="js/owl.carousel.js"></script>
<!-- //js -->
<!-- web-fonts -->
<link href='//fonts.googleapis.com/css?family=Roboto+Condensed:400,300,300italic,400italic,700,700italic' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Lovers+Quarrel' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Offside' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Tangerine:400,700' rel='stylesheet' type='text/css'>
<!-- web-fonts -->
<!-- scroll to fixed-->
<script src="js/jquery-scrolltofixed-min.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
// Dock the header to the top of the window when scrolled past the banner. This is the default behaviour.
$('.header-two').scrollToFixed();
// previous summary up the page.
var summaries = $('.summary');
summaries.each(function(i) {
var summary = $(summaries[i]);
var next = summaries[i + 1];
summary.scrollToFixed({
marginTop: $('.header-two').outerHeight(true) + 10,
zIndex: 999
});
});
});
</script>
<!-- //scroll to fixed-->
<!-- start-smooth-scrolling -->
<script type="text/javascript" src="js/move-top.js"></script>
<script type="text/javascript" src="js/easing.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".scroll").click(function(event){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
});
});
</script>
<!-- //end-smooth-scrolling -->
<!-- //smooth-scrolling-of-move-up -->
<!-- the jScrollPane script -->
<script type="text/javascript" src="js/jquery.jscrollpane.min.js"></script>
<script type="text/javascript" id="sourcecode">
$(function()
{
$('.scroll-pane').jScrollPane();
});
</script>
<!-- //the jScrollPane script -->
<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
<!-- the mousewheel plugin -->
</head>
<body>
<!-- header -->
<div class="header">
<div class="w3ls-header"><!--header-one-->
<div class="w3ls-header-right">
<ul>
<?php if(isset($_SESSION['id'])){ ?>
<li class="dropdown head-dpdn">
<a href="customer/dashboard.php" class="dropdown-toggle">Dashboard</a>
</li>
<li class="dropdown head-dpdn">
<form action="auth/signout.php" method="post">
<button class="dropdown-toggle" style="background-color: Transparent;background-repeat:no-repeat; border: none; cursor:pointer; overflow: hidden; outline:none; color:white">Sign Out</button>
</form>
</li>
<?php } else { ?>
<li class="dropdown head-dpdn">
<a href="auth/login.php" class="dropdown-toggle">Login</a>
</li>
<li class="dropdown head-dpdn">
<a href="auth/signup.php" class="dropdown-toggle">Sign Up</a>
</li>
<?php }; ?>
</ul>
</div>
<div class="clearfix"> </div>
</div>
</div>
<!-- //header -->
<!-- PHP -->
<?php
include "connect_no_red.php";
$product_id = $_GET['type'];
$view_sql = "CREATE OR REPLACE VIEW product_cumulative AS SELECT product.CategoryID as CategoryID, product.lg_Desp as lg_Desp, product.Sub_Cat as Sub_Cat, product.Picture as Picture, product.PName as PName, product.ProductID as ProductID, product.sm_Desp as sm_Desp, product.Cost as Cost, MAX(seller_prod.Discount) as Discount, COUNT(seller_prod.SellerID) as No_of_Seller, AVG(rating.value) as Rating
FROM product
LEFT JOIN seller_prod ON product.ProductID = seller_prod.ProductID
LEFT JOIN rating ON rating.ProductID = product.ProductID
GROUP BY product.ProductID;";
$conn->query($view_sql);
$sql = "SELECT * FROM product_cumulative WHERE Sub_Cat = ".$product_id." ORDER BY Rating ;";
$sql2 = "SELECT Sub_Name FROM ".$product_sub_cat." WHERE Sub_Cat = ".$product_id.";";
$re_result = $conn->query($sql);
$result = $conn->query($sql2);
$row_p = $result->fetch_assoc();
$page_ref = $row_p['Sub_Name'];
?>
<!-- products -->
<div class="products">
<div class="container">
<div class="header-logo">
<h1><a href="."><span>S</span>abka <i>Dukan</i></a></h1>
</div>
<div class="col-md-12 product-w3ls-right">
<!-- breadcrumbs -->
<ol class="breadcrumb breadcrumb1">
<li><a href=".">Home</a></li>
<li class="active"><?php echo $page_ref ?></li>
</ol>
<div class="clearfix"> </div>
<div class="products-row">
<?php
while($row = $re_result->fetch_assoc()){
?>
<div class="col-md-4 product-grids">
<div class="agile-products">
<!-- <div class="new-tag"><h6>New</h6></div> -->
<div style="min-height:200px"><a href="<?php echo 'single.php?id='.$row['ProductID'] ?>"><img src="<?php echo "images/".$row['Picture'] ?>" class="img-responsive" alt="img"></a></div>
<div class="agile-product-text">
<h5><a href="single.php"><?php echo $row["PName"] ?></a></h5>
<h6><del>$<?php echo intval($row["Cost"]*100)/100 ?></del> $<?php echo intval(($row["Cost"]- ($row["Cost"]*$row["Discount"])/100)*100)/100 ?></h6>
</div>
</div>
</div>
<?php
};
?>
<div class="clearfix"> </div>
</div>
<!-- add-products -->
<div class="w3ls-add-grids w3agile-add-products">
<a href="#">
<h4>TOP 10 TRENDS FOR YOU FLAT <span>20%</span> OFF</h4>
<h6>Shop now <i class="fa fa-arrow-circle-right" aria-hidden="true"></i></h6>
</a>
</div>
<!-- //add-products -->
</div>
</div>
</div>
<!--//products-->
<!-- footer-top -->
<div class="w3agile-ftr-top">
<div class="container">
<div class="ftr-toprow">
<div class="col-md-4 ftr-top-grids">
<div class="ftr-top-left">
<i class="fa fa-truck" aria-hidden="true"></i>
</div>
<div class="ftr-top-right">
<h4>FREE DELIVERY</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce tempus justo ac </p>
</div>
<div class="clearfix"> </div>
</div>
<div class="col-md-4 ftr-top-grids">
<div class="ftr-top-left">
<i class="fa fa-user" aria-hidden="true"></i>
</div>
<div class="ftr-top-right">
<h4>CUSTOMER CARE</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce tempus justo ac </p>
</div>
<div class="clearfix"> </div>
</div>
<div class="col-md-4 ftr-top-grids">
<div class="ftr-top-left">
<i class="fa fa-thumbs-o-up" aria-hidden="true"></i>
</div>
<div class="ftr-top-right">
<h4>GOOD QUALITY</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce tempus justo ac </p>
</div>
<div class="clearfix"> </div>
</div>
<div class="clearfix"> </div>
</div>
</div>
</div>
<!-- //footer-top -->
<!-- subscribe -->
<div class="subscribe">
<div class="container">
<div class="col-md-6 social-icons w3-agile-icons">
<h4>Keep in touch</h4>
<ul>
<li><a href="#" class="fa fa-facebook icon facebook"> </a></li>
<li><a href="#" class="fa fa-twitter icon twitter"> </a></li>
<li><a href="#" class="fa fa-google-plus icon googleplus"> </a></li>
<li><a href="#" class="fa fa-dribbble icon dribbble"> </a></li>
<li><a href="#" class="fa fa-rss icon rss"> </a></li>
</ul>
<ul class="apps">
<li><h4>Download Our app : </h4> </li>
<li><a href="#" class="fa fa-apple"></a></li>
<li><a href="#" class="fa fa-windows"></a></li>
<li><a href="#" class="fa fa-android"></a></li>
</ul>
</div>
<div class="col-md-6 subscribe-right">
<div class="clearfix"> </div>
</div>
<div class="clearfix"> </div>
</div>
</div>
<!-- //subscribe -->
<!-- footer -->
<div class="footer">
<div class="container">
<div class="footer-info w3-agileits-info">
<div class="col-md-4 address-left agileinfo">
<div class="footer-logo header-logo">
<h2><a href="."><span>S</span>mart <i>Dukan</i></a></h2>
<h6>Your stores. Your place.</h6>
</div>
<ul>
<li><i class="fa fa-map-marker"></i> IIT Mandi, Kamand, Himachal Pradesh</li>
<li><i class="fa fa-mobile"></i> 7355414418 </li>
<li><i class="fa fa-phone"></i> +917355414418 </li>
<li><i class="fa fa-envelope"></i> <a href="mailto:example@mail.com"> mail@example.com</a></li>
</ul>
</div>
<div class="col-md-8 address-right" style="height: 170px">
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
<!-- //footer -->
<div class="copy-right">
<div class="container">
<p>©2019 Sabka Dukan . All rights reserved</a></p>
</div>
</div>
<!-- menu js aim -->
<script src="js/jquery.menu-aim.js"> </script>
<script src="js/main.js"></script> <!-- Resource jQuery -->
<!-- //menu js aim -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/bootstrap.js"></script>
</body>
</html>