-
Notifications
You must be signed in to change notification settings - Fork 7
/
servers.php
73 lines (60 loc) · 2.54 KB
/
servers.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
<?php
session_start();
require "Components/PHP/autoload.php";
$servers = $server->GetServerList();
?>
<!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">
<link rel="stylesheet" type="text/css" href="Assets/CSS/comm_servers.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>
<?php
for ($i=0; $i < count($servers); $i++) {
$serverOnline = $server->ServerOnline($servers[$i]["server_ip"], $servers[$i]["server_port"]);
$online;
$info;
if ($serverOnline) {
$info = $server->GetServerInfo($servers[$i]["server_ip"], $servers[$i]["server_port"]);
$online = count($server->GetOnlineUsers($servers[$i]["server_ip"], $servers[$i]["server_port"]));
}
else
{
$online = 0;
$info = null;
}
echo '<div class="server-row">';
echo '<div class="server-item">';
echo '<div class="server-item-head">';
if ($serverOnline && $info["icon"] != "") {
echo '<img class="server-icon" src="data:image/png;base64, ' . $info["icon"] . '"/>';
}
else
{
echo '<img class="server-icon" src="Assets/IMG/offline.png"/>';
}
echo '<h1>' . $servers[$i]["server_name"] . '</h1>';
echo '</div>';
echo '<p>PLAYERS ONLINE: ' . $online . '</p>';
if ($serverOnline) {
echo "<a class='connect-btn' href='fivem://connect/" . $servers[$i]["server_ip"] . ":" . $servers[$i]["server_port"] . "''>FORBIND</a><br><br><br>";
}
else {
echo "<a class='connect-btn-offline'>OFFLINE</a><br><br><br>";
}
echo '</div>';
echo '</div>';
}
?>
</body>
</html>