test
This commit is contained in:
parent
f5bd52c9ee
commit
8f5adf5d7f
1 changed files with 9 additions and 9 deletions
|
|
@ -60,21 +60,21 @@ $lastMatches = array_slice($allMatches, 0, 8);
|
||||||
$matchId = $_GET['matchid'];
|
$matchId = $_GET['matchid'];
|
||||||
$filename = "data/matches/" . $matchId . ".json";
|
$filename = "data/matches/" . $matchId . ".json";
|
||||||
|
|
||||||
$directory = 'data/killstats/';
|
|
||||||
$prefix = $matchdata['id'];
|
|
||||||
$files = glob($directory . $prefix . '*');
|
|
||||||
echo $prefix;
|
|
||||||
echo $directory;
|
|
||||||
echo $files;
|
|
||||||
foreach ($files as $file) {
|
|
||||||
echo $file . "\n";
|
|
||||||
}
|
|
||||||
// Check if the JSON file for the given match ID exists
|
// Check if the JSON file for the given match ID exists
|
||||||
if (file_exists($filename)) {
|
if (file_exists($filename)) {
|
||||||
// Read and decode the JSON file
|
// Read and decode the JSON file
|
||||||
$jsonData = json_decode(file_get_contents($filename), true);
|
$jsonData = json_decode(file_get_contents($filename), true);
|
||||||
$matchinfo = $jsonData['data']['attributes'];
|
$matchinfo = $jsonData['data']['attributes'];
|
||||||
$matchdata = $jsonData['data'];
|
$matchdata = $jsonData['data'];
|
||||||
|
|
||||||
|
$directory = 'data/killstats/';
|
||||||
|
$prefix = $matchdata['id'];
|
||||||
|
$files = glob($directory . $prefix . '*');
|
||||||
|
foreach ($files as $file) {
|
||||||
|
echo $file . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
echo "<table class='sortable'><tr><th>matchType</th><th>gameMode</th><th>duration</th><th>mapName</th><th>createdAt</th><th>id</th></tr>";
|
echo "<table class='sortable'><tr><th>matchType</th><th>gameMode</th><th>duration</th><th>mapName</th><th>createdAt</th><th>id</th></tr>";
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<td>" . htmlspecialchars($matchinfo['matchType']) . "</td>";
|
echo "<td>" . htmlspecialchars($matchinfo['matchType']) . "</td>";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue