Fin implémentation ordre des énigmes.
This commit is contained in:
parent
a0e3ba8c09
commit
559d42fff1
BIN
data/teams.db
BIN
data/teams.db
Binary file not shown.
10
puzzles.php
10
puzzles.php
@ -41,12 +41,12 @@
|
|||||||
$stmt = $database->pdo_teams->prepare("SELECT pzorder FROM teams WHERE id == :id");
|
$stmt = $database->pdo_teams->prepare("SELECT pzorder FROM teams WHERE id == :id");
|
||||||
$stmt->bindValue(":id", $team_id);
|
$stmt->bindValue(":id", $team_id);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$order = $stmt->fetch();
|
$result = $stmt->fetch();
|
||||||
|
$order = $result["pzorder"];
|
||||||
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 :
|
// 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));
|
$order = rand(0, sizeof($pzorder));
|
||||||
$stmt = $database->pdo_teams->prepare("UPDATE teams SET pzorder = :order WHERE id == :id");
|
$stmt = $database->pdo_teams->prepare("UPDATE teams SET pzorder = :order WHERE id == :id");
|
||||||
$stmt->bindValue(":id", $team_id);
|
$stmt->bindValue(":id", $team_id);
|
||||||
@ -83,7 +83,7 @@
|
|||||||
<article>
|
<article>
|
||||||
<p><?= $tr["puzzles"]["message"]?></p>
|
<p><?= $tr["puzzles"]["message"]?></p>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($pzorder[$order["pzorder"]] as $pzid) : ?>
|
<?php foreach ($pzorder[$order] as $pzid) : ?>
|
||||||
<?php foreach ($puzzles as $puzzle) : ?>
|
<?php foreach ($puzzles as $puzzle) : ?>
|
||||||
<?php if ($puzzle["id"] == $pzid) : ?>
|
<?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>
|
<li><a href="article.php?team=<?= $team_id ?>&id=<?= $puzzle["id"] ?>"><?= $tr["page_title"]["article"] . $puzzle["id"] . " : " . $puzzle["title"] ?></a></li>
|
||||||
|
Loading…
Reference in New Issue
Block a user