first commit

This commit is contained in:
Erreur32 2021-02-05 13:56:01 +01:00
parent 69abc09ba6
commit 316af02a9b
5 changed files with 55 additions and 52 deletions

View file

@ -3,52 +3,17 @@
include_once('./config.php'); include_once('./config.php');
include_once('./consql.php'); include_once('./consql.php');
// set the default timezone to use. Available since PHP 5.1 // set the default timezone to use. Available since PHP 5.1
// https://www.php.net/manual/en/timezones.others.php // https://www.php.net/manual/en/timezones.others.php
date_default_timezone_set('Etc/GMT-1'); date_default_timezone_set('Etc/GMT-1');
//date_default_timezone_set('Europe/Paris'); //date_default_timezone_set('Europe/Paris');
$date = date('Y-m-d H:i:s');
$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";
// if server down update sql // if server down update sql
if (empty($Info['HostName'])) { if (empty($Info['HostName'])) {
$HostName ="OFFLINE"; $HostName ="OFFLINE";
$Players ="0"; $PLayers ="0";
$ping ="0"; $ping ="0";
$timeserver="0"; $timeserver="0";
$timespeed ="0"; $timespeed ="0";
@ -59,7 +24,7 @@ $mods ="0";
$timespeed ="0"; $timespeed ="0";
$timespeedn="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)) { if (mysqli_query($con, $insql)) {
// echo "New record created successfully"; // echo "New record created successfully";
@ -99,7 +64,7 @@ $timespeed="2";
$timespeedn="4"; $timespeedn="4";
// SQL insert Query. // 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 // Check if errors with SQL query
if (mysqli_query($con, $insql)) { if (mysqli_query($con, $insql)) {

View file

@ -7,10 +7,6 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
SET NAMES utf8mb4; SET NAMES utf8mb4;
DROP DATABASE IF EXISTS `dayzstat`;
CREATE DATABASE `dayzstat` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `dayzstat`;
DROP TABLE IF EXISTS `StatServer_5`; DROP TABLE IF EXISTS `StatServer_5`;
CREATE TABLE `StatServer_5` ( CREATE TABLE `StatServer_5` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,

View file

@ -19,10 +19,17 @@
$title = "DayZ Stat SERVER Clan | by TOX" ; // Web title page $title = "DayZ Stat SERVER Clan | by TOX" ; // Web title page
$descript = "Your Clan/server desciption"; // Your clan/server description $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"; $logoteam = "logoteam.png";
$imagemap = "chernarus.jpg"; $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
// Don't touch below (or you know what you do) // Don't touch below (or you know what you do)
@ -66,5 +73,41 @@
$Timer = Number_Format( MicroTime( true ) - $Timer, 4, '.', '' ); $Timer = Number_Format( MicroTime( true ) - $Timer, 4, '.', '' );
$InfoGT = $Info['GameTags']; $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";
?> ?>

View file

@ -8,7 +8,7 @@
$userdb = "user"; $userdb = "user";
$pdb = "pass"; $pdb = "pass";
$dbname = "database"; $dbname = "database";
$table = "StatServer_1"; $table = "StatServer_5";

View file

@ -512,8 +512,7 @@ $sec = "300";
<?php foreach( $Players as $Player ): ?> <?php foreach( $Players as $Player ): ?>
<table> <table>
<tr> <tr>
<td style="width:200px"> <span class="btn btn-large btn-primary">"Survivor" </span> </td> <td style="width:200px"> <span class="btn btn-large btn-primary">"Survivor" </span> </td> <td>&emsp; <span style='color:grey'>Playtime </span>> <?php echo $Player[ 'TimeF' ]; ?> Minutes </td>
<td>&emsp; <span style='color:grey'>Playtime </span>> <?php echo $Player[ 'TimeF' ]; ?> Minutes </td>
</tr> </tr>
</table> </table>