-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
139 lines (121 loc) · 3.5 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
<?php
session_start();
$db = mysqli_connect('localhost', 'root', '', 'sih');
$nick=$_SESSION['username'];
//echo $nick;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Categories</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>
</head>
<body>
<br> <br>
<form method="post" action="search.php">
<input type="text" class="textbox" placeholder="Search">
<input title="Search" value="" type="submit" class="button" name="submit-search">
</form>
<br> <br> <br> <br> <br>
<?php
if(isset($_POST['submit-search'])){
$letter = $_POST['submit-search'];
$letter = $_POST['search'];
//echo "aray bsdk";
//echo "ssup";
//echo $letter;
$sql = "SELECT * from image where product_category LIKE '$letter%' ";
$s= mysqli_query($db,$sql);
//$ct=0;
while ($row = mysqli_fetch_array($s) ) {
/* echo' <div style="padding-left:30px;">'; */
// echo "\x20\x20\x20";
echo'
<div style="display: inline-block; padding-left:30px; ">
<div class="card" style="height:500px;width:300px; ">
<div class="view overlay">
<img style="height:250px;width:300px;" class="card-img-top" src='. $row['location'] .' alt="Card image cap">
<a href="#!">
<div class="mask rgba-white-slight"></div>
</a>
</div>
<div class="card-body">
<h4 class="card-title">'.$row['product_cost'].'</h4>
<h4 class="card-title">'.$row['product_category'].'</h4>
<h4 class="card-text">'.$row['user_name'].'</h4>
<a href="#" class="btn btn-primary">Add to cart</a>
</div>
</div>
</div>
';
}
}
/* echo '</table>'; */
?>
</body>
</html>
<style>
body {
background: url('http://i.hizliresim.com/v4Qykv.png') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
font-family: 'Roboto', Tahoma, Arial, sans-serif;
line-height: 1.5;
font-size: 13px;
}
form {
outline: 0;
float: left;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
-webkit-border-radius: 4px;
border-radius: 4px;
}
form > .textbox {
outline: 0;
height: 42px;
width: 244px;
line-height: 42px;
padding: 0 16px;
background-color: rgba(255, 255, 255, 0.8);
color: #212121;
border: 0;
float: left;
-webkit-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
}
form > .textbox:focus {
outline: 0;
background-color: #FFF;
}
form > .button {
outline: 0;
background: none;
background-color: rgba(38, 50, 56, 0.8);
float: left;
height: 42px;
width: 42px;
text-align: center;
line-height: 42px;
border: 0;
color: #FFF;
font: normal normal normal 14px/1 FontAwesome;
font-size: 16px;
text-rendering: auto;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
-webkit-transition: background-color .4s ease;
transition: background-color .4s ease;
-webkit-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
}
form > .button:hover {
background-color: rgba(0, 150, 136, 0.8);
}
</style>