plateforme-tfjm2/server_files/views/header.php

108 lines
5.4 KiB
PHP

<!DOCTYPE html>
<html lang="fr">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Site d'inscription pour le TFJM² <?= $YEAR ?></title>
<link rel="stylesheet" type="text/css" href="/style.css"/>
<link REL="shortcut icon" href="/favicon.ico"/>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<div class="container.fluid bg-light">
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container">
<a class="navbar-brand" href="/">
<img src="/logo.svg" alt="Logo TFJM²" id="navbar-logo">
</a>
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a href="/" class="nav-link">Accueil</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/tournois">Liste des tournois</a>
</li>
<?php if (isset($_SESSION["user_id"])) { ?>
<li class="nav-item active">
<a class="nav-link" href="/mon_compte">Mon compte</a>
</li>
<?php if ($_SESSION["role"] == Role::ENCADRANT || $_SESSION["role"] == Role::PARTICIPANT) { ?>
<?php if ($_SESSION["team"] == NULL) { ?>
<li class="nav-item active">
<a class="nav-link" href="/ajouter_equipe">Ajouter une équipe</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/rejoindre_equipe">Rejoindre une équipe</a>
</li>
<?php } else { ?>
<li class="nav-item active">
<a class="nav-link" href="/mon_equipe">Mon équipe</a>
</li>
<?php if ($_SESSION["team"]->getValidationStatus() == ValidationStatus::VALIDATED || true) { ?>
<li class="nav-item active">
<a class="nav-link" href="https://paypal.me/galaxyoyo42">Paiement</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/solutions">Solutions</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/syntheses">Notes de synthèse</a>
</li>
<?php } ?>
<?php } ?>
<?php } ?>
<?php if ($_SESSION["role"] == Role::ADMIN) { ?>
<li class="nav-item active">
<a class="nav-link" href="/ajouter_tournoi">Ajouter un tournoi</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/ajouter_organisateur">Ajouter un organisateur</a>
</li>
<?php } ?>
<?php if ($_SESSION["role"] == Role::ADMIN || $_SESSION["role"] == Role::ORGANIZER) { ?>
<li class="nav-item active">
<a class="nav-link" href="/solutions_orga">Solutions</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/syntheses_orga">Notes de synthèse</a>
</li>
<?php } ?>
<?php } ?>
</ul>
<ul class="navbar-nav">
<?php if (!isset($_SESSION["user_id"])) { ?>
<li class="nav-item active">
<a class="nav-link" href="/connexion">Connexion</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/inscription">Inscription</a>
</li>
<?php } else { ?>
<?php
if ($_SESSION["role"] != Role::ADMIN) {
echo "<li><a class=\"nav-link\" href=\"?be-admin=1\">Devenir administrateur</a></li>\n";
}
if ($_SESSION["role"] != Role::ORGANIZER) {
echo "<li><a class=\"nav-link\" href=\"?be-organizer=1\">Devenir organisateur</a></li>\n";
}
if ($_SESSION["role"] != Role::PARTICIPANT) {
echo "<li><a class=\"nav-link\" href=\"?be-participant=1\">Devenir participant</a></li>\n";
}
if ($_SESSION["role"] != Role::ENCADRANT) {
echo "<li><a class=\"nav-link\" href=\"?be-encadrant=1\">Devenir encadrant</a></li>\n";
}
?>
<li class="nav-item active">
<a class="nav-link" href="/deconnexion">Déconnexion</a>
</li>
<?php } ?>
</ul>
</nav>
</div>
</div>
<div class="container">