-
Notifications
You must be signed in to change notification settings - Fork 17
/
results.php
executable file
·197 lines (115 loc) · 6.44 KB
/
results.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
<!Doctype>
<?php
include("functions/functions.php");
?>
<html>
<head>
<title>ONLINE SHOPPING...!</title>
<link rel="stylesheet" href ="styles/style.css" media="all" />
</head>
<body>
<!-- MAIN CONTAINER STARTS FROM HERE-->
<div class="main">
<!-- HEADER STARTS HERE -->
<div class="header">
<a href="index.php"><img id="logo_image" src="images/logo"/></a>
<img id="logo_image" src="images/logo1" style="width: 60%" />
</div>
<!-- HEADER ENDS HERE -->
<!-- NAVIGATION BAR STARTS HERE -->
<div class="menubar">
<ul id="menu">
<li><a href="index.php">HOME</a></li>
<li><a href="all_products.php">ALL PRODUCTS</a></li>
<li><a href="customer/my_account.php">MY ACCOUNTS</a></li>
<li><a href="">SIGN UP</a></li>
<li><a href="cart.php">SHOPPING CART</a></li>
<li><a href="#">CONTACT US</a></li>
</ul>
<div id="form">
<form method="get" action="results.php" enctype="multipart/form-data">
<input type="text" name="user_query" placeholder="Feel Free To Search" />
<input type="submit" name="search" value="search" />
</form>
</div>
</div>
<!-- NAVIGATION BAR ENDS HERE -->
<!-- CONTENTS SECTION START HERE -->
<div class="content">
<div id="sidebar">
<div id="sidebar_title">Categories</div>
<ul id="cats">
<?php getCats(); ?>
</ul>
<div id="sidebar_title">Brands</div>
<ul id="cats">
<?php getBrands(); ?>
</ul>
</div>
<div id="content_area">
<div id=shopping_cart>
<span style="float: center; font-size: 18px; padding: 5px; line-height: 40px">
Welcome !              
Total Items:  Total Price:  </b>
<a href="cart.php" style="color: yellow; text-decoration:none">Go to Cart   </a>
<?php
if(!isset($_SESSION['customer_email']))
{
echo "<a href='checkout.php' style='color:red; text-decoration:none;'>Login</a>";
}
else
{
echo "<a href='logout.php' style='color:red; text-decoration:none'>Logout</a>";
}
?>
</span>
</div>
<div id="products_box">
<?php
if(isset($_GET['search']))
{
$search_query=$_GET['user_query'];
echo '<link rel="stylesheet" href ="styles/style.css" media="all" />';
global $con;
$get_pro="select * from products where product_keywords like '%$search_query%' ";
$run_pro=mysqli_query($con,$get_pro);
$count_keywords=mysqli_num_rows($run_pro);
if($count_keywords==0)
{
echo "<script>alert('SORRY ! No Product available for your Search')</script>";
echo "<script> window.location.href ='index.php'</script>";
}
else
{
while($row_pro=mysqli_fetch_array($run_pro))
{
$pro_id=$row_pro['product_id'];
$pro_cat=$row_pro['product_cat'];
$pro_brand=$row_pro['product_brand'];
$pro_title=$row_pro['product_title'];
$pro_price=$row_pro['product_price'];
$pro_image=$row_pro[5];
echo "
<div id='single_product'>
<h3>$pro_title</h3>
<img src='admin/product_images/$pro_image' width='180' height='180' />
<p> ₹ <b>$pro_price</b></p>
<a href='details.php?pro_id=$pro_id' style='float:left'>Details</a>
<a href='index.php?pro_id=$pro_id'><button style='float:right'>Add to cart</button></a>
</div>
";
}
}
}
?>
</div>
</div>
</div>
<!-- CONTENTS SECTION ENDS HERE -->
<div id="footer">
<h2 style="text-align: center;padding-top: 10px ">© By ASHUTOSH RAJ</h2>
</div>
</div>
<!-- MAIN CONTAINER ENDS HERE-->
</body>
</html>