-
Notifications
You must be signed in to change notification settings - Fork 0
/
filter.php
104 lines (101 loc) · 3.98 KB
/
filter.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
<?php
include 'core/database/connect.php';
session_start();
error_reporting(0);
$val=$_GET['username'];
$val2=$_GET['name'];
if(!isset($_SESSION['items']))
{
$_SESSION['items'] = array();
}
if(array_key_exists($val, $_SESSION['items']))
{
unset($_SESSION['items'][$val]);
$val='';
}
else
{
$_SESSION['items'][$val]=$val;
}
$heading=$val2;
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'");
while($row=mysql_fetch_assoc($query))
{
echo'<div class="p7">
<a href="details.php?pass1='.md5($row['category']).'&id='.($row['item_id']).'">
<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> ';
}
//print_r($_SESSION['items']);
//echo $val.' '.$val2;
?>