plateforme-tfjm2/server_files/controllers/informations.php

24 lines
807 B
PHP
Raw Normal View History

2019-09-06 11:48:50 +00:00
<?php
if (!isset($_SESSION["role"]))
require_once "server_files/403.php";
2019-09-06 11:48:50 +00:00
$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 "server_files/403.php";
}
2019-09-06 11:48:50 +00:00
if ($user === null) {
require_once "server_files/404.php";
2019-09-06 11:48:50 +00:00
}
$team = Team::fromId($user->getTeamId());
2019-09-06 11:48:50 +00:00
$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 "server_files/views/informations.php";