Ajout du masquage de l'énigme bonus si les 12 énigmes ne sont pas réussies.
11
answer.php
@ -56,6 +56,17 @@
|
||||
$stmt->bindValue(":puzzle_id", $art_id);
|
||||
$stmt->bindValue(":team_id", $team_id);
|
||||
$stmt->execute();
|
||||
|
||||
// On ajoute l'énigme bonus si toutes les autres sont résolues :
|
||||
$stmt = $database->pdo_teams->prepare("SELECT COUNT(*) FROM solved WHERE team_id == :team_id");
|
||||
$stmt->bindValue(":team_id", $team_id);
|
||||
$stmt->execute();
|
||||
|
||||
if ($stmt->fetchAll()[0]["COUNT(*)"] == "12") { // Il y a 12 énigmes sans compter la bonus
|
||||
$stmt = $database->pdo_teams->prepare("UPDATE teams SET bonus = 1 WHERE id = :team_id");
|
||||
$stmt->bindValue(":team_id", $team_id);
|
||||
$stmt->execute();
|
||||
}
|
||||
}
|
||||
|
||||
$data["valid_qr"] = true;
|
||||
|
BIN
data/article.db
BIN
data/teams.db
BIN
images/phqr1.gif
Before Width: | Height: | Size: 725 B |
BIN
images/phqr2.gif
Before Width: | Height: | Size: 743 B |
BIN
images/qr/qr1.gif
Normal file
After Width: | Height: | Size: 740 B |
BIN
images/qr/qr10.gif
Normal file
After Width: | Height: | Size: 740 B |
BIN
images/qr/qr11.gif
Normal file
After Width: | Height: | Size: 755 B |
BIN
images/qr/qr12.gif
Normal file
After Width: | Height: | Size: 731 B |
BIN
images/qr/qr13.gif
Normal file
After Width: | Height: | Size: 737 B |
BIN
images/qr/qr2.gif
Normal file
After Width: | Height: | Size: 738 B |
BIN
images/qr/qr3.gif
Normal file
After Width: | Height: | Size: 750 B |
BIN
images/qr/qr4.gif
Normal file
After Width: | Height: | Size: 751 B |
BIN
images/qr/qr5.gif
Normal file
After Width: | Height: | Size: 735 B |
BIN
images/qr/qr6.gif
Normal file
After Width: | Height: | Size: 741 B |
BIN
images/qr/qr7.gif
Normal file
After Width: | Height: | Size: 747 B |
BIN
images/qr/qr8.gif
Normal file
After Width: | Height: | Size: 743 B |
BIN
images/qr/qr9.gif
Normal file
After Width: | Height: | Size: 745 B |
15
puzzles.php
@ -20,7 +20,20 @@
|
||||
}
|
||||
|
||||
else {
|
||||
$stmt = $database->pdo_article->prepare("SELECT * FROM puzzles");
|
||||
// On vérifie si l'équipe a débloqué l'énigme bonus :
|
||||
$stmt = $database->pdo_teams->prepare("SELECT * FROM teams WHERE id = :id");
|
||||
$stmt->bindValue(":id", $team_id);
|
||||
$stmt->execute();
|
||||
|
||||
// Si c'est le cas, on affiche toutes les énigmes, sinon, on cache la bonus :
|
||||
if ($stmt->fetchAll()[0][0] == 1) {
|
||||
$stmt = $database->pdo_article->prepare("SELECT * FROM puzzles");
|
||||
}
|
||||
|
||||
else {
|
||||
$stmt = $database->pdo_article->prepare("SELECT * FROM puzzles WHERE id <> 13");
|
||||
}
|
||||
|
||||
$stmt->execute();
|
||||
$puzzles = $stmt->fetchAll();
|
||||
}
|
||||
|