forked from nidebr/as-stats-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
history.php
255 lines (211 loc) · 9.3 KB
/
history.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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<?php include("func.inc"); ?>
<?php
$selected_links = array();
$val_searchas = isset($_GET['as']) ? $_GET['as'] : "";
$aff_customlinks = "";
if ( isset($_GET['as']) ) {
$as = str_replace('as','',str_replace(' ','',strtolower($_GET['as'])));
if ($as) $asinfo = getASInfo($as);
$title = "AS-Stats | History for AS".$as.": ".$asinfo['descr'];
$header = 'History for AS' . $as;
$header_small = $asinfo['descr'];
$select_form = "";
if(isset($_GET['peerusage']) && $_GET['peerusage'] == '1') { $peerusage = 1; }
else { $peerusage = 0; }
$rrdfile = getRRDFileForAS($as, $peerusage);
$daily_graph_v4 = getHTMLImg($as, 4, $asinfo['descr'], time() - 24 * 3600, time(), $peerusage, 'daily graph', 'detailgraph', true);
$weekly_graph_v4 = getHTMLImg($as, 4, $asinfo['descr'], time() - 6.9 * 86400, time(), $peerusage, 'weekly graph', 'detailgraph', true);
$monthly_graph_v4 = getHTMLImg($as, 4, $asinfo['descr'], time() - 30 * 86400, time(), $peerusage, 'monthly graph', 'detailgraph', true);
$yearly_graph_v4 = getHTMLImg($as, 4, $asinfo['descr'], time() - 365 * 86400, time(), $peerusage, 'yearly graph', 'detailgraph', true);
if ($showv6) {
$daily_graph_v6 = getHTMLImg($as, 6, $asinfo['descr'], time() - 24 * 3600, time(), $peerusage, 'daily graph', 'detailgraph', true);
$weekly_graph_v6 = getHTMLImg($as, 6, $asinfo['descr'], time() - 6.9 * 86400, time(), $peerusage, 'weekly graph', 'detailgraph', true);
$monthly_graph_v6 = getHTMLImg($as, 6, $asinfo['descr'], time() - 30 * 86400, time(), $peerusage, 'monthly graph', 'detailgraph', true);
$yearly_graph_v6 = getHTMLImg($as, 6, $asinfo['descr'], time() - 365 * 86400, time(), $peerusage, 'yearly graph', 'detailgraph', true);
}
if ( !empty($customlinks) ) {
$aff_customlinks .= '<div class="list-group list-group-unbordered">';
foreach ($customlinks as $linkname => $url) {
$url = str_replace("%as%", $as, $url);
$aff_customlinks .= '<a href='.$url.' target="_blank" class="list-group-item"><i class="fa fa-external-link text-blue"></i> ' . htmlspecialchars($linkname) . '</a>';
}
$aff_customlinks .= "</div>";
}
} else {
$title = "AS-Stats | History";
$header = 'History for AS';
$header_small = "";
$select_form = 'onload="document.forms[0].as.focus(); document.forms[0].as.select();"';
}
?>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Refresh" content="300">
<title><?php echo $title ?></title>
<link rel="icon" href="favicon.ico" />
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="plugins/font-awesome/font-awesome.min.css">
<link rel="stylesheet" href="plugins/ionicons/ionicons.min.css">
<link rel="stylesheet" href="dist/css/AdminLTE.min.css">
<link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
<link rel="stylesheet" href="css/custom.css">
</head>
<body class="hold-transition skin-black-light sidebar-collapse layout-top-nav fixed" <?php echo $select_form; ?>>
<div class="wrapper">
<!-- =============================================== -->
<?php echo menu($selected_links); ?>
<!-- =============================================== -->
<div class="content-wrapper">
<?php echo content_header($header, $header_small); ?>
<section class="content">
<div class="row">
<div class="col-lg-2">
<div class="row">
<div class="col-lg-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Search AS</h3>
<div class="box-tools">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
</div>
</div>
<div class="box-body">
<form class="navbar-form navbar-left" role="search">
<div class="input-group">
<input type="text" class="form-control menu-input" name="as" placeholder="Search AS" value="<?php echo $val_searchas; ?>">
<span class="input-group-btn">
<button type="submit" class="btn btn-flat button-input"><i class="fa fa-search"></i></button>
</span>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<?php if ($aff_customlinks) { ?>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Custom Links</h3>
<div class="box-tools">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
</div>
</div>
<div class="box-body">
<?php echo $aff_customlinks; ?>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
<?php if ( isset($_GET['as'])) { ?>
<div class="col-lg-10">
<div class="row">
<div class="col-lg-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Daily</h3>
<div class="box-tools">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
</div>
</div>
<div class="box-body">
<center>
<?php $col = $showv6 ? "6" : "12"; ?>
<div class="col-lg-<?php echo $col; ?>">
<?php echo $daily_graph_v4; ?>
</div>
<?php if ($showv6) { ?>
<div class="col-lg-6">
<?php echo $daily_graph_v6; ?>
</div>
<?php } ?>
</center>
</div>
</div>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Weekly</h3>
<div class="box-tools">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
</div>
</div>
<div class="box-body">
<center>
<?php $col = $showv6 ? "6" : "12"; ?>
<div class="col-lg-<?php echo $col; ?>">
<?php echo $weekly_graph_v4; ?>
</div>
<?php if ($showv6) { ?>
<div class="col-lg-6">
<?php echo $weekly_graph_v6; ?>
</div>
<?php } ?>
</center>
</div>
</div>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Monthly</h3>
<div class="box-tools">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
</div>
</div>
<div class="box-body">
<center>
<?php $col = $showv6 ? "6" : "12"; ?>
<div class="col-lg-<?php echo $col; ?>">
<?php echo $monthly_graph_v4; ?>
</div>
<?php if ($showv6) { ?>
<div class="col-lg-6">
<?php echo $monthly_graph_v6; ?>
</div>
<?php } ?>
</center>
</div>
</div>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Yearly</h3>
<div class="box-tools">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
</div>
</div>
<div class="box-body">
<center>
<?php $col = $showv6 ? "6" : "12"; ?>
<div class="col-lg-<?php echo $col; ?>">
<?php echo $yearly_graph_v4; ?>
</div>
<?php if ($showv6) { ?>
<div class="col-lg-6">
<?php echo $yearly_graph_v6; ?>
</div>
<?php } ?>
</center>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
</section>
</div>
<!-- =============================================== -->
<?php echo footer(); ?>
<!-- =============================================== -->
</div>
<script src="plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="plugins/fastclick/fastclick.min.js"></script>
<script src="dist/js/app.min.js"></script>
</body>
</html>