forked from dzxs/jrat-web
/
index.php
126 lines (104 loc) · 3.4 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
<?php
require_once "request.php";
require_once "countries.php";
require_once "operatingsystem.php";
$request = new Request();
$sock = $request->createSocket();
if (! $request->isError()) {
$countryStats = $request->getCountryStats();
$osStats = $request->getOperatingSystemStats();
$request->disconnect();
}
require_once "layout/header.php";
?>
<section class="wrapper scrollable">
<?php require_once "layout/menubar.php"; ?>
<br>
<section class="widget-group">
<?php
if ($request->isError()) {
echo "<font color=#ff0000 size=32>" . $request->sock . "</font>";
}
?>
<?php
if (! $request->isError()) {
echo '<div class="proton-widget general-stats">
<div class="panel panel-primary front">
<div class="panel-heading">
<i class="icon-sort"></i> <span>Country Stats</span>
</div>
<ul class="list-group">';
if (empty($countrystats)) {
echo '<li class="list-group-item"><div class="text-holder"><span class="title-text"> ';
echo "0";
echo ' </span> <span class="description-text"> ';
echo "None";
echo '</span></div> <span class="stat-value"> ';
echo " + 0 ";
echo '<i class="icon-sort"></i></span>';
} else {
arsort($countryStats);
$numberValues = array_values($countryStats);
for($i = 0; $i < 5 && $i < count($countryStats); $i ++) {
$number = $numberValues [$i];
$short = key($countryStats);
next($countryStats);
$icon = "<img src='images/flags/" . strtolower($short) . ".png'>";
$displayCountry = Countries::short2long($short);
echo '<li class="list-group-item"><div class="text-holder"><span class="title-text"> ';
echo $number;
echo ' </span> <span class="description-text"> ';
echo $icon . " " . $displayCountry;
echo '</span></div> <span class="stat-value"> ';
echo " + 0 ";
echo '<i class="icon-sort"></i></span>';
}
}
echo '</ul>
</div>
</div>';
}
?>
<?php
if (! $request->isError()) {
echo '<div class="proton-widget general-stats">
<div class="panel panel-primary front">
<div class="panel-heading">
<i class="icon-sort"></i> <span>Operating System Stats</span>
</div>
<ul class="list-group">';
if (empty($osStats)) {
echo '<li class="list-group-item"><div class="text-holder"><span class="title-text"> ';
echo "0";
echo ' </span> <span class="description-text"> ';
echo "None";
echo '</span></div> <span class="stat-value"> ';
echo " + 0 ";
echo '<i class="icon-sort"></i></span>';
} else {
arsort($osStats);
$numberValues = array_values($osStats);
for($i = 0; $i < 5 && $i < count($osStats); $i ++) {
$number = $numberValues [$i];
$short = key($osStats);
next($osStats);
$icon = "<img src='" . OperatingSystem::getIcon($short) . "'>";
echo '<li class="list-group-item"><div class="text-holder"><span class="title-text"> ';
echo $number;
echo ' </span> <span class="description-text"> ';
echo $icon . " " . $short;
echo '</span></div> <span class="stat-value"> ';
echo " + 0 ";
echo '<i class="icon-sort"></i></span>';
}
}
echo '</ul>
</div>
</div>';
}
?>
</section>
</section>
<?php
require_once "layout/footer.php";
?>