= $tr["page_title"]["puzzles"] . $team_id ?>
= $tr["puzzles"]["message"]?>
pdo_teams->prepare("SELECT * FROM teams WHERE id == :id"); $stmt->bindValue(":id", $team_id); $stmt->execute(); if (empty($stmt->fetch())) { header("Location: index.php"); die(); } else { // On crée un cookie pour enregistrer l'équipe sélectionnée : setcookie( "team", $team_id, time() + (365 * 24 * 60 * 60), "/", "", false, false ); // 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 : if ($stmt->fetchAll()[0][1] == 1) { $stmt = $database->pdo_article->prepare("SELECT * FROM puzzles"); } // Sinon, on cache la bonus : else { $stmt = $database->pdo_article->prepare("SELECT * FROM puzzles WHERE id <> 13"); } $stmt->execute(); $puzzles = $stmt->fetchAll(); } } else { header("Location: index.php"); die(); } ?>
= $tr["puzzles"]["message"]?>