ChasseTresorPange/team_confirm.php

69 lines
1.8 KiB
PHP
Raw Normal View History

<?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 :
if ($database->checkTeamExists($team_id)) {
// 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();
}
}
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>
<h2><?= $tr["team_confirm"]["subtitle"] ?></h2>
</header>
<article>
<p>
<?= $tr["team_confirm"]["message"] ?>
<?php foreach ($members as $member) : ?>
2023-09-03 22:11:05 +02:00
<?= $member[0] ?>,
<?php endforeach; ?>
</p>
<a href="puzzles.php?team=<?= $team_id ?>">
<button><?= $tr["team_confirm"]["button"] ?></button>
</a>
</article>
</main>
<footer>
<?php
require_once $rq_path . "footer.php";
?>
</footer>
</body>
</html>