Skip to content

Commit

Permalink
Final game amendments for Euro 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshenderson12 committed Jul 17, 2024
1 parent 094a484 commit 080c8cf
Show file tree
Hide file tree
Showing 17 changed files with 632 additions and 252 deletions.
6 changes: 3 additions & 3 deletions admin/results.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@
<script>
$(document).ready(function () {
// Fetch data from JSON file
$.getJSON("../json/uefa-euro-2024-fixtures-ro16.json",
$.getJSON("../json/uefa-euro-2024-fixtures-final.json",
function (data) {
var fixture = '';
var x = 73;
var y = 74;
var x = 101;
var y = 102;
// Iterate through objects
$.each(data, function (key, value) {
var homeTeam = value.HomeTeam;
Expand Down
88 changes: 66 additions & 22 deletions dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,16 @@
<div class="card">
<div class="card-body">
<h5 class="card-title">Announcements</h5>
<p><strong>30/06/2024 12:10 Update:</strong><br>As you may have noticed, I've had a slight hiccup in processing the first knockout results. Rest assured all your predictions are retained in the database and hopefully things will be resolved shortly.</p>
<!-- <hr> -->
<!-- <p><strong>26/06/2024 23:21 Update:</strong><br>You can now <a href="predictions.php" title="Submit predictions">submit your predictions</a> for the 'Round of 16'. Please do so before 16.00 on <?= $GLOBALS['round_of_16_start_date'] ?> so you don't miss out!</p> -->
<p><strong>14/07/2024 22:37 Update:</strong></p><p class="alert alert-success">Congratulations to our winners Jonathan (1st), Paul (2nd), David (3rd), Ketan (4th) and Romina (5th).</span></p><p>I hope everyone enjoyed playing the game and thank you all for taking part and raising money for charity.</p>
<hr>
<p><strong>14/07/2024 19:33 Update:</strong><br>Tonight's final average score prediction is:<br>Spain <span class="badge bg-danger">1.79</span> vs <span class="badge bg-primary">1.43</span> England</p>
<!-- <p><strong>10/07/2024 22:16 Update:</strong><br>You can now <a href="predictions.php" title="Submit predictions">submit your prediction</a> for the Final! Please do so before 7pm on <?= $GLOBALS['final_start_date'] ?> so you don't miss out!</p> -->
<!-- <p><strong>02/07/2024 22:59 Update:</strong><br>You can now <a href="predictions.php" title="Submit predictions">submit your predictions</a> for the Semi-Finals. Please do so before 7pm on <?= $GLOBALS['semi_final_start_date'] ?> so you don't miss out!</p> -->
<hr>
<!-- <p><strong>02/07/2024 22:59 Update:</strong><br>You can now <a href="predictions.php" title="Submit predictions">submit your predictions</a> for the Quarter-Finals. Please do so before 16.00 on <?= $GLOBALS['quarter_final_start_date'] ?> so you don't miss out!</p> -->
<!-- <hr> -->
<!-- <p><strong>30/06/2024 12:10 Update:</strong><br>As you may have noticed, I've had a slight hiccup in processing the first knockout results. Rest assured all your predictions are retained in the database and hopefully things will be resolved shortly.</p>
<hr> -->
<p><strong>18/06/2024 22:03 Update:</strong><br>Prizes will be awarded as:</p>
<table class="table table-striped table-sm">
<tbody>
Expand Down Expand Up @@ -108,34 +114,35 @@
<div class="card-body">
<h5 class="card-title">Game Status</h5>
<?php displayTodaysFixtures() ?>
<?php checkSubmitted() ?>
<!-- <?php checkSubmitted() ?> -->
<?php displayMatchesRecorded() ?>
<div class="alert alert-light" role="alert">
<?php displayGroupMatchesPlayed() ?>
<?php displayRO16MatchesPlayed() ?>
<?php displayQFMatchesPlayed() ?>
<?php displaySFMatchesPlayed() ?>
<?php displayFinalMatchPlayed() ?>
</div>
<?php displayPayStatus() ?>
<!-- <p><i class="bi bi-envelope"></i> If you experience any issues, simply reply to your welcome email.</p> -->
</div>
</div>

<div class="row mt-4">
<div class="col-xxl-6 col-md-6">
<div class="card">
<div class="card-body">
<h5 class="card-title">Biggest Climbers</h5>
<?php displayBestMovers() ?>
<h5 class="card-title">Winners</h5>
<?php displayTopRankings() ?>
</div>
</div>
</div>

<div class="col-xxl-6 col-md-6">
<div class="card">
<div class="card-body">
<h5 class="card-title">Biggest Droppers</h5>
<?php displayWorstMovers() ?>
<h5 class="card-title">Bottom 5</h5>
<?php displayBottomRankings() ?>
</div>
</div>
</div>
Expand All @@ -145,17 +152,17 @@
<div class="col-xxl-6 col-md-6">
<div class="card">
<div class="card-body">
<h5 class="card-title">Current Top 5</h5>
<?php displayTopRankings() ?>
<h5 class="card-title">Biggest Climbers</h5>
<?php displayBestMovers() ?>
</div>
</div>
</div>

<div class="col-xxl-6 col-md-6">
<div class="card">
<div class="card-body">
<h5 class="card-title">Current Bottom 5</h5>
<?php displayBottomRankings() ?>
<h5 class="card-title">Biggest Droppers</h5>
<?php displayWorstMovers() ?>
</div>
</div>
</div>
Expand All @@ -165,16 +172,16 @@
<div class="col-xxl-12 col-md-6">
<div class="card">
<div class="card-body">
<h5 class="card-title">Anonymous Poll #02</h5>
<!-- <h5 class="card-title">Anonymous Poll #04</h5>
<div id="poll">
<h6 id="question"></h6><!-- class="p-3 mb-2 border border-danger border-2" -->
<div id="answers">
<!-- Answers will be dynamically added here -->
<h6 id="question"></h6> class="p-3 mb-2 border border-danger border-2"
<div id="answers">
Answers will be dynamically added here
</div>
<div id="results">
<!-- Results will be dynamically updated here -->
Results will be dynamically updated here
</div>
</div>
</div> -->
</div>
</div>
</div>
Expand All @@ -184,6 +191,43 @@
</div><!-- End Row -->

</section>

<!-- Modal for Badge Earning Congratulations -->
<div class="modal fade" id="congratsModal" tabindex="-1" role="dialog" data-bs-backdrop="static" data-bs-keyboard="false" aria-labelledby="congratsModalLabel" aria-hidden="true">
<div class="confetti-container">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="congratsModalLabel">Hendy's Hunches 2024 Winners!</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body text-center mt-3">
<i class="bi bi-check-circle-fill" style="font-size: 60px; color: green;"></i>
<h1>Congratulations!</h1>
<p class="fs-5"></p>
<p>Well played to our winners, the top 5, of Hendy's Hunches 2024.</p>
<img src="" class="w-25 img-fluid" alt="...">
<!--
<div class="row g-0 bg-body-secondary position-relative">
<div class="col-md-4 mb-md-0 p-md-4">
<img src="images/logos/vp-logo-sq.png" class="w-100" alt="...">
</div>
<div class="col-md-8 p-4 ps-md-0">
<i class="bi bi-check-circle-fill" style="font-size: 60px; color: green;"></i>
<h1>Congratulations!</h1>
<p class="fs-5">You've just earned yourself a badge for completing this episode!</p>
</div>
</div>-->
<p class="mt-3">I hope you all enjoyed this game and thank you once again for taking part and raising money for charity.</p>
</div>
<div class="modal-footer">
<!-- <button type="button" class="btn btn-secondary" data-dismiss="modal">No</button> -->
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" aria-label="Close" id=""><i class="bi bi-arrow-right"></i> Continue</button>
</div>
</div>
</div>
</div>
</div>

</main>

Expand Down Expand Up @@ -216,7 +260,7 @@ function vote(answerId) {
},
body: 'answerId=' + answerId
}).then(() => {
localStorage.setItem("hasVotedPoll02", true);
localStorage.setItem("hasVotedPoll04", true);
disableVoting();
fetchPollData(); // Refresh poll data after voting
});
Expand All @@ -226,7 +270,7 @@ function renderPoll(data) {
const question = data[0].question;
document.getElementById("question").textContent = question;
const answersDiv = document.getElementById("answers");
const hasVoted = localStorage.getItem("hasVotedPoll02");
const hasVoted = localStorage.getItem("hasVotedPoll04");
answersDiv.innerHTML = ""; // Clear previous answers
if (hasVoted) {
answersDiv.innerHTML = "<p><i class='bi bi-check-circle-fill text-success'></i> You have voted on this poll.</p>";
Expand Down Expand Up @@ -255,7 +299,7 @@ function updateResults(data) {
data.forEach(answer => {
const resultElem = document.createElement("div");
resultElem.innerHTML = `
<div class="progress" style="height: 40px">
<div class="progress" style="height: 30px">
<div class="progress-bar bg-info" role="progressbar" style="width: ${(answer.count / totalVotes) * 100}%" aria-valuenow="${answer.count}" aria-valuemin="0" aria-valuemax="${totalVotes}"></div>
</div>
<p style="text-align: right;">${answer.answer}: <strong>${answer.count}</strong></p>
Expand Down
8 changes: 4 additions & 4 deletions json/uefa-euro-2024-fixtures-final.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"RoundNumber": "Final",
"DateUtc": "2024-07-14 20:00",
"Location": "Berlin",
"HomeTeam": "W49",
"AwayTeam": "W50",
"HomeTeamScore": null,
"AwayTeamScore": null
"HomeTeam": "Spain",
"AwayTeam": "England",
"HomeTeamScore": 2,
"AwayTeamScore": 1
}
]
16 changes: 8 additions & 8 deletions json/uefa-euro-2024-fixtures-quarters.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"Location": "Stuttgart",
"HomeTeam": "Spain",
"AwayTeam": "Germany",
"HomeTeamScore": null,
"AwayTeamScore": null
"HomeTeamScore": 1,
"AwayTeamScore": 1
},
{
"MatchNumber": 46,
Expand All @@ -16,8 +16,8 @@
"Location": "Hamburg",
"HomeTeam": "Portugal",
"AwayTeam": "France",
"HomeTeamScore": null,
"AwayTeamScore": null
"HomeTeamScore": 0,
"AwayTeamScore": 0
},
{
"MatchNumber": 48,
Expand All @@ -26,8 +26,8 @@
"Location": "Dusseldorf",
"HomeTeam": "England",
"AwayTeam": "Switzerland",
"HomeTeamScore": null,
"AwayTeamScore": null
"HomeTeamScore": 1,
"AwayTeamScore": 1
},
{
"MatchNumber": 47,
Expand All @@ -36,7 +36,7 @@
"Location": "Berlin",
"HomeTeam": "Netherlands",
"AwayTeam": "Türkiye",
"HomeTeamScore": null,
"AwayTeamScore": null
"HomeTeamScore": 2,
"AwayTeamScore": 1
}
]
16 changes: 8 additions & 8 deletions json/uefa-euro-2024-fixtures-semis.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"RoundNumber": "SF",
"DateUtc": "2024-07-09 20:00",
"Location": "Munich",
"HomeTeam": "W45",
"AwayTeam": "W46",
"HomeTeamScore": null,
"AwayTeamScore": null
"HomeTeam": "Spain",
"AwayTeam": "France",
"HomeTeamScore": 2,
"AwayTeamScore": 1
},
{
"MatchNumber": 50,
"RoundNumber": "SF",
"DateUtc": "2024-07-10 20:00",
"Location": "Dortmund",
"HomeTeam": "W47",
"AwayTeam": "W48",
"HomeTeamScore": null,
"AwayTeamScore": null
"HomeTeam": "Netherlands",
"AwayTeam": "England",
"HomeTeamScore": 1,
"AwayTeamScore": 2
}
]
2 changes: 1 addition & 1 deletion php/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

$acronym = "HH";
$title = "Hendy's Hunches";
$version = "v2.9.3";
$version = "v2.10.2";
$year = "2024";
$last_update = "15/06/2024";
$base_url = "https://www.hendyshunches.co.uk";
Expand Down
Loading

0 comments on commit 080c8cf

Please sign in to comment.