plateforme-tfjm2/server_files/controllers/informations.php

26 lines
887 B
PHP
Raw Normal View History

2019-09-06 11:48:50 +00:00
<?php
require_once "../config.php";
if (!isset($_SESSION["role"]) || $_SESSION["role"] != "ORGANIZER" && $_SESSION["role"] != "ADMIN") {
require_once "../403.php";
}
$id = $_GET["id"];
$user_data = $DB->query("SELECT * FROM `users` WHERE `id` = $id;")->fetch();
if ($user_data === false) {
require_once "../404.php";
}
$team_data = false;
if ($user_data["team_id"] !== NULL)
$team_data = $DB->query("SELECT `name`, `trigram` FROM `teams` WHERE `id` = " . $user_data["team_id"] . ";")->fetch();
$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";