Update partie_controleur.php, config-bd.php, script_migration_data.sql, menu.php, and parties_vue.php files

This commit is contained in:
Morph01
2024-04-08 22:44:54 +02:00
parent 2a9a2f3256
commit 05b71d7108
5 changed files with 100 additions and 39 deletions

View File

@@ -0,0 +1,3 @@
<?php if (isset($_POST['boutonAfficher'])) {
$partie = get_infos_instances('partie');
} ?>

View File

@@ -3,6 +3,6 @@
define('SERVEUR', 'localhost');
define('UTILISATEUR', 'p2203977'); // votre login
define('MOTDEPASSE', 'Canon63Quote'); // votre mot de passe
define('BDD', 'donnees_fournies'); // votre BD
define('BDD', 'p2203977'); // votre BD
?>

View File

@@ -108,6 +108,41 @@ SELECT
FROM
donnees_fournies.classement_equipe;
CREATE TEMPORARY TABLE unique_plateau AS
SELECT id_partie AS idplateau, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
FROM donnees_fournies.instances1
GROUP BY c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12;
INSERT INTO plateau (idplateau, taille)
SELECT idplateau, 12 FROM unique_plateau;
INSERT INTO est_compose (idcarte, idplateau, rang)
SELECT c1, idplateau, 1 FROM unique_plateau
UNION ALL
SELECT c2, idplateau, 2 FROM unique_plateau
UNION ALL
SELECT c3, idplateau, 3 FROM unique_plateau
UNION ALL
SELECT c4, idplateau, 4 FROM unique_plateau
UNION ALL
SELECT c5, idplateau, 5 FROM unique_plateau
UNION ALL
SELECT c6, idplateau, 6 FROM unique_plateau
UNION ALL
SELECT c7, idplateau, 7 FROM unique_plateau
UNION ALL
SELECT c8, idplateau, 8 FROM unique_plateau
UNION ALL
SELECT c9, idplateau, 9 FROM unique_plateau
UNION ALL
SELECT c10, idplateau, 10 FROM unique_plateau
UNION ALL
SELECT c11, idplateau, 11 FROM unique_plateau
UNION ALL
SELECT c12, idplateau, 12 FROM unique_plateau;
INSERT INTO
`partie` (
`idpartie`,
@@ -129,11 +164,11 @@ SELECT DISTINCT
WHEN 'AV' THEN 'a venir'
WHEN 'EC' THEN 'en cours'
END,
NULL,
p.idplateau,
NULL,
NULL
FROM
donnees_fournies.instances1;
donnees_fournies.instances1 JOIN unique_plateau p USING(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12);
INSERT INTO
`participe` (
@@ -301,40 +336,4 @@ GROUP BY
`id_joueur`,
`carteAvalider`;
SET @row_number = 0;
CREATE TEMPORARY TABLE unique_plateau AS
SELECT @row_number:=@row_number+1 AS idplateau, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
FROM donnees_fournies.instances1
GROUP BY c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12;
INSERT INTO plateau (idplateau, taille)
SELECT idplateau, 12 FROM unique_plateau;
INSERT INTO est_compose (idcarte, idplateau, rang)
SELECT c1, idplateau, 1 FROM unique_plateau
UNION ALL
SELECT c2, idplateau, 2 FROM unique_plateau
UNION ALL
SELECT c3, idplateau, 3 FROM unique_plateau
UNION ALL
SELECT c4, idplateau, 4 FROM unique_plateau
UNION ALL
SELECT c5, idplateau, 5 FROM unique_plateau
UNION ALL
SELECT c6, idplateau, 6 FROM unique_plateau
UNION ALL
SELECT c7, idplateau, 7 FROM unique_plateau
UNION ALL
SELECT c8, idplateau, 8 FROM unique_plateau
UNION ALL
SELECT c9, idplateau, 9 FROM unique_plateau
UNION ALL
SELECT c10, idplateau, 10 FROM unique_plateau
UNION ALL
SELECT c11, idplateau, 11 FROM unique_plateau
UNION ALL
SELECT c12, idplateau, 12 FROM unique_plateau;
COMMIT;

View File

@@ -3,4 +3,5 @@
<a href="index.php">Accueil</a>
<a href="index.php?page=statistiques">Afficher Statistiques</a>
<a href="index.php?page=tables">Afficher Table</a>
<a href="index.php?page=parties">Afficher Parties</a>
</nav>

58
vues/parties_vue.php Normal file
View File

@@ -0,0 +1,58 @@
<div class="panneau_details"> <!-- Second bloc permettant l'affichage du détail d'une table -->
<h2>Affichage des parties</h2>
<form class="bloc_commandes" method="post" action="#">
<label for="typeVueTable">Voir Parties</label>
<?php
$selection = 1;
if (isset($_POST['selectparty'])) {
$selection = (int) $_POST["selectparty"];
}
echo '<select id="selectpartie" name="selectparty">';
for ($i = 1; $i <= 50; $i++) {
echo '<option value="' . $i . '"';
if ($i == $selection) {
echo ' selected';
}
echo '>Partie n°' . $i . '</option>';
}
?>
<input type="submit" name="boutonAfficher" value="Afficher" />
</form>
<div>
<table class="table_resultat">
<tbody>
<?php
if (isset($_POST['boutonAfficher'])) {
// foreach ($partie['instances'][(int) $_POST["selectparty"]] as $row) { // pour parcourir les n-uplets
// echo '<tr>';
// echo $row;
// echo "-";
// echo '</tr>';
// }
$donnees = ['idpartie', 'date_partie', 'horaire'];
$parties = $partie['instances'][(int) $_POST["selectparty"] - 1];
echo '<a href="https://bdw.univ-lyon1.fr/p2203977/DeezCycle/index.php?';
foreach ($donnees as $donnee) {
echo $donnee . '=' . $parties[$donnee] . '&';
}
echo 'taille=12">Voir les détails de la partie</a>';
/*
echo "Partie n°" . $parties["idpartie"] . "<br/>";
echo $parties["idpartie"]."_".$parties["date_partie"]."_".$parties[";*/
} else {
echo "<h1>Selectionnez une partie !</h1>";
}
?>
</tbody>
</table>
</div>
</div>