add leaderboard

This commit is contained in:
Vazelek
2022-10-19 13:23:55 +02:00
committed by Vazelek
parent 920b9235a1
commit a92540a094
3 changed files with 236 additions and 124 deletions

View File

@@ -37,8 +37,17 @@
.menu a.active, .menu p.active {
background-color: #a62020;
}*
.color-red{
color: #f03b3b;
}
.bold{
font-weight: bold;
}
.bolder{
font-weight: bolder;
text-decoration: underline;
}

View File

@@ -22,9 +22,10 @@ body{
}
.horizontal_menu a, .horizontal_menu p{
padding: 15px 0 15px 0;
padding: 2% 0 2% 0;
width: 16.666%;
text-align: center;
font-size: 1vw;
}
#logo{
@@ -55,6 +56,18 @@ hr{
/*vertical-align: middle;*/
}
.gold-leader{
background-image: url("../img/gold.jpg");
}
.silver-leader{
background-image: url("../img/silver.jpg");
}
.bronze-leader{
background-image: url("../img/bronze.jpg");
}
/* BRACKET section --------------------------------------------------------------------------------------------------------- */
.bracket{
@@ -234,7 +247,17 @@ table th, table td{
}
}
@media (max-width: 1150px) {
.menu a, menu p{
font-size: 1.5vw;
}
}
@media (max-width: 700px) {
.menu a, .menu p{
font-size: 2vw;
}
#main_container {
flex-direction: column;
align-items: center;
@@ -280,8 +303,4 @@ table th, table td{
overflow-x: scroll;
justify-content: flex-start;
}
.menu a, .menu p{
font-size: 12px;
}
}

View File

@@ -11,7 +11,6 @@
$db = new Database();
$sport = "";
if(isset($_GET["sport"])){
$sport = $_GET["sport"];
@@ -28,6 +27,8 @@
$matchs_semis = array();
$matchs_final = array();
$matchs_little_final = array();
if($sport != "leaderboard"){
if($sport == "badminton"){
$matchs_eight1 = array();
$matchs_eight2 = array();
@@ -149,6 +150,17 @@
array_push($teams_poules2, $team);
}
}
}
else{
$leader = array(
"A1" => array(0, 0, 0, 0, 0, 0, 0, 1),
"A2" => array(0, 0, 0, 0, 0, 0, 0, 5),
"A3" => array(0, 0, 0, 0, 0, 0, 0, 2),
"A4" => array(0, 0, 0, 0, 0, 0, 0, 4),
"A5" => array(0, 0, 0, 0, 0, 0, 0, 6),
"Permanents" => array(0, 0, 0, 0, 0, 0, 0, 3)
);
}
?>
<!DOCTYPE html>
@@ -187,7 +199,7 @@
<p id=\"group2-button\" class=\"bgcolor-btnprimary color-main\">Éliminatoires, groupe 2</p>
<p id=\"final-button\" class=\"bgcolor-btnprimary color-main\">Finales</p>";
}
else{
elseif($sport != "leaderboard"){
echo "<p id=\"group-phase-button\" class=\"bgcolor-btnprimary color-main active\">Phases de poule</p>
<p id=\"bracket-phase-button\" class=\"bgcolor-btnprimary color-main\">Phases éliminatoires</p>";
}
@@ -195,7 +207,7 @@
</div>
<?php
if($sport != "badminton"){
if($sport != "badminton" && $sport != "leaderboard"){
?>
<div class="frame bracket" id="bracket"> <!-- --------------------------------------------------------------------------------------------------- -->
@@ -456,7 +468,7 @@
<?php
}
else{
elseif($sport != "leaderboard"){
for($k = 1; $k < 3; $k++){
?>
@@ -874,6 +886,7 @@
<?php
}
if($sport != "leaderboard"){
?>
<div class="frame bgcolor-main" id="poules"> <!-- --------------------------------------------------------------------------------------------------- -->
@@ -982,6 +995,77 @@
</table>
</div>
<?php
}
else{
?>
<div class="frame bgcolor-main" id="poules">
<table class="color-main">
<thead>
<tr class="bgcolor-tableprimary">
<th class="bordercolor-main bold"></th>
<th class="bordercolor-main bold">Badminton</th>
<th class="bordercolor-main bold">Futsal</th>
<th class="bordercolor-main bold">Basket</th>
<th class="bordercolor-main bold">Handball</th>
<th class="bordercolor-main bold">Volley</th>
<th class="bordercolor-main bold">Bear & Run</th>
<th class="bordercolor-main bold">TOTAL</th>
<th class="bordercolor-main bolder color-red">Rang</th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
foreach($leader as $key => $values){
if($i % 2 == 0){
echo "<tr class=\"bgcolor-tablesecondary\">";
}
else{
echo "<tr class=\"bgcolor-tableprimary\">";
}
echo "<th class=\"bordercolor-main bold\">".$key."</th>";
$j = 0;
foreach($values as $val){
if($j != 7){
echo "<td class=\"bordercolor-main\">".$val."</td>";
}
else{
$rank = "";
switch($val){
case 1:
$rank = " gold-leader";
break;
case 2:
$rank = " silver-leader";
break;
case 3:
$rank = " bronze-leader";
break;
default:
break;
}
echo "<td class=\"bordercolor-main bold".$rank."\">#".$val."</td>";
}
$j++;
}
echo "</tr>";
$i++;
}
?>
</tbody>
</table>
</div>
<?php
}
?>
</div>
</div>
<input class="ButtonDayNight" type="image" src="public_html/img/DAYnNGH.png" onclick="switchDarkMode()" />