JeuPistesSarreguemines/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>
<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>