tabella per classifica completa di tutte le partite

This commit is contained in:
2026-04-01 11:56:41 +02:00
parent f92408b875
commit e5bfbc04ad
3 changed files with 70 additions and 18 deletions
+19
View File
@@ -0,0 +1,19 @@
body {
font-family: "Arial";
}
table, h1 {
margin: auto;
}
h1 {
text-align: center;
padding: 15px;
}
table {
width: 75vw;
text-align: center;
border-collapse: collapse;
}
th, td {
padding: 10px;
border: 1px solid black;
}
+16 -18
View File
@@ -4,31 +4,29 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Classifica completa</title>
<style>
body {
font-family: "Arial";
}
table {
border-collapse: collapse;
}
td {
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="classifica.css">
</head>
<body>
<h1>Classifica</h1>
<table>
<thead>
<tr>
<td>Posizione</td>
<td>Nome</td>
<td>Punteggio 1° fase</td>
<td>Punteggio 2° fase</td>
<td>Punteggio totale</td>
<td>Data di gioco</td>
<th>Posizione</th>
<th>Nome</th>
<th>Punteggio 1° fase</th>
<th>Punteggio 2° fase</th>
<th>Punteggio totale</th>
<th>Data di gioco</th>
</tr>
</thead>
<tbody>
<?php
require 'db.php';
foreach ($db_test as $posizione => $record) {
riga($posizione, $record);
}
?>
</tbody>
</table>
</body>
</html>
+35
View File
@@ -0,0 +1,35 @@
<?php
$debug = false;
function setDebug($val) {
$debug = $val;
if ($debug) {
echo "db";
}
}
$db_test = [
[
'nome' => 's1',
'p1' => 95,
'p2' => 90,
'pt' => 50,
'g' => '24-11-2025'
],
[
'nome' => 's1',
'p1' => 95,
'p2' => 90,
'pt' => 50,
'g' => '24-11-2025'
]
];
$classifica = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
function riga($pos, $data) {
$pos++;
$nome = $data['nome'];
$p1 = $data['p1'];
$p2 = $data['p2'];
$pt = $data['pt'];
$g = $data['g'];
echo '<tr><td>'.$pos.'</td><td>'.$nome.'</td><td>'.$p1.'</td><td>'.$p2.'</td><td>'.$pt.'</td><td>'.$g.'</td></tr>';
}
?>