Please help me
#1

Hi,i need help making server monitor, wen server is with lock in monitor is saysing serveri is Online how to make wen the server is Locked in monitor ? the monitor offline code
Quote:

<!DOCTYPE html>
<?php
$serverIp = 'serverIP';
$serverPort = '7777';

require "query/SampQueryAPI.php";
$query = new SampQueryAPI($serverIp, $serverPort);

if($query->isOnline())
{
$aInformation = $query->getInfo();
}

?>
<html>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<head>
<meta charset="utf-8">
<title>Serveris</title>
<link href="css/bootstrap.min.css" rel="stylesheet"/>
<style>
tr td, tr th { text-align: center !important; }
tr td.motd, tr th.motd { text-align: left !important; }
</style>
<!-- HTML5 shim -->
<!--[if lt IE 9]>
<script src="http://html5shim.******code.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body style="width: 725px; margin: 9px auto;">
<div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Statusas</th>
<th class="motd">Pavadinimas </th>
<th>Serverio IP</th>
<th>Versija</th>
<th>Žaidėjai</th>
<th>#</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<?php
if($query->isOnline())
{
echo
'<span class="badge badge-success">
<i class="icon-ok icon-white"></i>
</span>';
}
else
{
echo
'<span class="badge badge-danger">
<i class="icon-remove icon-white"></i>
</span>';
}
?>
</td>
<td class="motd">
<?php
if($query->isOnline()) echo htmlentities($aInformation['hostname']);
else echo '-';
?>
</td>
<td>
<code><?= $serverIp . ":" . $serverPort ?></code>
</td>
<td>
<?php
if($query->isOnline()) echo htmlentities($aInformation['gamemode']);
else echo '-';
?>
</td>
<td>
<?php
if($query->isOnline()) echo $aInformation['players'] . ' / ' . $aInformation['maxplayers'];
else echo '0 / 0';
?>
</td>
<td>
<a href on‌click="document.location.href = this.href;return false" title="Spauskite, kad atnaujinti informaciją">
<span class="badge badge-warning">
<i class="icon-refresh icon-white"></i>
</span>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

I need to show when the server is locked and the display would show through the locked, thanks to those who help. I will give + rep
Sorry for bad english.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)