first commit
This commit is contained in:
parent
69abc09ba6
commit
316af02a9b
5 changed files with 55 additions and 52 deletions
|
@ -3,52 +3,17 @@
|
|||
include_once('./config.php');
|
||||
include_once('./consql.php');
|
||||
|
||||
// set the default timezone to use. Available since PHP 5.1
|
||||
// https://www.php.net/manual/en/timezones.others.php
|
||||
date_default_timezone_set('Etc/GMT-1');
|
||||
//date_default_timezone_set('Europe/Paris');
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
|
||||
|
||||
// DEBUG
|
||||
/*
|
||||
print_r($Info);
|
||||
echo "<br><hr>";
|
||||
|
||||
echo "InfoGT: " .$InfoGT . "<br>";
|
||||
echo "ModDesc: " .$Info['ModDesc'] . "<br>";
|
||||
echo "Hostname: " .$Info['HostName'] . "<br>";
|
||||
echo "Players: " .$Info['Players'] . "<br>";
|
||||
echo "MaxPlayers: " .$Info['MaxPlayers'] . "<br>";
|
||||
echo "Secure: " .$Info['Secure'] . "<br>";
|
||||
echo "Map: " .$Info['Map'] . "<br>";
|
||||
echo "Os: " .$Info['Os'] . "<br>";
|
||||
echo "Version: " .$Info['Version'] . "<br>";
|
||||
echo "Port: " .$Info['GamePort'] . "<br>";
|
||||
echo "GameID: " .$Info['GameID'] . "<br>";
|
||||
echo "<hr>test SQL";
|
||||
*/
|
||||
|
||||
// Variables
|
||||
$HostName = $Info['HostName'] ;
|
||||
$Game = $Info['ModDesc'] ;
|
||||
$Version = $Info['Version'] ;
|
||||
$Players = $Info['Players'];
|
||||
$MaxPlayers = $Info['MaxPlayers'] ;
|
||||
$Secure = $Info['Secure'] ;
|
||||
$Map = $Info['Map'];
|
||||
$Os = $Info['Os'] ;
|
||||
$GamePort = $Info['GamePort'] ;
|
||||
$GameID = $Info['GameID'] ;
|
||||
$ping = "666";
|
||||
$mods = "0";
|
||||
// set the default timezone to use. Available since PHP 5.1
|
||||
// https://www.php.net/manual/en/timezones.others.php
|
||||
date_default_timezone_set('Etc/GMT-1');
|
||||
//date_default_timezone_set('Europe/Paris');
|
||||
$date = date('Y-m-d H:i:s');
|
||||
|
||||
// if server down update sql
|
||||
if (empty($Info['HostName'])) {
|
||||
|
||||
$HostName ="OFFLINE";
|
||||
$Players ="0";
|
||||
$PLayers ="0";
|
||||
$ping ="0";
|
||||
$timeserver="0";
|
||||
$timespeed ="0";
|
||||
|
@ -59,7 +24,7 @@ $mods ="0";
|
|||
$timespeed ="0";
|
||||
$timespeedn="0";
|
||||
|
||||
$insql = "INSERT INTO $table (date,name,players,maxplayers,map,game,version,timeserver,timespeed,timespeedn,mods,battleye,hive,connect,secure,ping) VALUES ('$date','$HostName','$Players','$MaxPlayers','$Map','$Game','$Version','$timeserver','$timespeed','$timespeedn','$mods','$battleye','$hive','$urlserv','$Secure','$ping')";
|
||||
$insql = "INSERT INTO $table (date,name,players,maxplayers,map,game,version,timeserver,timespeed,timespeedn,mods,battleye,hive,connect,secure,ping) VALUES ('$date','$HostName','$PLayers','$MaxPlayers','$Map','$Game','$Version','$timeserver','$timespeed','$timespeedn','$mods','$battleye','$hive','$urlserv','$Secure','$ping')";
|
||||
|
||||
if (mysqli_query($con, $insql)) {
|
||||
// echo "New record created successfully";
|
||||
|
@ -99,7 +64,7 @@ $timespeed="2";
|
|||
$timespeedn="4";
|
||||
|
||||
// SQL insert Query.
|
||||
$insql = "INSERT INTO $table (date,name,players,maxplayers,map,game,version,timeserver,timespeed,timespeedn,mods,battleye,hive,connect,secure,ping) VALUES ('$date','$HostName','$Players','$MaxPlayers','$Map','$Game','$Version','$timeserver','$timespeed','$timespeedn','$mods','$battleye','$hive','$urlserv','$Secure','$ping')";
|
||||
$insql = "INSERT INTO $table (date,name,players,maxplayers,map,game,version,timeserver,timespeed,timespeedn,mods,battleye,hive,connect,secure,ping) VALUES ('$date','$HostName','$PLayers','$MaxPlayers','$Map','$Game','$Version','$timeserver','$timespeed','$timespeedn','$mods','$battleye','$hive','$urlserv','$Secure','$ping')";
|
||||
|
||||
// Check if errors with SQL query
|
||||
if (mysqli_query($con, $insql)) {
|
||||
|
|
|
@ -7,10 +7,6 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
|
|||
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
DROP DATABASE IF EXISTS `dayzstat`;
|
||||
CREATE DATABASE `dayzstat` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
|
||||
USE `dayzstat`;
|
||||
|
||||
DROP TABLE IF EXISTS `StatServer_5`;
|
||||
CREATE TABLE `StatServer_5` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
|
|
45
config.php
45
config.php
|
@ -19,10 +19,17 @@
|
|||
|
||||
$title = "DayZ Stat SERVER Clan | by TOX" ; // Web title page
|
||||
$descript = "Your Clan/server desciption"; // Your clan/server description
|
||||
// $namemap = "chernarusplus"; // choose between: chernarusplus / livonia / namalsk/
|
||||
// $namemap = "chernarusplus"; // choose between: chernarusplus / livonia / namalsk/
|
||||
$logoteam = "logoteam.png";
|
||||
$imagemap = "chernarus.jpg";
|
||||
|
||||
/*
|
||||
// set the default timezone to use. Available since PHP 5.1
|
||||
// https://www.php.net/manual/en/timezones.others.php
|
||||
date_default_timezone_set('Etc/GMT-1');
|
||||
//date_default_timezone_set('Europe/Paris');
|
||||
//$date = date('Y-m-d H:i:s');
|
||||
*/
|
||||
// Don't touch below
|
||||
|
||||
// Don't touch below (or you know what you do)
|
||||
|
@ -66,5 +73,41 @@
|
|||
$Timer = Number_Format( MicroTime( true ) - $Timer, 4, '.', '' );
|
||||
$InfoGT = $Info['GameTags'];
|
||||
|
||||
|
||||
|
||||
|
||||
// DEBUG
|
||||
/*
|
||||
print_r($Info);
|
||||
echo "<br><hr>";
|
||||
|
||||
echo "InfoGT: " .$InfoGT . "<br>";
|
||||
echo "ModDesc: " .$Info['ModDesc'] . "<br>";
|
||||
echo "Hostname: " .$Info['HostName'] . "<br>";
|
||||
echo "Players: " .$Info['Players'] . "<br>";
|
||||
echo "MaxPlayers: " .$Info['MaxPlayers'] . "<br>";
|
||||
echo "Secure: " .$Info['Secure'] . "<br>";
|
||||
echo "Map: " .$Info['Map'] . "<br>";
|
||||
echo "Os: " .$Info['Os'] . "<br>";
|
||||
echo "Version: " .$Info['Version'] . "<br>";
|
||||
echo "Port: " .$Info['GamePort'] . "<br>";
|
||||
echo "GameID: " .$Info['GameID'] . "<br>";
|
||||
echo "<hr>test SQL";
|
||||
*/
|
||||
|
||||
// Variables
|
||||
$HostName = $Info['HostName'] ;
|
||||
$Game = $Info['ModDesc'] ;
|
||||
$Version = $Info['Version'] ;
|
||||
$PLayers = $Info['Players'];
|
||||
$MaxPlayers = $Info['MaxPlayers'] ;
|
||||
$Secure = $Info['Secure'] ;
|
||||
$Map = $Info['Map'];
|
||||
$Os = $Info['Os'] ;
|
||||
$GamePort = $Info['GamePort'] ;
|
||||
$GameID = $Info['GameID'] ;
|
||||
$ping = "666";
|
||||
// $mods = "0";
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
$userdb = "user";
|
||||
$pdb = "pass";
|
||||
$dbname = "database";
|
||||
$table = "StatServer_1";
|
||||
$table = "StatServer_5";
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -508,12 +508,11 @@ $sec = "300";
|
|||
<?php if( !empty( $Players ) ): ?>
|
||||
<div class="card-header">List players online: <?php echo $Info['Players'] ; ?></div>
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<?php foreach( $Players as $Player ): ?>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:200px"> <span class="btn btn-large btn-primary">"Survivor" </span> </td>
|
||||
<td>  <span style='color:grey'>Playtime </span>> <?php echo $Player[ 'TimeF' ]; ?> Minutes </td>
|
||||
<td style="width:200px"> <span class="btn btn-large btn-primary">"Survivor" </span> </td> <td>  <span style='color:grey'>Playtime </span>> <?php echo $Player[ 'TimeF' ]; ?> Minutes </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
|
Loading…
Reference in a new issue