-
Notifications
You must be signed in to change notification settings - Fork 8
/
search.php
55 lines (55 loc) · 2.44 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
<?php
include(".views/header.php");
if(isset($_GET["q"])){
$q = $_GET["q"];
}else{
$q = '';
}
?>
<div class="container-fluid">
<div class="page-header"><h1>Search Results for "<?php echo $q; ?>"</h1></div>
<div class="row">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">Patient Results</div>
<ul class="list-group">
<?php
$assigner = database::getQueryResults('SELECT id, first_name, middle_name, last_name FROM patients WHERE first_name LIKE \'%'.$q.'%\' OR middle_name LIKE \'%'.$q.'%\' OR last_name LIKE \'%'.$q.'%\';');
foreach($assigner as $staff){
echo '<li class="list-group-item"><a href="/patient/patient-profile.php?patient='.$staff['id'].'">'.$staff['first_name'].' '.$staff['middle_name'].' '.$staff['last_name'].'</a></li>';
}
?>
</ul>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-default" >
<div class="panel-heading">Staff Results</div>
<ul class="list-group">
<?php
$assigner = database::getQueryResults('SELECT id, firstname, lastname FROM staff WHERE firstname LIKE \'%'.$q.'%\' OR lastname LIKE \'%'.$q.'%\';');
foreach($assigner as $staff){
echo '<li class="list-group-item"><a href="/patient/patient-profile.php?patient='.$staff['id'].'">'.$staff['firstname'].' '.$staff['lastname'].'</a></li>';
}
?>
</ul>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-default" >
<div class="panel-heading">Resource Results</div>
<ul class="list-group">
<?php
$resources = database::getQueryResults('SELECT id, name, description FROM resources WHERE name LIKE \'%'.$q.'%\' OR description LIKE \'%'.$q.'%\';');
foreach($resources as $resource){
echo '<li class="list-group-item"><p><a href="/resources/book.php?resource='.$resource['id'].'">'.$resource['name'].' </p><p><i>'.$resource['description'].'</a></i></p></li>';
}
?>
</ul>
</div>
</div>
</div>
</div>
<?php
include(".views/footer.php");
?>