-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.php
More file actions
30 lines (22 loc) · 777 Bytes
/
search.php
File metadata and controls
30 lines (22 loc) · 777 Bytes
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
<?php require_once 'templates/header.php' ?>
<h1>Patient Zero Search</h1>
<form id="search">
<input id="searchTerm" placeholder="Search" />
<input type="submit" value="Search" />
<div id="#results"></div>
</form>
<script>
$(document).ready(function () {
$('#search').on('submit', function (event) {
PatientZero.Search.getResults({term: $('#searchTerm').val()}).then(function (data) {
var resultDisplay = $('div');
$.each(data.tweets, function (index, tweet) {
resultDisplay.append('<div>' + tweet.tweet.username + '</div>');
});
$('#results').replaceWith(resultDisplay);
});
event.preventDefault();
});
});
</script>
<?php require_once 'templates/footer.php' ?>