-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.php
executable file
·218 lines (192 loc) · 7.78 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?php
require_once( 'config.php' );
$db = Database::getInstance();
if( !$db->load(DATABASE_FILE) ) {
exit( 'Cannot load database, you should run the grabber first!' );
}
$t_reports = $db->getReports();
//$start_date = date( 'd/m/Y', $db->getFirstReportDate() );
//$end_date = date( 'd/m/Y' );
?>
<!doctype html>
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if (IE 7)&!(IEMobile)]><html class="no-js lt-ie9 lt-ie8" lang="en"><![endif]-->
<!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Your bug bounty stats</title>
<link rel="stylesheet" href="css/bootstrap3.3.min.css">
<link rel="stylesheet" href="css/awesome-bootstrap-checkbox.css">
<link rel="stylesheet" href="css/dataTables.bootstrap.min.css">
<link rel="stylesheet" href="css/custom.css">
<script src="js/jquery.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/dataTables.bootstrap.min.js"></script>
<script src="js/highcharts.src.min.js"></script>
</head>
<body>
<?php include( 'include/popup_about.php' ); ?>
<?php include( 'include/popup_more.php' ); ?>
<?php include( 'include/popup_report_add.php' ); ?>
<?php include( 'include/popup_report_edit.php' ); ?>
<?php include( 'include/popup_tag_add.php' ); ?>
<div id="menubar">
<button id="add-bounty-btn" type="button" class="btn btn-warning" title="Manually add a report">+</button>
<button id="about-btn" type="button" class="btn btn-success" title="About">?</button>
</div>
<span id="filter-reset"><a href="javascript:setFilterTerm('');"><img src="img/stop.png" width="20" /></a></span>
<div id="hacker-container" class="container-fluid">
<div class="row">
<div class="col-md-12" id="hacker-infos">
<?php include( 'include/hacker_infos.php' ); ?>
</div>
</div>
<div class="row">
<div class="col-md-6" style="/*margin-top:30px;*/">
<div class="row">
<?php //include( 'include/filters_form.php' ); ?>
</div>
<div class="row">
<?php include( 'include/listing.php' ); ?>
</div>
</div>
<?php if( $t_reports ) { ?>
<div class="col-md-6">
<?php if( defined('GRAPH_BOUNTIES') && GRAPH_BOUNTIES ) { ?>
<div class="row">
<?php include( 'graph/graph_bounties.php' ); ?>
</div>
<?php } ?>
<?php if( defined('GRAPH_BOUNTIES_REPORTS_REPUTATION') && GRAPH_BOUNTIES_REPORTS_REPUTATION ) { ?>
<div class="row">
<?php include( 'graph/graph_bounties_reports_reputation.php' ); ?>
</div>
<?php } ?>
<?php if( defined('GRAPH_REPORTS_RATINGS') && GRAPH_REPORTS_RATINGS ) { ?>
<div class="row">
<?php include( 'graph/graph_reports_ratings.php' ); ?>
</div>
<?php } ?>
<div class="row">
<?php if( defined('GRAPH_RATINGS_PIE') && GRAPH_RATINGS_PIE ) { ?>
<div class="col-md-6">
<?php include( 'graph/graph_reports_ratings_pie.php' ); ?>
</div>
<?php } ?>
<?php if( defined('GRAPH_PROGRAMS_PIE') && GRAPH_PROGRAMS_PIE ) { ?>
<div class="col-md-6">
<?php include( 'graph/graph_reports_programs_pie.php' ); ?>
</div>
<?php } ?>
<?php if( defined('GRAPH_PLATFORMS_PIE') && GRAPH_PLATFORMS_PIE ) { ?>
<div class="col-md-6">
<?php include( 'graph/graph_reports_platforms_pie.php' ); ?>
</div>
<?php } ?>
<?php if( defined('GRAPH_STATE_PIE') && GRAPH_STATE_PIE ) { ?>
<div class="col-md-6">
<?php include( 'graph/graph_reports_state_pie.php' ); ?>
</div>
<?php } ?>
<?php if( defined('GRAPH_TAGS_PIE') && GRAPH_TAGS_PIE ) { ?>
<div class="col-md-6">
<?php include( 'graph/graph_reports_tags_pie.php' ); ?>
</div>
<?php } ?>
</div>
<?php if( defined('GRAPH_TOP_PROGRAMS') && GRAPH_TOP_PROGRAMS ) { include( 'graph/top_programs.php' ); } ?>
<?php if( defined('GRAPH_TOP_TAGS') && GRAPH_TOP_TAGS ) { include( 'graph/top_tags.php' ); } ?>
<?php if( defined('GRAPH_TAGS_EVOLUTION') && GRAPH_TAGS_EVOLUTION ) { include( 'graph/graph_tags_evolution.php' ); } ?>
</div>
<?php } ?>
</div>
</div>
<script type="text/javascript">
function reloadGraph()
{
for( var i=0 ; i<Highcharts.charts.length ; i++ ) {
Highcharts.charts[i].userOptions.mine[0].reload();
}
if( $('#top-programs').length ) {
$.post( 'ajax.php', {'_a':'graph-reload','graph':'top-programs-html'}, function(data) {
var data = jQuery.parseJSON( data );
$.each(data,function(k,v){
var tab = $('#top-programs').find('.'+k);
if( tab.length ) {
tab.html( v );
}
})
});
}
if( $('#top-tags').length ) {
$.post( 'ajax.php', {'_a':'graph-reload','graph':'top-tags-html'}, function(data) {
var data = jQuery.parseJSON( data );
$.each(data,function(k,v){
var tab = $('#top-tags').find('.'+k);
if( tab.length ) {
tab.html( v );
}
})
});
}
}
function reloadReportLine( report_key )
{
var tr = $('tr[data-key="'+report_key+'"]');
$.post( 'ajax.php', {'_a':'report-get','key':report_key}, function(data) {
var report = jQuery.parseJSON( data );
var td_state = tr.find('.report-state');
td_state.attr( 'class', 'report-state state_'+report.state );
var input_title = tr.find('.report-title');
input_title.html( report.title );
var input_program = tr.find('.report-program');
input_program.html( report.program );
var input_bounty = tr.find('.report-bounty');
input_bounty.html( report.total_bounty );
var input_created_at = tr.find('.report-created_at');
input_created_at.html( report.created_at );
var a = input_title.parent();
a.removeClass( 'rating_0 rating_1 rating_2 rating_3 rating_4 rating_5' );
a.addClass( 'rating_'+report.rating );
var input_tags = tr.find('.report-tags');
input_tags.html( '' );
jQuery.each( report.tags, function(k,v){
input_tags.append( '<span class="report-tag">'+v+'</span> ' );
});
reloadGraph();
});
}
function setFilterTerm( term )
{
var input_search = $('input[type="search"]');
input_search.val( term );
$("html, body").animate({scrollTop: 0}, 100);
input_search.keyup();
}
$(document).ready(function() {
$('.search-term').click(function(){
var term = $(this).html();
setFilterTerm( term );
});
$('.datatable').DataTable({
'paging': true,
'pageLength': 75,
'order': [[ 5, 'desc' ]],
'dom': '<"row top"<"col-md-3"i><"col-md-3"f><"col-md-6"p>>rt<"row bottom"<"col-md-3"i><"col-md-3"f><"col-md-6"p>>',
'oLanguage': {
"sInfo": "Showing _START_ to _END_ of _MAX_",
//"sInfo": "Got a total of _TOTAL_ entries to show (_START_ to _END_)",
'sInfoFiltered': '',
'sSearch': ''
}
});
var reset_btn = $('#filter-reset');
var input_search = $('input[type="search"]');
input_search.attr( 'placeholder', 'Search...' );
input_search.parent().append( reset_btn );
});
</script>
</body>
</html>