-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfetch.php
More file actions
73 lines (66 loc) · 1.79 KB
/
Copy pathfetch.php
File metadata and controls
73 lines (66 loc) · 1.79 KB
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
<?php
$connect=mysqli_connect("localhost", "root", "", "stock");
$output='';
$sql="SELECT * FROM stocks WHERE name LIKE '%".$_POST['search']."%' OR id LIKE '%".$_POST['search']."%' ";
$result=mysqli_query($connect, $sql);
if(mysqli_num_rows($result)>0)
{
echo '<div class="row"> <h2>Search Results:</h2>';
while($rows=mysqli_fetch_array($result))
{
echo '<div class="well search-result">
<div class="row">
<a href="view_stock.php?id='.$rows['id'].'" title="View Stock">
<div class="col-xs-6 col-sm-9 col-md-9 col-lg-10 ">
<h4>Stock Name: <small>'.$rows['name'].'</small> - Quantity: <small>'.$rows['quantity'].'</small> - Price: <small> ₦'.number_format($rows['price']).'</small></h4>
</div>
</a>
</div>
</div>';
}
echo '</div>';
}
else
{
echo '<div class="alert alert-danger">
<a href="#" class="close" data-dismiss="alert">×</a>
<em>Feedback: </em> NO DATA FOUND!
</div>';
}
?>
<style type="text/css">
.well {
border: 0;
padding: 20px;
min-height: 63px;
background: #fff;
box-shadow: none;
border-radius: 3px;
position: relative;
max-height: 100000px;
border-bottom: 2px solid #ccc;
transition: max-height 0.5s ease;
-o-transition: max-height 0.5s ease;
-ms-transition: max-height 0.5s ease;
-moz-transition: max-height 0.5s ease;
-webkit-transition: max-height 0.5s ease;
}
.form-control {
height: 45px;
padding: 10px;
font-size: 16px;
box-shadow: none;
border-radius: 0;
position: relative;
}
background:#eee;
}
.search-result .title h3 {
margin: 0 0 15px;
color: #333;
}
.search-result .title p {
font-size: 12px;
color: #333;
}
</style>