Match info

"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" ); // Check if a match ID is provided in the GET request if (isset($_GET['matchid'])) { $matchId = $_GET['matchid']; $filename = "data/matches/" . $matchId . ".json"; // Check if the JSON file for the given match ID exists if (file_exists($filename)) { // Read and decode the JSON file $jsonData = json_decode(file_get_contents($filename), true); $matchinfo = $jsonData['data']['attributes']; $matchdata = $jsonData['data']; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
matchTypegameModedurationmapNamecreatedAtid
" . htmlspecialchars($matchinfo['matchType']) . "" . htmlspecialchars($matchinfo['gameMode']) . "" . htmlspecialchars($matchinfo['duration']) . "" . htmlspecialchars(isset($mapNames[$matchinfo['mapName']]) ? $mapNames[$matchinfo['mapName']] : $matchinfo['mapName']) . "" . htmlspecialchars($matchinfo['createdAt']) . "" . htmlspecialchars($matchdata['id']) . "
"; echo ""; echo ""; $directory = 'data/killstats/'; $prefix = $matchdata['id']; $files = glob($directory . $prefix . '*'); foreach ($files as $file) { $jsonData_individual_player = json_decode(file_get_contents($file), true); $individualPlayerName = $jsonData_individual_player['stats']['playername']; // Search for the player in $jsonData['included'] to find damageDealt $damageDealt = 0; foreach ($jsonData['included'] as $includedItem) { if ($includedItem['type'] == "participant") { $playerStats = $includedItem['attributes']['stats']; if ($individualPlayerName == $playerStats['name']) { $damageDealt = $playerStats['damageDealt']; break; // Stop searching once the player is found } } } echo ""; echo ""; echo ""; echo ""; echo ""; // Display damageDealt here echo ""; } echo "
Player Name Kills humankills
" . htmlspecialchars($individualPlayerName) . "" . htmlspecialchars($jsonData_individual_player['stats']['humankills']) . "" . htmlspecialchars($jsonData_individual_player['stats']['kills']) . "" . htmlspecialchars($damageDealt) . "
"; echo ""; echo ""; foreach ($jsonData['included'] as $includedItem) { if ($includedItem['type'] == "participant") { $playerStats = $includedItem['attributes']['stats']; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } echo "
Player Name Kills Damage Dealt Time Survived Rank Revives Longest Kill DBNOs Headshot Kills Assists
" . htmlspecialchars($playerStats['name']) . "" . htmlspecialchars($playerStats['kills']) . "" . htmlspecialchars($playerStats['damageDealt']) . "" . htmlspecialchars($playerStats['timeSurvived']) . "" . htmlspecialchars($playerStats['winPlace']) . "" . htmlspecialchars($playerStats['revives']) . "" . htmlspecialchars($playerStats['longestKill']) . "" . htmlspecialchars($playerStats['DBNOs']) . "" . htmlspecialchars($playerStats['headshotKills']) . "" . htmlspecialchars($playerStats['assists']) . "
"; } else { echo "JSON file not found for the given match ID."; } } else { echo "No match ID provided."; } ?>