-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathplayers.php
72 lines (59 loc) · 2.11 KB
/
players.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
<?php
session_start();
include 'Assets/PHP/Includes/settings.php';
require $AutoLoadPath;
$serverList = $server->GetServerList();
$serversInfo = array();
$players = array();
$comOnlinePlayers = 0;
foreach ($serverList as $serveritem) {
array_push($serversInfo, $server->GetOnlineUsers($serveritem["server_ip"], $serveritem["server_port"]));
}
for ($i=0; $i < count($serversInfo); $i++) {
if (empty($serversInfo[$i])) {
$comOnlinePlayers += 0;
}
else {
$comOnlinePlayers += count($serversInfo[$i]);
}
}
?>
<!DOCTYPE html>
<html>
<head>
<!-- LINKING ALL OF THE CSS FILES NECCESARRY -->
<link rel="stylesheet" type="text/css" href="Assets/CSS/comm_vars.css">
<link rel="stylesheet" type="text/css" href="Assets/CSS/main_style.css">
<link rel="stylesheet" type="text/css" href="Assets/CSS/comm_menu.css">
<!-- FONT INITIALIZATION -->
<link href="https://fonts.googleapis.com/css?family=Titillium+Web" rel="stylesheet">
<title>DailyNetwork</title>
</head>
<body>
<?php include('Assets/PHP/navigation.php'); ?>
<br><br><br>
<br><br><br>
<div class="items">
<?php
for ($i=0; $i < count($serversInfo); $i++) {
echo '<div class="collapse-container">';
echo '<button class="collapsible">' . $serverList[$i]["server_name"] . '</button>';
echo '<div class="content">';
if (!empty($serversInfo[$i])) {
echo "<ol>";
foreach ($serversInfo[$i] as $item) {
echo '<li><span class="player-id">' . $item["id"] . "</span> " . $item["name"] . "</li>";
}
echo "</ol>";
}
else {
echo "INGEN ONLINE SPILLERE";
}
echo "</div>";
echo "</div>";
}
?>
</div>
<script type="text/javascript" src="Assets/JS/expandables.js"></script>
</body>
</html>