From a0e3ba8c091a91b4babe81f3ee97769d20a9e66f Mon Sep 17 00:00:00 2001 From: antux18 Date: Tue, 13 Feb 2024 13:21:03 +0100 Subject: [PATCH] =?UTF-8?q?D=C3=A9but=20impl=C3=A9mentation=20de=20l'ordre?= =?UTF-8?q?=20des=20=C3=A9nigmes=20(pas=20fonctionnel).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/teams.db | Bin 45056 -> 45056 bytes puzzles.php | 26 ++++++++++++++++++++++++-- require/base.php | 1 + require/puzzles_order.php | 9 +++++++++ 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 require/puzzles_order.php diff --git a/data/teams.db b/data/teams.db index 123a93a29d5b2b32d7984ab5e6f04e492b7e7d84..e39bdfb4123feff8722dac5985ae41e83c608681 100644 GIT binary patch delta 232 zcmZp8z|`=7X@az17y|Ey1>i(j)9f8g@NxQe;RKKUpAiu zuOqMHWaBKxR}vFV3GjaW;TNl{9;_p;*4Nj zOuRtXF!6t5;Q!74Z8M|8D}D}UCT0c(W=7`C|MHmxB!JQ&zyicvKn(H(2M{v@)xMCQ MB*3znrQwf00B689QUCw| delta 212 zcmZp8z|`=7X@az%KLY~;HxRP}F)I+uP1G@#_Gi#5TExryj)9f8g_-Xoe;RKKA3NVM zzG}Ye&4vP8ypvmavsn1586+nexecute(); $puzzles = $stmt->fetchAll(); + + // Recherche de l'ordre des énigmes : + $stmt = $database->pdo_teams->prepare("SELECT pzorder FROM teams WHERE id == :id"); + $stmt->bindValue(":id", $team_id); + $stmt->execute(); + $order = $stmt->fetch(); + + echo (string) $order["pzorder"]; + + // Si un ordre d'énigmes n'a pas été défini au préalable pour cette équipe, on en choisit un au hasard : + if ($order == NULL) { + $order = rand(0, sizeof($pzorder)); + $stmt = $database->pdo_teams->prepare("UPDATE teams SET pzorder = :order WHERE id == :id"); + $stmt->bindValue(":id", $team_id); + $stmt->bindValue(":order", $order); + $stmt->execute(); + } } } @@ -65,8 +83,12 @@

    - -
  • ">
  • + + + +
  • ">
  • + +
diff --git a/require/base.php b/require/base.php index 7c2d9d7..0edc066 100644 --- a/require/base.php +++ b/require/base.php @@ -1,5 +1,6 @@ \ No newline at end of file