clan info on main page
This commit is contained in:
parent
ee824a4267
commit
7421e7a820
2 changed files with 80 additions and 48 deletions
|
|
@ -4,7 +4,10 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<?php include './includes/navigation.php'; ?>
|
<?php
|
||||||
|
include './includes/navigation.php';
|
||||||
|
include './config/config.php';
|
||||||
|
?>
|
||||||
<header>
|
<header>
|
||||||
<img src="./images/banner2.png" alt="banner" class="banner">
|
<img src="./images/banner2.png" alt="banner" class="banner">
|
||||||
</header>
|
</header>
|
||||||
|
|
@ -12,7 +15,7 @@
|
||||||
<section>
|
<section>
|
||||||
<h2>Clan Stats</h2>
|
<h2>Clan Stats</h2>
|
||||||
<?php
|
<?php
|
||||||
include './config/config.php';
|
|
||||||
|
|
||||||
// Load clan data from claninfo.json
|
// Load clan data from claninfo.json
|
||||||
$clanInfoPath = './data/claninfo.json';
|
$clanInfoPath = './data/claninfo.json';
|
||||||
|
|
|
||||||
113
index.php
113
index.php
|
|
@ -13,7 +13,7 @@ foreach ($playersData as $player) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort matches by createdAt date
|
// Sort matches by createdAt date
|
||||||
usort($allMatches, function($a, $b) {
|
usort($allMatches, function ($a, $b) {
|
||||||
return strtotime($b['createdAt']) - strtotime($a['createdAt']);
|
return strtotime($b['createdAt']) - strtotime($a['createdAt']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -25,50 +25,51 @@ $lastMatches = array_slice($allMatches, 0, 8);
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<?php include './includes/head.php'; ?>
|
<?php include './includes/head.php'; ?>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?php include './includes/navigation.php'; ?>
|
<?php include './includes/navigation.php'; ?>
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<img src="./images/banner2.png" alt="banner" class="banner">
|
<img src="./images/banner2.png" alt="banner" class="banner">
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<section>
|
<section>
|
||||||
<h2>Latest Matches</h2>
|
<h2>Latest Matches</h2>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<!-- <th>Match Date</th> -->
|
|
||||||
<th>Player Name</th>
|
|
||||||
<th>Mode</th>
|
|
||||||
<th>Type</th>
|
|
||||||
<th>Map</th>
|
|
||||||
<th>Kills</th>
|
|
||||||
<th>Damage</th>
|
|
||||||
<th>Place</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
$mapNames = array(
|
|
||||||
"Baltic_Main" => "Erangel",
|
|
||||||
"Chimera_Main" => "Paramo",
|
|
||||||
"Desert_Main" => "Miramar",
|
|
||||||
"DihorOtok_Main" => "Vikendi",
|
|
||||||
"Erangel_Main" => "Erangel",
|
|
||||||
"Heaven_Main" => "Haven",
|
|
||||||
"Kiki_Main" => "Deston",
|
|
||||||
"Range_Main" => "Camp Jackal",
|
|
||||||
"Savage_Main" => "Sanhok",
|
|
||||||
"Summerland_Main" => "Karakin",
|
|
||||||
"Tiger_Main" => "Taego"
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach($lastMatches as $match) {
|
<tr>
|
||||||
$matchid = $match['id'];
|
<!-- <th>Match Date</th> -->
|
||||||
|
<th>Player Name</th>
|
||||||
|
<th>Mode</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Map</th>
|
||||||
|
<th>Kills</th>
|
||||||
|
<th>Damage</th>
|
||||||
|
<th>Place</th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
echo "<tr>
|
|
||||||
|
<?php
|
||||||
|
$mapNames = array(
|
||||||
|
"Baltic_Main" => "Erangel",
|
||||||
|
"Chimera_Main" => "Paramo",
|
||||||
|
"Desert_Main" => "Miramar",
|
||||||
|
"DihorOtok_Main" => "Vikendi",
|
||||||
|
"Erangel_Main" => "Erangel",
|
||||||
|
"Heaven_Main" => "Haven",
|
||||||
|
"Kiki_Main" => "Deston",
|
||||||
|
"Range_Main" => "Camp Jackal",
|
||||||
|
"Savage_Main" => "Sanhok",
|
||||||
|
"Summerland_Main" => "Karakin",
|
||||||
|
"Tiger_Main" => "Taego"
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($lastMatches as $match) {
|
||||||
|
$matchid = $match['id'];
|
||||||
|
|
||||||
|
echo "<tr>
|
||||||
<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>
|
||||||
|
|
@ -78,16 +79,44 @@ $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>";
|
||||||
} ?>
|
} ?>
|
||||||
</tbody>
|
|
||||||
</table>
|
</table>
|
||||||
|
<h2>Clan Stats</h2>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
// Load clan data from claninfo.json
|
||||||
|
$clanInfoPath = './data/claninfo.json';
|
||||||
|
$clanmembersfile = './config/clanmembers.json';
|
||||||
|
$clanmembers = json_decode(file_get_contents($clanmembersfile), true);
|
||||||
|
if (file_exists($clanInfoPath)) {
|
||||||
|
$clan = json_decode(file_get_contents($clanInfoPath), true);
|
||||||
|
if (isset($clan) && !empty($clan)) {
|
||||||
|
echo "<table>";
|
||||||
|
echo "<tr><th>Attribute</th><th>Value</th></tr>";
|
||||||
|
foreach ($clan as $key => $value) {
|
||||||
|
echo "<tr><td>" . htmlspecialchars($key) . "</td><td>" . htmlspecialchars($value) . "</td></tr>";
|
||||||
|
}
|
||||||
|
foreach ($clanmembers['clanMembers'] as $value) {
|
||||||
|
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>";
|
||||||
|
}
|
||||||
|
|
||||||
</section>
|
echo "</table>";
|
||||||
</main>
|
} else {
|
||||||
|
echo "<p>No clan attributes available</p>";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "<p>Clan info file missing</p>";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
|
||||||
<?php include './includes/footer.php'; ?>
|
<?php include './includes/footer.php'; ?>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue