-
Notifications
You must be signed in to change notification settings - Fork 7
/
submit-quest.php
80 lines (71 loc) · 2.05 KB
/
submit-quest.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
<?php
include 'frontend/functions.php';
include 'frontend/menu.php';
include 'config/dbbuilding.php';
?>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script type="text/javascript" src="//code.jquery.com/jquery-1.8.3.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
<script>
$(document).ready(function(){
$("#questsearch").select2({
templateResult: formatState1,
width:'100%'
});
});
function formatState1 (state) {
if (!state.id) { return state.text; }
var $state = $(
'<span ><img style="display: inline-block;" src="static/quests/' + state.element.label.toLowerCase() + '.png" heigth="24" width="24"/> ' + state.text + '</span>'
);
return $state;
}
$(document).ready(function(){
$("#pokestopsearch").select2({
templateResult: formatState2,
width:'100%'
});
});
function formatState2 (state) {
if (!state.id) { return state.text; }
var $state = $(
'<span ><img style="display: inline-block;" src="static/stops/stops.png" heigth="24" width="24"/> ' + state.text + '</span>'
);
return $state;
}
$(document).ready(function(){
$("#rewardsearch").select2({
templateResult: formatState3,
sorter: sortresults,
width:'100%'
});
});
function sortresults (state) {
return state.sort(function (a, b) {
if (a.text > b.text) {
return 1;
}
if (a.text < b.text) {
return -1;
}
return 0;
});
}
function formatState3 (state) {
if (!state.id) { return state.text; }
var $state = $(
'<span ><img style="display: inline-block;" src="static/rewards/' + state.element.label.toLowerCase() + '.png" heigth="24" width="24"/> ' + state.text + '</span>'
);
return $state;
}
</script>
</head>
<?php
menu();
questsubmission();
?>
</body>
<footer></footer>