-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearchresults.php
89 lines (83 loc) · 2.92 KB
/
searchresults.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
<?php
session_start();
require_once "config/connect.php";
include 'inc/header.php';
include 'inc/nav.php';
?>
<div class="close-btn fa fa-times"></div>
<!-- SHOP CONTENT -->
<section id="content" style="background: #ffffff">
<div class="content-blog">
<div class="container">
<div class="row">
<!-- <div class="page_header text-center">
<h2>Shop</h2>
<p>You can order products from here</p>
</div> -->
<div class="col-md-12">
<div class="row">
<div id="shop-mason" class="shop-mason-4col">
<?php
$sql = "SELECT * FROM products";
if(isset($_GET['search']) & !empty($_GET['search'])){
$search = $_GET['search'];
$sql .= " WHERE name LIKE '%$search%'";
}
$res = mysqli_query($connection, $sql);
$result_count = 0;
while($r = mysqli_fetch_assoc($res)){
$result_count++;
?>
<div class="sm-item isotope-item" style="box-sizing:border-box; width:280px; height:400px; background-color: #fff;">
<div class="product">
<div class="product-thumb">
<img src="admin/<?php echo $r['thumb']; ?>" class="img-responsive" alt="">
<div class="product-overlay">
<span>
<a href="single.php?id=<?php echo $r['id']; ?>" class="fa fa-link"></a>
<a href="addtocart.php?id=<?php echo $r['id']; ?>" class="fa fa-shopping-cart"></a>
</span>
</div>
</div>
<div class="rating">
<span class="fa fa-star act"></span>
<span class="fa fa-star act"></span>
<span class="fa fa-star act"></span>
<span class="fa fa-star act"></span>
<span class="fa fa-star act"></span>
</div>
<h2 class="product-title"><a href="single.php?id=<?php echo $r['id']; ?>">
<?php echo $r['name']; ?></a></h2>
<div class="product-price">
<?php echo $r['price']; ?> BDT</div>
</div>
</div>
<?php }
if($result_count == 0) { ?>
<div class="no-results">
<h2 style="text-align: center;">Nothing Found!</h2>
</div>
<?php } ?>
</div>
</div>
<div class="clearfix"></div>
<!-- Pagination -->
<div class="page_nav">
<a href=""><i class="fa fa-angle-left"></i></a>
<a href="" class="active">1</a>
<a href="">2</a>
<a href="">3</a>
<a class="no-active">...</a>
<a href="">9</a>
<a href=""><i class="fa fa-angle-right"></i></a>
</div>
<!-- End Pagination -->
</div>
</div>
</div>
</div>
</section>
<div class="clearfix space70"></div>
<div class="clearfix space70"></div>
<div class="clearfix space20"></div>
<?php include 'inc/footer.php' ?>