2025-03-07 22:00:55 -05:00
|
|
|
function refreshDisplay() {
|
2025-03-07 22:20:28 -05:00
|
|
|
// Grab the division buttons by their name
|
2025-03-07 22:00:55 -05:00
|
|
|
var divisionButtons = document.getElementsByName("division");
|
|
|
|
var currentDivision = "";
|
|
|
|
|
2025-03-07 22:20:28 -05:00
|
|
|
// Loop through the division buttons and see which one is checked
|
|
|
|
// Set the current division to that option
|
2025-03-07 22:00:55 -05:00
|
|
|
for (var i = 0; i < divisionButtons.length; i++) {
|
|
|
|
if (divisionButtons[i].checked) {
|
|
|
|
currentDivision = divisionButtons[i].value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-03-07 22:20:28 -05:00
|
|
|
// If we set 'years' to all, then we should show all months too.
|
|
|
|
// This is effectively a "show all" setting
|
|
|
|
if (document.getElementById("year").value == "all") {
|
|
|
|
document.getElementById("month").value = "all";
|
|
|
|
}
|
2025-03-07 22:00:55 -05:00
|
|
|
|
2025-03-07 22:20:28 -05:00
|
|
|
// Grab the current division from the page
|
2025-03-07 22:00:55 -05:00
|
|
|
document.getElementById("divisionDisplay").innerHTML = currentDivision;
|
2025-03-07 22:20:28 -05:00
|
|
|
|
2025-03-07 22:00:55 -05:00
|
|
|
|
2025-03-07 22:20:28 -05:00
|
|
|
var html = ""; // placeholder for webpage
|
2025-03-07 22:00:55 -05:00
|
|
|
var image = ""; //get trophy image
|
|
|
|
html += "<div class=\"divisionPanel\">";
|
|
|
|
|
|
|
|
// Based on the selected division, show some results
|
|
|
|
if (currentDivision == "open") {
|
|
|
|
image = "/assets/trophy_open.png";
|
|
|
|
html += "<h2><img src=" + image + " class=\"lineImage\" alt=\"" + currentDivision + " division trophy\" style=\"float:left;\">Open<img src=" + image + " class=\"lineImage\" alt=\"" + currentDivision + " division trophy\" style=\"float:right;\"></h2>";
|
2025-03-08 11:40:06 -05:00
|
|
|
html += "<p class=\"smallerText\">Max Rank: SSL</p>"
|
2025-03-07 22:00:55 -05:00
|
|
|
} else if (currentDivision == "intermediate") {
|
|
|
|
image = "/assets/trophy_intermediate.png";
|
|
|
|
html += "<h2><img src=" + image + " class=\"lineImage\" alt=\"" + currentDivision + " division trophy\" style=\"float:left;\">Intermediate<img src=" + image + " class=\"lineImage\" alt=\"" + currentDivision + " division trophy\" style=\"float:right;\"></h2>";
|
2025-03-08 11:40:06 -05:00
|
|
|
html += "<p class=\"smallerText\">Max Rank: Champ 3</p>"
|
2025-03-07 22:00:55 -05:00
|
|
|
} else if (currentDivision == "main") {
|
|
|
|
image = "/assets/trophy_main.png";
|
|
|
|
html += "<h2><img src=" + image + " class=\"lineImage\" alt=\"" + currentDivision + " division trophy\" style=\"float:left;\">Main<img src=" + image + " class=\"lineImage\" alt=\"" + currentDivision + " division trophy\" style=\"float:right;\"></h2>";
|
2025-03-08 11:40:06 -05:00
|
|
|
html += "<p class=\"smallerText\">Max Rank: Plat 3</p>"
|
2025-03-07 22:00:55 -05:00
|
|
|
}
|
|
|
|
html += "<p>Top 10 Winners</p>"
|
|
|
|
html += "<hr class=\"tableLineLightCentre\">";
|
|
|
|
|
|
|
|
|
|
|
|
html += "<iframe src=\"/display/division_results.php?division=" + currentDivision + "&month=" + document.getElementById("month").value + "&year=" + document.getElementById("year").value + "\" name=\"divisionFrame\" class=\"divisionFrame\" id=\"divisionFrame\" onload=\"resizeIframe(this);\"></iframe>";
|
|
|
|
|
|
|
|
html += "</div>";
|
|
|
|
// TODO;
|
|
|
|
|
|
|
|
// CREATE OUTPUT DISPLAY
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById("divisionDisplay").innerHTML = html;
|
|
|
|
}
|