28 lines
870 B
PHP
28 lines
870 B
PHP
<?php
|
|
|
|
require_once "../config.php";
|
|
|
|
if (!isset($_SESSION["role"]))
|
|
require_once "../403.php";
|
|
|
|
$id = $_GET["id"];
|
|
$user = User::fromId($id);
|
|
|
|
if ($_SESSION["role"] != Role::ORGANIZER && $_SESSION["role"] != Role::ADMIN) {
|
|
if ($user->getId() != $_SESSION["user_id"] && ($user->getTeamId() == null || $user->getTeamId() != $_SESSION["user"]->getTeamId()))
|
|
require_once "../403.php";
|
|
}
|
|
|
|
if ($user === null) {
|
|
require_once "../404.php";
|
|
}
|
|
|
|
$team = Team::fromId($user->getTeamId());
|
|
|
|
$documents_req = $DB->query("SELECT * FROM `documents` WHERE `user` = $id;");
|
|
$tournaments_req = $DB->query("SELECT `tournament`, `name` FROM `organizers` JOIN `tournaments` ON `tournaments`.`id` = `tournament` WHERE `organizer` = $id ORDER BY `date_start`, `name`;");
|
|
|
|
require_once "../views/header.php";
|
|
require_once "../views/informations.php";
|
|
require_once "../views/footer.php";
|