-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
327 lines (293 loc) · 10.9 KB
/
search.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
<?php
session_start();
include 'dbconnect.php';
$s = $_POST['Search'];
?>
<!DOCTYPE html>
<html>
<head>
<title>Tokopekita - Pencarian</title>
<!-- for-mobile-apps -->
<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="Tokopekita, Richard's Lab" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //for-mobile-apps -->
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- font-awesome icons -->
<link href="css/font-awesome.css" rel="stylesheet">
<!-- //font-awesome icons -->
<!-- js -->
<script src="js/jquery-1.11.1.min.js"></script>
<!-- //js -->
<link href='//fonts.googleapis.com/css?family=Raleway:400,100,100italic,200,200italic,300,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css'>
<!-- start-smoth-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>
<!-- start-smoth-scrolling -->
</head>
<body>
<!-- header -->
<div class="agileits_header">
<div class="container">
<div class="w3l_offers">
<p>DAPATKAN PENAWARAN MENARIK KHUSUS HARI INI, BELANJA SEKARANG!</p>
</div>
<div class="agile-login">
<ul>
<?php
if(!isset($_SESSION['log'])){
echo '
<li><a href="registered.php"> Daftar</a></li>
<li><a href="login.php">Masuk</a></li>
';
} else {
if($_SESSION['role']=='Member'){
echo '
<li style="color:white">Halo, '.$_SESSION["name"].'
<li><a href="logout.php">Keluar?</a></li>
';
} else {
echo '
<li style="color:white">Halo, '.$_SESSION["name"].'
<li><a href="admin">Admin Panel</a></li>
<li><a href="logout.php">Keluar?</a></li>
';
};
}
?>
</ul>
</div>
<div class="product_list_header">
<a href="cart.php"><button class="w3view-cart" type="submit" name="submit" value=""><i class="fa fa-cart-arrow-down" aria-hidden="true"></i></button>
</a>
</div>
<div class="clearfix"> </div>
</div>
</div>
<div class="logo_products">
<div class="container">
<div class="w3ls_logo_products_left1">
<ul class="phone_email">
<li><i class="fa fa-phone" aria-hidden="true"></i>Hubungi Kami : +1234567567</li>
</ul>
</div>
<div class="w3ls_logo_products_left">
<h1><a href="index.php">Tokopekita</a></h1>
</div>
<div class="w3l_search">
<form action="search.php" method="post">
<input type="search" name="Search" placeholder="Cari produk...">
<button type="submit" class="btn btn-default search" aria-label="Left Align">
<i class="fa fa-search" aria-hidden="true"> </i>
</button>
<div class="clearfix"></div>
</form>
</div>
<div class="clearfix"> </div>
</div>
</div>
<!-- //header -->
<!-- navigation -->
<div class="navigation-agileits">
<div class="container">
<nav class="navbar navbar-default">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header nav_2">
<button type="button" class="navbar-toggle collapsed navbar-toggle1" data-toggle="collapse" data-target="#bs-megadropdown-tabs">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="bs-megadropdown-tabs">
<ul class="nav navbar-nav">
<li class="active"><a href="index.php" class="act">Home</a></li>
<!-- Mega Menu -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Kategori Produk<b class="caret"></b></a>
<ul class="dropdown-menu multi-column columns-3">
<div class="row">
<div class="multi-gd-img">
<ul class="multi-column-dropdown">
<h6>Kategori</h6>
<?php
$kat=mysqli_query($conn,"SELECT * from kategori order by idkategori ASC");
while($p=mysqli_fetch_array($kat)){
?>
<li><a href="kategori.php?idkategori=<?php echo $p['idkategori'] ?>"><?php echo $p['namakategori'] ?></a></li>
<?php
}
?>
</ul>
</div>
</div>
</ul>
</li>
<li><a href="cart.php">Keranjang Saya</a></li>
<li><a href="konfirmasi.php">Daftar Order</a></li>
</ul>
</div>
</nav>
</div>
</div>
<!-- //navigation -->
<!-- breadcrumbs -->
<div class="breadcrumbs">
<div class="container">
<ol class="breadcrumb breadcrumb1 animated wow slideInLeft" data-wow-delay=".5s">
<li><a href="index.php"><span class="glyphicon glyphicon-home" aria-hidden="true"></span>Home</a></li>
<li class="active">Kategori</li>
</ol>
</div>
</div>
<!-- //breadcrumbs -->
<!--- beverages --->
<div class="products">
<div class="container">
<div class="col-md-4 products-left">
<div class="categories">
<h2>Categories</h2>
<ul class="cate">
<?php
$kat=mysqli_query($conn,"SELECT * from kategori order by idkategori ASC");
while($p=mysqli_fetch_array($kat)){
?>
<li><a href="kategori.php?idkategori=<?php echo $p['idkategori'] ?>"><i class="fa fa-arrow-right" aria-hidden="true"></i><?php echo $p['namakategori'] ?></a></li>
<?php
}
?>
</ul>
</div>
</div>
<div class="col-md-8 products-right">
<div class="agile_top_brands_grids">
<?php
$brgs=mysqli_query($conn,"SELECT * from produk where namaproduk like '%$s%' or deskripsi like '%$s%' order by idproduk ASC");
$x = mysqli_num_rows($brgs);
if($x>0){
while($p=mysqli_fetch_array($brgs)){
?>
<div class="col-md-4 top_brand_left">
<div class="hover14 column">
<div class="agile_top_brand_left_grid">
<div class="agile_top_brand_left_grid_pos">
<img src="images/offer.png" alt=" " class="img-responsive" />
</div>
<div class="agile_top_brand_left_grid1">
<figure>
<div class="snipcart-item block">
<div class="snipcart-thumb">
<a href="product.php?idproduk=<?php echo $p['idproduk'] ?>"><img src="<?php echo $p['gambar']?>" width="200px" height="200px"></a>
<p><?php echo $p['namaproduk'] ?></p>
<h4>Rp<?php echo number_format($p['hargaafter']) ?> <span>Rp<?php echo number_format($p['hargabefore']) ?></span></h4>
</div>
<div class="snipcart-details top_brand_home_details">
<fieldset>
<a href="product.php?idproduk=<?php echo $p['idproduk'] ?>"><input type="submit" class="button" value="Lihat Produk" /></a>
</fieldset>
</div>
</div>
</figure>
</div>
</div>
</div>
</div>
<?php
}
} else {
echo "Data tidak ditemukan, coba kata kunci lainnya";
}
?>
<div class="clearfix"> </div>
</div>
</div>
<div class="clearfix"> </div>
</div>
</div>
<!--- beverages --->
<!-- //footer -->
<div class="footer">
<div class="container">
<div class="w3_footer_grids">
<div class="col-md-4 w3_footer_grid">
<h3>Hubungi Kami</h3>
<ul class="address">
<li><i class="glyphicon glyphicon-map-marker" aria-hidden="true"></i>TokoPekita, UBSI Cikarang</li>
<li><i class="glyphicon glyphicon-envelope" aria-hidden="true"></i><a href="mailto:info@email">mrizukii@gmail.com</a></li>
<li><i class="glyphicon glyphicon-earphone" aria-hidden="true"></i>+1234 567 567</li>
</ul>
</div>
<div class="col-md-3 w3_footer_grid">
<h3>Tentang Kami</h3>
<ul class="info">
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="about.html">About Us</a></li>
</ul>
</div>
<div class="clearfix"> </div>
</div>
</div>
<div class="footer-copy">
<div class="container">
<p>© 2022 TokoPekita by Kelompok 2 | Design by <a href="http://w3layouts.com/">Shalaby.com</a></p>
</div>
</div>
</div>
<div class="footer-botm">
<div class="container">
<div class="w3layouts-foot">
<ul>
<li><a href="#" class="w3_agile_instagram"><i class="fa fa-instagram" aria-hidden="true"></i></a></li>
<li><a href="#" class="w3_agile_facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
<li><a href="#" class="agile_twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>
</ul>
</div>
<div class="payment-w3ls">
<img src="images/card.png" alt=" " class="img-responsive">
</div>
<div class="clearfix"> </div>
</div>
</div>
<!-- //footer -->
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- top-header and slider -->
<!-- here stars scrolling icon -->
<script type="text/javascript">
$(document).ready(function() {
var defaults = {
containerID: 'toTop', // fading element id
containerHoverID: 'toTopHover', // fading element hover id
scrollSpeed: 4000,
easingType: 'linear'
};
$().UItoTop({ easingType: 'easeOutQuart' });
});
</script>
<!-- //here ends scrolling icon -->
<!-- main slider-banner -->
<script src="js/skdslider.min.js"></script>
<link href="css/skdslider.css" rel="stylesheet">
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#demo1').skdslider({'delay':5000, 'animationSpeed': 2000,'showNextPrev':true,'showPlayButton':true,'autoSlide':true,'animationType':'fading'});
jQuery('#responsive').change(function(){
$('#responsive_wrapper').width(jQuery(this).val());
});
});
</script>
<!-- //main slider-banner -->
</body>
</html>