master #1

Merged
antux18 merged 9 commits from Antux/JeuPistesSarreguemines:master into jeu-pistes-sarreguemines 2024-09-01 15:37:45 +02:00
2 changed files with 5 additions and 5 deletions
Showing only changes of commit 559d42fff1 - Show all commits

Binary file not shown.

View File

@ -41,12 +41,12 @@
$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"];
$result = $stmt->fetch();
$order = $result["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) {
if (is_null($order)) {
echo "lol";
$order = rand(0, sizeof($pzorder));
$stmt = $database->pdo_teams->prepare("UPDATE teams SET pzorder = :order WHERE id == :id");
$stmt->bindValue(":id", $team_id);
@ -83,7 +83,7 @@
<article>
<p><?= $tr["puzzles"]["message"]?></p>
<ul>
<?php foreach ($pzorder[$order["pzorder"]] as $pzid) : ?>
<?php foreach ($pzorder[$order] as $pzid) : ?>
<?php foreach ($puzzles as $puzzle) : ?>
<?php if ($puzzle["id"] == $pzid) : ?>
<li><a href="article.php?team=<?= $team_id ?>&id=<?= $puzzle["id"] ?>"><?= $tr["page_title"]["article"] . $puzzle["id"] . " : " . $puzzle["title"] ?></a></li>