-
Notifications
You must be signed in to change notification settings - Fork 0
/
items.php
496 lines (460 loc) · 24.3 KB
/
items.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
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>E-Commerce Landing Page</title>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/nprogress.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/animate.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" />
<link href='http://fonts.googleapis.com/css?family=Josefin+Slab:100,300,400,600|Lobster+Two|Arbutus+Slab|Rokkitt:400,700|Niconne|Droid+Sans|PT+Serif|Source+Sans+Pro:300,400' rel='stylesheet' type='text/css'>
<script src="jquery/lightbox.js"></script>
<script src="jquery/prefixfree.min.js"></script>
<script src="jquery/hoverIntent.minified.js"></script>
<script src="jquery/nprogress.js"></script>
<script src="jquery/wow.min.js"></script>
<script src="jquery/jquery-1.11.1.min.js"></script>
<script src="jquery/jquery-migrate-1.2.1.min.js"></script>
<script>
new WOW().init();
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">window.jQuery || document.write('<script type="text\/javascript" src="js\/1.7.2.jquery.min"><\/script>')</script>
</head>
<body>
<div class="header">
<div class="wrapper">
<div class="logo"></div>
<form class="search">
<input type="text" name="header_search" id="common_search-input" class="autosuggest" placeholder="Search">
<div class="dropdown">
<ul class="result"><ul>
</div>
</form>
<ul class="nav">
<li><a href="index.php">Home</a></li>
<li><a href="products.php">Categories</a></li>
<li>Shop</li>
<li><a href="contact.php">Contact</a></li>
</ul>
<ul class="log">
<li><a href="">Login</a></li>
<li><a href="">Sign up</a></li>
<?php
include 'cart.php';
?>
</ul>
</div>
</div>
<ul class="second">
<li><a href="items.php?<?php
$pass1='9777443097argha1';
$pass1=md5($pass1);
echo 'pass1='.$pass1;?>">Rosogolla</a></li>
<li><a href="items.php?<?php
$pass1='9777443097argha2';
$pass1=md5($pass1);
echo 'pass1='.$pass1;?>">Mishti Doi</a></li>
<li><a href="items.php?<?php
$pass1='9777443097argha3';
$pass1=md5($pass1);
echo 'pass1='.$pass1;?>">Sandesh</a></li>
<li><a href="items.php?<?php
$pass1='9777443097argha4';
$pass1=md5($pass1);
echo 'pass1='.$pass1;?>">Fried Misti</a></li>
<li><a href="items.php?<?php
$pass1='9777443097argha5';
$pass1=md5($pass1);
echo 'pass1='.$pass1;?>">Baked</a></li>
<li><a href="items.php?<?php
$pass1='9777443097argha6';
$pass1=md5($pass1);
echo 'pass1='.$pass1;?>">Son Papri</a></li>
<li><a href="items.php?<?php
$pass1='9777443097argha7';
$pass1=md5($pass1);
echo 'pass1='.$pass1;?>">More</a></li>
</ul>
<!-- ATTENTION: when creating the include files, header is till here-->
<div class="content dynamic">
<div class="wrapper">
<section class="shop">
<div class="title">
<h1><?php
include 'core/database/connect.php';
$heading=$_GET['pass1'];
if($heading!=' ')
{
$store=$heading;
}
if($heading===md5('9777443097argha1'))
{
echo 'Rosogolla';
$category='rosogolla';
}
else if($heading===md5('9777443097argha2'))
{
$category='mistidoi';
echo 'Mishti Doi';
}
else if($heading===md5('9777443097argha3'))
{
$category='sandesh';
echo 'Sandesh';
}
else if($heading===md5('9777443097argha4'))
{
$category='friedmisti';
echo 'Fried Misti';
}
else if($heading===md5('9777443097argha5'))
{
$category='baked';
echo 'Baked';
}
else if($heading===md5('9777443097argha6'))
{
$category='sonpapri';
echo 'Son Papri';
}
else if($heading===md5('9777443097argha7'))
{
$category='more';
echo 'More';
}
if($_SESSION['items'][100])
$query=mysql_query("select * from items where `category`='$category' AND rate1<100");
else if($_SESSION['items'][200])
$query=mysql_query("select * from items where `category`='$category' AND rate1<200");
else if($_SESSION['items'][300])
$query=mysql_query("select * from items where `category`='$category' AND rate1<300");
else if($_SESSION['items'][400])
$query=mysql_query("select * from items where `category`='$category' AND rate1<400");
else if($_SESSION['items'][500])
$query=mysql_query("select * from items where `category`='$category' AND rate1<500");
else if($_SESSION['items'][600])
$query=mysql_query("select * from items where `category`='$category' AND brand_name='kcdas'");
else if($_SESSION['items'][700])
$query=mysql_query("select * from items where `category`='$category' AND brand_name='nakur'");
else if($_SESSION['items'][800])
$query=mysql_query("select * from items where `category`='$category' AND brand_name='C'");
else if($_SESSION['items'][900])
$query=mysql_query("select * from items where `category`='$category' AND brand_name='D'");
else if($_SESSION['items'][5])
$query=mysql_query("select * from items where `category`='$category' AND stars=5");
else if($_SESSION['items'][4])
$query=mysql_query("select * from items where `category`='$category' AND stars=4");
else if($_SESSION['items'][3])
$query=mysql_query("select * from items where `category`='$category' AND stars=3");
else if($_SESSION['items'][2])
$query=mysql_query("select * from items where `category`='$category' AND stars=2");
else if($_SESSION['items'][1])
$query=mysql_query("select * from items where `category`='$category' AND stars=1");
else
$query=mysql_query("select * from items where `category`='$category'");
if($_GET['header_search'])
{
$heading=$store;
$search=$_GET['header_search'];
$query=mysql_query("select * from items where brand_name='$search'");
}
?></h1>
</div>
<div class="toolbar">
<div class="toggle">Hide Filters</div>
<div class="options">
<ul>
<li><a href="">Popular</a></li>
<li><a href="">Alphabetic</a></li>
<li><a href="">Offers</a></li>
</ul>
</div>
<div class="pages"></div>
</div>
<div class="main">
<section class="food">
<div class="grid">
<?php
while($row=mysql_fetch_assoc($query))
{
echo'<div class="p7">
<a href="details.php?pass1='.md5($row['category']).'&id='.$row['item_id'].'&i=d">
<img src="'.$row['image'].'"/></a>
<div class="desc">
<h4>'.$row['brand_name'].'</h4>
<h1>'.$row['product_name'].'</h1>
<h2>1kg @ Rs'.$row['rate1'].'</h2>
<a href="add_to_cart.php?pass1='.$heading.'&search='.$search.'&id='.$row['item_id'].'">Add</a>
</div>
</div> ';
}
?>
</div>
<div class="clearfix"></div>
</section>
<div class="filter">
<div class="categories">
<div class="fheader">
<h1>Categories</h1>
</div>
<ul class="level-1">
<li>
<a href="javascript:void(0);">Item 1</a>
<ul class="level-2">
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
<ul class="level-3">
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
</ul>
</li>
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
</ul>
</li>
<li>
<a href="javascript:void(0);">Item 1</a>
<ul class="level-2">
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
<ul class="level-3">
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
</ul>
</li>
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
</ul>
</li>
<li>
<a href="javascript:void(0);">Item 1</a>
<ul class="level-2">
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
<ul class="level-3">
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
</ul>
</li>
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
</ul>
</li>
<li>
<a href="javascript:void(0);">Item 1</a>
<ul class="level-2">
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
<ul class="level-3">
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
</ul>
</li>
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
<li>
<div class="arrow"></div>
<a href="javascript:void(0);">Item 1</a>
</li>
</ul>
</li>
</ul>
</div>
<div class="price">
<div class="fheader">
<h1>Price</h1>
</div>
<ul>
<li>
<input class="checkbox" type="checkbox"<?php if($_SESSION['items'][100])echo 'checked';?> name="<?php echo $heading;?>" id="fprice" value="100">
<label>Less than Rs 100</label>
</li>
<li>
<input class="checkbox" type="checkbox"<?php if($_SESSION['items'][200])echo 'checked';?> name="<?php echo $heading;?>" id="fprice" value="200">
<label>Less than Rs 200</label>
</li>
<li>
<input class="checkbox" type="checkbox"<?php if($_SESSION['items'][300])echo 'checked';?> name="<?php echo $heading;?>" id="fprice" value="300">
<label>Less than Rs 300</label>
</li>
<li>
<input class="checkbox" type="checkbox" <?php if($_SESSION['items'][400])echo 'checked';?>name="<?php echo $heading;?>" id="fprice" value="400">
<label>Less than Rs 400</label>
</li>
<li>
<input class="checkbox" type="checkbox" <?php if($_SESSION['items'][500])echo 'checked';?>name="<?php echo $heading;?>" id="fprice" value="500">
<label>Less than Rs 500</label>
</li>
</ul>
</div>
<div class="rate">
<div class="fheader">
<h1>Rating</h1>
</div>
<ul>
<li>
<input class="checkbox" <?php if($_SESSION['items'][5])echo 'checked';?> type="checkbox" name="<?php echo $heading;?>" id="fprice" value="5">
<label><span class="star-5 check">☆</span><span class="star-4 check">☆</span><span class="star-3 check">☆</span><span class="star-2 check">☆</span><span class="star-1 check">☆</span></label>
</li>
<li>
<input class="checkbox" <?php if($_SESSION['items'][4])echo 'checked';?> type="checkbox" name="<?php echo $heading;?>"id="fprice" value="4">
<label><span class="star-5 check">☆</span><span class="star-4 check">☆</span><span class="star-3 check">☆</span><span class="star-2 check">☆</span><span class="star-1">☆</span></label>
</li>
<li>
<input class="checkbox" <?php if($_SESSION['items'][3])echo 'checked';?> type="checkbox" name="<?php echo $heading;?>"id="fprice" value="3">
<label><span class="star-5 check">☆</span><span class="star-4 check">☆</span><span class="star-3 check">☆</span><span class="star-2">☆</span><span class="star-1">☆</span></label>
</li>
<li>
<input class="checkbox" <?php if($_SESSION['items'][2])echo 'checked';?> type="checkbox"name="<?php echo $heading;?>" id="fprice" value="2">
<label><span class="star-5 check">☆</span><span class="star-4 check">☆</span><span class="star-3">☆</span><span class="star-2">☆</span><span class="star-1">☆</span></label>
</li>
<li>
<input class="checkbox" <?php if($_SESSION['items'][1])echo 'checked';?> type="checkbox"name="<?php echo $heading;?>" id="fprice" value="1">
<label><span class="star-5 check">☆</span><span class="star-4">☆</span><span class="star-3">☆</span><span class="star-2">☆</span><span class="star-1">☆</span></label>
</li>
</ul>
</div>
<div class="brands">
<div class="fheader">
<h1>Brands</h1>
</div>
<ul>
<li>
<input class="checkbox" type="checkbox" <?php if($_SESSION['items'][600])echo 'checked';?> id="fprice" name="<?php echo $heading;?>" value="600">
<label>Brand A</label>
</li>
<li>
<input class="checkbox" type="checkbox" <?php if($_SESSION['items'][700])echo 'checked';?> id="fprice" name="<?php echo $heading;?>" value="700">
<label>Brand B</label>
</li>
<li>
<input class="checkbox" type="checkbox" <?php if($_SESSION['items'][800])echo 'checked';?> id="fprice" name="<?php echo $heading;?>" value="800">
<label>Brand C</label>
</li>
<li>
<input class="checkbox" type="checkbox" <?php if($_SESSION['items'][900])echo 'checked';?> id="fprice" name="<?php echo $heading;?>" value="900">
<label>Brand D</label>
</li>
<li>
<input class="checkbox" type="checkbox"<?php if($_SESSION['items'][1000])echo 'checked';?> id="fprice" name="<?php echo $heading;?>" value="1000">
<label>Brand E</label>
</li>
</ul>
</div>
</div>
</div>
<div class="clearfix"></div>
</section>
</div>
</div>
<footer>
<div class="wrapper">
<p>Copyright of Gogol's </p>
</div>
</footer>
<script type="text/javascript">
$( document ).ready(function() {
$('.level-2').toggleClass('hidden');
$('.level-3').toggleClass('hidden');
var isOpen = false;
$('.dropdown').addClass('hidden');
$('.autosuggest').focus(function(){
$(this).addClass('expand');
});
$('.autosuggest').blur(function(){
if($('.result a').size()==0){
$(this).removeClass('expand');
$('.dropdown').addClass('hidden');
}
else{
if($('.result a li').hasClass('empty_search')){
//alert("close now");
$(this).removeClass('expand');
$('.dropdown').addClass('hidden');
}
}
});
$('.autosuggest').keyup(function(){
var search_term=$(this).val();
$.post('ajax/search.php',{search_term:search_term},function(data){
$('.result').html(data);
});
$('.dropdown').removeClass('hidden');
});
});
$(".nav li:nth-child(3)").click(function(){
$('.second').toggleClass("second_active");
});
$(".level-1 li").click(function(ev){
ev.stopPropagation();
$(this).find(".level-2").toggleClass("hidden");
});
$(".level-2 li").click(function(ev){
ev.stopPropagation();
$(this).find(".level-3").toggleClass("hidden");
});
$(".toggle").click(function(){
$('.filter').toggleClass("hidden");
$('.food').toggleClass('fdwide');
});
$('.checkbox').click(function(){
var value1=$(this).attr('value');
var value2=$(this).attr('name');
//alert(value);
$.get('filter.php',{username:value1,name:value2},function(data){
$('.grid').html(data);
});
});
</script>
</body>
</html>