-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
54 lines (45 loc) · 1.51 KB
/
index.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
<?php
/**
* Created by IntelliJ IDEA.
* User: Jaya Naga Bhavana Kommuru
*/
include("includes/header.php");
include("functions/functions.php");
?>
<div class="jumbotron">
<div class="row text-center">
<form class="navbar-form">
<div class="input-group">
<?php
coreDisplay();
?>
<div class="input-group add-on">
<input type="text" class="form-control" placeholder="Enter Query"
id="searchText" name="searchText">
<div class="input-group-btn">
<button class="btn btn-default" type="submit" name="submit" value="submit">
<i class="glyphicon glyphicon-search"></i>
</button>
</div>
</div>
</div>
</form>
</div>
</div>
<?php
if (isset($_GET['submit'])) {
$department = (isset($_GET['selectCore']) && $_GET['selectCore'] != '') ? $_GET['selectCore'] : '';
$query = (isset($_GET['searchText']) && ($_GET['searchText'] != '')) ? $_GET['searchText'] : "*:*";
if (preg_match('/\s/', $query)) {
$query = str_replace(' ', '+', $query);
}
if (preg_match('(")', $query)) {
$query = str_replace('"', '\"', $query);
}
searchResults($department, getJSONdata($query, $department));
}
?>
</div>
<?php
include("includes/footer.php");
?>