-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex1.php
executable file
·107 lines (96 loc) · 3.6 KB
/
index1.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/login.css">
<link rel="stylesheet" href="css/search.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<title>Scavenger Search</title>
</head>
<body>
<div class="container">
<div class="row">
<h1>Scavenger Search</h1>
</div>
<div class="row">
<h2>The best of its kind!</h2>
<div class="col-md-12">
<div id="custom-search-input">
<div class="input-group col-md-12">
<input name="search" type="text" class="form-control input-lg" placeholder="Search" />
<span class="input-group-btn">
<button class="btn btn-info btn-lg" type="button">
<i class="glyphicon glyphicon-search"></i>
</button>
</span>
</div>
</div>
</div>
<label class="radio-inline">
<input id="radioEverything" checked="checked" onclick="searchq(1,1);" type="radio" name="searchType">Everything
</label>
<label class="radio-inline">
<input id="radioPDF" onclick="searchq(1,1);" type="radio" name="searchType">PDFs only
</label>
<!--
<div class="col-md-4">
<div class="form-group">
<input type="text" class="form-control" placeholder="number of results">
</div>
</div>
-->
</div>
<div class="row">
<div class="col-md-12">
<div id="output">
<h3>Enter the search query to get the results</h3>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$("input[name='search']").keypress(function(e){
if(e.which == 13){
searchq(1,1);
}
});
function searchq (pageNo,isCorrect){
var searchTxt= $("input[name='search']").val();
var checked=0;
if($("#radioEverything").is(':checked')){
checked=0;
} else if($("#radioPDF").is(':checked')){
checked=1;
}
if(isCorrect != '1'){
searchTxt = $("#SuggestedText");
}
$.get("engine.php", {search:searchTxt,page:pageNo,radio:checked,isCorrected:isCorrect}, function(output){
$("#output").html(output)
});
//To get suggestions run it on another python file :P
// $.get("suggestions.php", {search:searchTxt}){
// $("input[name='search']").attr("typeahead","hello, just testing");
// });
}
function searchw (pageNo, isCorrect) {
var searchTxt= $("input[name='search']").val();
var checked=0;
if($("#radioEverything").is(':checked')){
checked=0;
} else if($("#radioPDF").is(':checked')){
checked=1;
}
$.get("wrong_engine.php", {search:searchTxt,page:pageNo,radio:checked,isCorrected:isCorrect}, function(output){
$("#output").html(output)
});
}
//if(isCorrected=="false"){
//}
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>
</body>
</html>