Example #1
0
?>
              <thead>
              <tr>
                <th>Measurement</th>
                <th>Data</th>
                <th>Server Average (<?php 
echo $amountOfPlayers;
?>
 players)</th>
              </tr>
              </thead>
              <tbody>
              <tr>
                <th>Playtime</th>
                <td><?php 
echo convert_playtime(getPlaytime($mysqli, $mysql_table_prefix, $player_id));
?>
</td>
                <td><?php 
echo convert_playtime(getServerAverage($mysqli, $mysql_table_prefix, "playtime", $required_global_stats_time));
?>
</td>
              </tr>
              <tr>
                <th>Travel</th>
                <td><?php 
echo round(getPlayerStat($mysqli, $mysql_table_prefix, $player_id, "move"), 2);
?>
 Meters</td>
                <td><?php 
echo round(getServerAverage($mysqli, $mysql_table_prefix, "move", $required_global_stats_time), 2);
Example #2
0
<?php

/**
 * Copyright (c) AccountProductions and Sybren Gjaltema, 2014. All rights reserved.
 */
header('Content-Type: application/json');
include '../../config.php';
include '../db.php';
include '../util.php';
include '../pages/player-list-getter.php';
include '../queries.php';
$players = getPlayerList($mysqli, $mysql_table_prefix, "online", "desc", 1);
if (!$players || empty($players)) {
    die(json_encode("Query failed, or no players are found"));
}
$arr = array();
while ($player = $players->fetch_array()) {
    $newPlayer = array();
    $newPlayer['player_id'] = $player['player_id'];
    $newPlayer['name'] = getPlayerName($mysqli, $mysql_table_prefix, $player['player_id']);
    $newPlayer['lastjoin'] = $player['lastjoin'];
    $newPlayer['lastleave'] = $player['lastleave'];
    $newPlayer['traveled'] = getPlayerStat($mysqli, $mysql_table_prefix, $player['player_id'], 'move');
    $newPlayer['broke'] = getPlayerStat($mysqli, $mysql_table_prefix, $player['player_id'], 'broken');
    $newPlayer['placed'] = getPlayerStat($mysqli, $mysql_table_prefix, $player['player_id'], 'placed');
    $newPlayer['playtime'] = getPlaytime($mysqli, $mysql_table_prefix, $player['player_id']);
    $arr[] = $newPlayer;
}
echo json_encode($arr);