-
Notifications
You must be signed in to change notification settings - Fork 1
/
search-result.php
82 lines (77 loc) · 3.39 KB
/
search-result.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
<?php include 'DBConnect.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Search Results</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/prettyPhoto.css" rel="stylesheet">
<link href="css/price-range.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<link href="css/responsive.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
<link rel="shortcut icon" href="images/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="images/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="images/ico/apple-touch-icon-57-precomposed.png">
</head><!--/head-->
<body>
<?php include 'header.php'; ?>
<section>
<div class="container">
<div class="row">
<?php include 'category.php';
if (isset($_GET['search'])) {?>
<div class="col-sm-9 padding-right">
<h2>Search results for "<?php echo $_GET['search']; ?>"</h2><br/>
<div class="features_items"><!--features_items-->
<?php
//var_dump($_GET['search']);
$name = mysqli_real_escape_string ($db,$_GET['search']);
//var_dump($name);
//var_dump(master_products);
$sql = "SELECT * FROM products WHERE Product_Name LIKE '%".$name."%'";
$result = mysqli_query($db,$sql);
//var_dump($result);
if (!$result) {
echo 'MySQL Error: ' . mysqli_error($db);
//exit;
}
while ($row = mysqli_fetch_assoc($result))
{ ?>
<div class="col-sm-4">
<div class="product-image-wrapper">
<div class="single-products">
<div class="productinfo text-center">
<img src="<?php echo $row['Path']; ?>" alt="<?php echo $row['Product_Name']; ?>" style="height: 241px;"/>
<h2>Rs <?php echo $row['Price']; ?></h2>
<a href="product-details.php?id=<?php echo $row['ID'];?>"><p><?php echo $row['Product_Name']; ?></p></a>
<a href="add-to-cart.php?id=<?php echo $row['ID']; ?>" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
</div>
</div>
</div>
</div>
<?php }} ?>
</div>
</div>
</div>
</div>
</section>
<?php include 'footer.php'; ?>
<script src="js/jquery.js"></script>
<script src="js/price-range.js"></script>
<script src="js/jquery.scrollUp.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.prettyPhoto.js"></script>
<script src="js/main.js"></script>
</body>
</html>