-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
227 lines (177 loc) · 6.8 KB
/
index.php
File metadata and controls
227 lines (177 loc) · 6.8 KB
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
<?php
header('Content-Type: text/html; charset=UTF-8');
include("inc/dbconnect.php");
include("inc/footer.inc.php");
include("swf/open-flash-chart.php");
mysql_query("SET CHARACTER SET 'utf8'");
$sql = 'SELECT STEAMID, NAME, POINTS FROM `Player`';
$sql .= " WHERE `STEAMID` <> 'BOT'";
$sql .= ' ORDER BY `POINTS` DESC LIMIT 0, 5 ';
$ergebnis = mysql_query($sql);
$players = array();
$points = array();
$highestpoints = 0;
$counter = 0;
while ($adr = mysql_fetch_array($ergebnis)) {
$counter++;
$players[$counter] = $adr['NAME'];
$points[$counter] = $adr['POINTS'];
if ($adr['POINTS'] > $highestpoints) {
$highestpoints = $adr['POINTS'];
}
}
$animation = 'pop';
$delay = 0.5;
$cascade = 1;
$title = new title("");
$title->set_style('{color: #567300; font-size: 14px}');
$data = array();
$x_labels = array();
$i2 = 0;
foreach ($players as $player) {
$i2++;
$barvalue = new bar_value($points[$i2]);
$barvalue->set_tooltip($points[$i2]);
$data[] = $barvalue;
$x_labels[] = $player;
}
$bar = new bar_sketch('#EEA411', '#567300', 5);
$bar->set_values($data);
$bar->set_on_show(new bar_on_show($animation, $cascade, $delay));
$y = new y_axis_right();
$y->set_range(0, $highestpoints);
$xlabel = new x_axis_labels();
$xlabel->set_vertical();
$xlabel->set_labels($x_labels);
$x = new x_axis();
$x->set_labels_from_array($x_labels);
$x->set_labels($xlabel);
$chart = new open_flash_chart();
$chart->set_title($title);
$chart->add_element($bar);
$chart->set_y_axis($y);
$chart->set_x_axis($x);
//echo $chart->toPrettyString();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Current Players - <?php echo $clanname ?></title>
<link rel=stylesheet type=text/css href="styles/default.css">
<link type="text/css" href="styles/menu.css" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" href="styles/jquery.jqplot.css"/>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/menu.js"></script>
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/swfobject.js"></script>
<script
type="text/javascript">swfobject.embedSWF("swf/open-flash-chart.swf", "my_chart", "490", "300", "9.0.0");</script>
<script type="text/javascript" language="javascript"><
!--
function ofc_ready() {
}
function open_flash_chart_data() {
return JSON.stringify(data);
}
function findSWF(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
var data = <?php echo $chart->toPrettyString(); ?>;
</script>
</head>
<body>
<?php include("inc/headerlinks.inc.php"); ?>
<div align=center>
<img src="images/headers/header_onlineplayers.jpg"/>
</div>
<table style="" width="500" border="0" cellpadding="0" cellspacing="0" align="center">
<tr valign="top">
<td valign=top colspan="2" align="center" class="tlarge coltitle">Best Players of the Server</td>
</tr>
<tr>
<td class=row style="background-color:#fff;" colspan="2">
<div id="my_chart"></div>
</td>
</tr>
</table>
<table class="" style="border:none" width=500" border="0">
<tr>
<td class=row>
<div>
<?php
$ts1 = time() - (90 + $tioffset);
mysql_query("SET CHARACTER SET 'utf8'");
$sql = "SELECT * FROM Player WHERE LASTONTIME >= '$ts1'";
$query = mysql_query($sql) or die('DB Query failed');
if (mysql_num_rows($query) == 0) {
echo 'No online players at the moment';
} else {
$page = 1;
if (isset($_GET['page'])) {
if (mysql_real_escape_string($_GET['page'])) {
$page = mysql_real_escape_string($_GET['page']);
}
}
$per_page = "35";
$count = mysql_num_rows($query);
$limit = ($page - 1) * $per_page;
$pages = ceil($count / $per_page);
$previous = $page - 1;
$next = $page + 1;
$ol = $limit + 1;
echo('<ol start="' . $ol . '">');
if ($page <= $pages) {
$sql = 'SELECT * FROM `Player` WHERE LASTONTIME >= ' . $ts1 . ' ORDER BY `POINTS` DESC LIMIT ' . $limit . ',' . $per_page;
$ergebnis = mysql_query($sql);
$fromplayer = 0;
$i = 1;
$i = $i + $fromplayer;
while ($adr = mysql_fetch_array($ergebnis)) {
$timestamp = $adr['LASTONTIME'];
if ($timestamp == 0) {
$laststr = "never";
} else {
$datum = date("d.m.Y", $timestamp);
$uhrzeit = date("H:i", $timestamp);
$laststr = $datum . " - " . $uhrzeit;
}
echo '
<li><a href="player.php?steamid=' . $adr['STEAMID'] . '">' . $adr['NAME'] . '</a><br /><br /></li>
';
}
echo('</ol>');
switch ($page) {
case($page == $pages && $previous == 0):
echo('Page ' . $page . ' of ' . $pages);
break;
case($page != $pages && $previous != 0):
echo('Page ' . $page . ' of ' . $pages . ' <a href="?page=' . $previous . '">Previous 20</a> | <a href="?page=' . $next . '">Next 20</a>');
break;
case($page != $pages):
echo('Page ' . $page . ' of ' . $pages . ' <a href="?page=' . $next . '">Next 20</a>');
break;
case($page == $pages && $previous != 0):
echo('Page ' . $page . ' of ' . $pages . ' <a href="?page=' . $previous . '">Previous 20</a>');
break;
}
} else {
echo("</ol>");
}
}
########################
#############################
?>
</td>
</tr>
</div>
</table>
<?php echo $mainindexfooter ?>
</td>
</tr>
</table>
</body>
</html>