-
Notifications
You must be signed in to change notification settings - Fork 6
/
search.php
55 lines (48 loc) · 983 Bytes
/
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
<?php include('header.php'); ?>
<center>
<h2 style="padding: 20px;">Search Registration:</h3>
<div class="container">
<br />
<div class="col-lg-12">
<div class="input-group">
<input type="text" class="form-control" name='search_text' id='search_text' placeholder="Enter a Event to Search. . . . . . ." aria-label="Enter a event to search">
<span class="input-group-btn">
<button class="btn btn-secondary" type="button">Go!</button>
</span>
</div>
</div>
</div>
<br />
<div id="result"></div>
</div>
</center>
<script>
$(document).ready(function(){
load_data();
function load_data(query)
{
$.ajax({
url:"fetch.php",
method:"POST",
data:{query:query},
success:function(data)
{
$('#result').html(data);
}
});
}
$('#search_text').keyup(function(){
var search = $(this).val();
if(search != '')
{
load_data(search);
}
else
{
load_data();
}
});
});
</script>
</body>
</html>