Clan info updated with clanmembers and clickable to latest matches #123
3 changed files with 25 additions and 24 deletions
|
|
@ -1,12 +1,7 @@
|
|||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<?php include './includes/head.php'; ?>
|
||||
|
||||
<body>
|
||||
|
||||
<?php include './includes/navigation.php'; ?>
|
||||
|
|
@ -21,6 +16,8 @@ error_reporting(E_ALL);
|
|||
|
||||
// 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)) {
|
||||
|
|
@ -29,6 +26,10 @@ error_reporting(E_ALL);
|
|||
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>";
|
||||
|
|
@ -43,4 +44,5 @@ error_reporting(E_ALL);
|
|||
<?php include './includes/footer.php'; ?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -10,7 +10,6 @@
|
|||
"SquadKiller101",
|
||||
"Pettie1972",
|
||||
"HeteKip",
|
||||
"Shepherders",
|
||||
"WackyJacky101"
|
||||
"Shepherders"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ error_reporting(E_ALL);
|
|||
|
||||
$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
|
||||
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='duo' class='btn'>
|
||||
<input type='submit' name='game_mode' value='squad' class='btn'>
|
||||
|
|
@ -35,7 +35,7 @@ error_reporting(E_ALL);
|
|||
</form><br>";
|
||||
|
||||
// Buttons for each player
|
||||
echo "<form method='post' action=''>";
|
||||
echo "<form method='get' action=''>";
|
||||
foreach ($players_data[$selected_mode] as $player_name => $player_details) {
|
||||
echo "<button type='submit' name='selected_player' value='$player_name' class='btn' >$player_name</button>";
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ error_reporting(E_ALL);
|
|||
echo "<input type='hidden' name='game_mode' value='$selected_mode'>";
|
||||
echo "</form><br>";
|
||||
|
||||
$selected_player = $_POST['selected_player'] ?? array_key_first($players_data[$selected_mode]);
|
||||
$selected_player = $_GET['selected_player'] ?? array_key_first($players_data[$selected_mode]);
|
||||
|
||||
// Fetch the player stats based on game mode and selected player
|
||||
if (isset($players_data[$selected_mode][$selected_player])) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue