commit
a1f75e8a95
5 changed files with 94 additions and 100 deletions
|
|
@ -1,48 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<?php include './includes/head.php'; ?>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<?php include './includes/navigation.php'; ?>
|
|
||||||
<header>
|
|
||||||
<img src="./images/banner2.png" alt="banner" class="banner">
|
|
||||||
</header>
|
|
||||||
<main>
|
|
||||||
<section>
|
|
||||||
<h2>Clan Stats</h2>
|
|
||||||
<?php
|
|
||||||
include './config/config.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>";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "</table>";
|
|
||||||
} else {
|
|
||||||
echo "<p>No clan attributes available</p>";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
echo "<p>Clan info file missing</p>";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<?php include './includes/footer.php'; ?>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
|
|
@ -9,7 +9,6 @@ if ($host == 'dev.dtch.online') {
|
||||||
<a href="index.php" class="active">Home</a>
|
<a href="index.php" class="active">Home</a>
|
||||||
|
|
||||||
<div id="myLinks">
|
<div id="myLinks">
|
||||||
<a href="clan_stats.php">Clan Stats</a>
|
|
||||||
<a href="user_stats.php">User Stats</a>
|
<a href="user_stats.php">User Stats</a>
|
||||||
<a href="topstats.php">Top10</a>
|
<a href="topstats.php">Top10</a>
|
||||||
<a href="topstatsavg.php">Match % T10</a>
|
<a href="topstatsavg.php">Match % T10</a>
|
||||||
|
|
|
||||||
125
index.php
125
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>
|
|
||||||
<section>
|
|
||||||
<h2>Latest Matches</h2>
|
|
||||||
|
|
||||||
<table>
|
<main>
|
||||||
<thead>
|
<section>
|
||||||
<tr>
|
<h2>Latest Matches</h2>
|
||||||
<!-- <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) {
|
<table>
|
||||||
$matchid = $match['id'];
|
|
||||||
|
<tr>
|
||||||
echo "<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>
|
||||||
|
|
||||||
|
|
||||||
|
<?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,48 @@ $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 Info</h2>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</section>
|
//CLANINFO
|
||||||
</main>
|
$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 ($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>";
|
||||||
|
}
|
||||||
|
foreach ($clan as $key => $value) {
|
||||||
|
if($key == 'updated'){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
echo "<tr><td>" . htmlspecialchars($key) . "</td><td>" . htmlspecialchars($value) . "</td></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
echo "</table>";
|
||||||
|
} 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>
|
||||||
|
|
@ -24,10 +24,19 @@
|
||||||
echo "<button type='submit' name='selected_player' value='$player_name' class='btn'>$player_name</button>";
|
echo "<button type='submit' name='selected_player' value='$player_name' class='btn'>$player_name</button>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "</form><br>";
|
echo "</form><br>";
|
||||||
|
|
||||||
$selected_player = $_GET['selected_player'] ?? $players_matches[0]['playername'];
|
$selected_player = $_GET['selected_player'] ?? $players_matches[0]['playername'];
|
||||||
|
echo "<form method='get' action=''>
|
||||||
|
<input type='submit' name='filter_by_match_type' value='all' class='btn'>
|
||||||
|
<input type='submit' name='filter_by_match_type' value='airoyale' class='btn'>
|
||||||
|
<input type='submit' name='filter_by_match_type' value='official' class='btn'>
|
||||||
|
<input type='submit' name='filter_by_match_type' value='custom' class='btn'>
|
||||||
|
<input type='submit' name='filter_by_match_type' value='event' class='btn'>
|
||||||
|
<input type='hidden' name='selected_player' value='$selected_player'>
|
||||||
|
</form><br>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$mapNames = array(
|
$mapNames = array(
|
||||||
"Baltic_Main" => "Erangel",
|
"Baltic_Main" => "Erangel",
|
||||||
"Chimera_Main" => "Paramo",
|
"Chimera_Main" => "Paramo",
|
||||||
|
|
@ -50,10 +59,11 @@
|
||||||
echo "<tr><th>Match Date</th><th>Game Mode</th><th>Match Type</th><th>Map</th><th>Kills</th><th>Damage Dealt</th><th>Time Survived</th><th>win Place</th></tr>";
|
echo "<tr><th>Match Date</th><th>Game Mode</th><th>Match Type</th><th>Map</th><th>Kills</th><th>Damage Dealt</th><th>Time Survived</th><th>win Place</th></tr>";
|
||||||
foreach ($player_data['player_matches'] as $match) {
|
foreach ($player_data['player_matches'] as $match) {
|
||||||
if (isset($_GET['filter_by_match_type'])) {
|
if (isset($_GET['filter_by_match_type'])) {
|
||||||
if ($match['matchType'] !== $_GET['filter_by_match_type']) {
|
if ($_GET['filter_by_match_type'] !== 'all' && $match['matchType'] !== $_GET['filter_by_match_type']) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
$date = new DateTime($match['createdAt']);
|
$date = new DateTime($match['createdAt']);
|
||||||
$date->modify('+2 hours');
|
$date->modify('+2 hours');
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,10 @@ error_reporting(E_ALL);
|
||||||
include './config/config.php';
|
include './config/config.php';
|
||||||
|
|
||||||
$players_data = json_decode(file_get_contents('./data/player_lifetime_data.json'), true);
|
$players_data = json_decode(file_get_contents('./data/player_lifetime_data.json'), true);
|
||||||
$selected_mode = isset($_POST['game_mode']) ? $_POST['game_mode'] : 'squad';
|
$selected_mode = isset($_GET['game_mode']) ? $_GET['game_mode'] : 'squad';
|
||||||
|
|
||||||
// Form to select game mode
|
// Form to select game mode
|
||||||
echo "<form method='post' action=''>
|
echo "<form method='get' action=''>
|
||||||
<input type='submit' name='game_mode' value='solo' class='btn'>
|
<input type='submit' name='game_mode' value='solo' class='btn'>
|
||||||
<input type='submit' name='game_mode' value='duo' class='btn'>
|
<input type='submit' name='game_mode' value='duo' class='btn'>
|
||||||
<input type='submit' name='game_mode' value='squad' class='btn'>
|
<input type='submit' name='game_mode' value='squad' class='btn'>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue