CREATEDAD

This commit is contained in:
Thijs Stobbelaar 2023-11-16 16:22:12 +01:00
parent 1c52a2910d
commit 1124a95eff

View file

@ -30,44 +30,45 @@ $lastMatches = array_slice($allMatches, 0, 8);
<?php <?php
include './includes/navigation.php'; include './includes/navigation.php';
include './includes/header.php'; include './includes/header.php';
?> ?>
<main> <main>
<section> <section>
<h2>Latest Matches</h2> <h2>Latest Matches</h2>
<table> <table>
<tr> <tr>
<!-- <th>Match Date</th> --> <th>Match Date</th>
<th>Player Name</th> <th>Player Name</th>
<th>Mode</th> <th>Mode</th>
<th>Type</th> <th>Type</th>
<th>Map</th> <th>Map</th>
<th>Kills</th> <th>Kills</th>
<th>Damage</th> <th>Damage</th>
<th>Place</th> <th>Place</th>
</tr> </tr>
<?php <?php
$mapNames = array( $mapNames = array(
"Baltic_Main" => "Erangel", "Baltic_Main" => "Erangel",
"Chimera_Main" => "Paramo", "Chimera_Main" => "Paramo",
"Desert_Main" => "Miramar", "Desert_Main" => "Miramar",
"DihorOtok_Main" => "Vikendi", "DihorOtok_Main" => "Vikendi",
"Erangel_Main" => "Erangel", "Erangel_Main" => "Erangel",
"Heaven_Main" => "Haven", "Heaven_Main" => "Haven",
"Kiki_Main" => "Deston", "Kiki_Main" => "Deston",
"Range_Main" => "Camp Jackal", "Range_Main" => "Camp Jackal",
"Savage_Main" => "Sanhok", "Savage_Main" => "Sanhok",
"Summerland_Main" => "Karakin", "Summerland_Main" => "Karakin",
"Tiger_Main" => "Taego" "Tiger_Main" => "Taego"
); );
foreach ($lastMatches as $match) { foreach ($lastMatches as $match) {
$matchid = $match['id']; $matchid = $match['id'];
echo "<tr> echo "<tr>
<td><a href='matchinfo.php?matchid=$matchid'>" . $match['createdAt'] . "</a></td>
<td><a href='matchinfo.php?matchid=$matchid'>" . $match['playername'] . "</a></td> <td><a href='matchinfo.php?matchid=$matchid'>" . $match['playername'] . "</a></td>
<td><a href='matchinfo.php?matchid=$matchid'>" . $match['gameMode'] . "</a></td> <td><a href='matchinfo.php?matchid=$matchid'>" . $match['gameMode'] . "</a></td>
<td><a href='matchinfo.php?matchid=$matchid'>" . $match['matchType'] . "</a></td> <td><a href='matchinfo.php?matchid=$matchid'>" . $match['matchType'] . "</a></td>
@ -77,14 +78,14 @@ $lastMatches = array_slice($allMatches, 0, 8);
<td><a href='matchinfo.php?matchid=$matchid'>" . $match['stats']['winPlace'] . "</a></td> <td><a href='matchinfo.php?matchid=$matchid'>" . $match['stats']['winPlace'] . "</a></td>
</tr>"; </tr>";
} ?> } ?>
</table> </table>
<h2>Clan Info</h2> <h2>Clan Info</h2>
<?php <?php
//CLANINFO //CLANINFO
$clanInfoPath = './data/claninfo.json'; $clanInfoPath = './data/claninfo.json';
$clanmembersfile = './config/clanmembers.json'; $clanmembersfile = './config/clanmembers.json';
$clanmembers = json_decode(file_get_contents($clanmembersfile), true); $clanmembers = json_decode(file_get_contents($clanmembersfile), true);
@ -97,7 +98,7 @@ $lastMatches = array_slice($allMatches, 0, 8);
echo "<tr><td><a href='latestmatches.php?selected_player=" . htmlspecialchars($value) . "'>name</a></td><td><a href='latestmatches.php?selected_player=" . htmlspecialchars($value) . "'>" . htmlspecialchars($value) . "</a></td></tr>"; echo "<tr><td><a href='latestmatches.php?selected_player=" . htmlspecialchars($value) . "'>name</a></td><td><a href='latestmatches.php?selected_player=" . htmlspecialchars($value) . "'>" . htmlspecialchars($value) . "</a></td></tr>";
} }
foreach ($clan as $key => $value) { foreach ($clan as $key => $value) {
if($key == 'updated'){ if ($key == 'updated') {
continue; continue;
} }
echo "<tr><td>" . htmlspecialchars($key) . "</td><td>" . htmlspecialchars($value) . "</td></tr>"; echo "<tr><td>" . htmlspecialchars($key) . "</td><td>" . htmlspecialchars($value) . "</td></tr>";