ChasseTresorPange/team_confirm.php
2023-09-01 19:44:54 -04:00

73 lines
1.9 KiB
PHP

<?php
require_once "require/base.php";
$team_id = -1;
$database = new Database();
if (isset($_GET["team"])) {
$team_id = htmlspecialchars($_GET["team"]);
// Vérification de l'existence du groupe :
$stmt = $database->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 {
// Recherche des membres du groupe :
$stmt = $database->pdo_teams->prepare("SELECT * FROM members WHERE team_id == :id");
$stmt->bindValue(":id", $team_id);
$stmt->execute();
$members = $stmt->fetchAll();
}
}
else {
header("Location: index.php");
die();
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<?php
require_once $rq_path . "head.php";
?>
<title><?= $tr["tab_title"]["team_confirm"] ?></title>
</head>
<body>
<header>
<?php
require_once $rq_path . "nav.php";
?>
</header>
<main>
<header>
<h1><?= $tr["page_title"]["team_confirm"] ?></h1>
<p><?= $tr["team_confirm"]["subtitle"] ?></p>
<p>
<?= $tr["team_confirm"]["message"] ?>
<?php foreach ($members as $member) : ?>
<?= $member[0] ?> &nbsp;
<?php endforeach; ?>
</p>
<a href="puzzles.php?team=<?= $team_id ?>">
<button><?= $tr["team_confirm"]["button"] ?></button>
</a>
</header>
<article>
</article>
</main>
<footer>
<?php
require_once $rq_path . "footer.php";
?>
</footer>
</body>
</html>