1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2024-12-26 18:22:21 +00:00
plateforme-corres2math/server_files/views/header.php

155 lines
7.9 KiB
PHP

<?php $CONFIG->incrViews() ?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="description" content="Inscrivez-vous pour les Correspondances des Jeunes Mathématicien·ne·s <?= $YEAR . " - " . ($YEAR + 1) ?> !">
<meta name="keywords" content="Correspondances,Jeunes,Mathématicien·ne·s,Mathématiciens,Mathématiciennes,Corres2Math,Inscription,TFJM²,TFJM">
<meta name="author" content="Yohann D'ANELLO (yohann.danello[at]animath.fr)">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="google-site-verification" content="nTgyZnU1Uw0OYaAX-TMg-5hVIKkeKAYtj2sNQRDz_sQ">
<title>Site d'inscription pour les Correspondances des Jeunes Mathématicien·ne·s <?= $YEAR . " - " . ($YEAR + 1) ?></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="https://correspondances-maths.fr/" target="_blank">
<img src="/logo.png" alt="Logo Corres2Mat" id="navbar-logo">
</a>
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="/">Accueil</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/calendrier">Calendrier</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 || $_SESSION["role"] == Role::ENCADRANT) {
if (date("Y-m-d H:i:s") < $CONFIG->getInscriptionDate()) { ?>
<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 }
}
{
/**
* @var Team $_team
*/
foreach ($_SESSION["teams"] as $_team) {
$appendice = $_SESSION["role"] == Role::ENCADRANT ? "/" . $_team->getTrigram() : "";
$info = sizeof($_SESSION["teams"]) > 1 ? " (" . $_team->getTrigram() . ")" : "";
?>
<li class="nav-item active"><a class="nav-link" href="/mon-equipe<?= $appendice ?>">Mon équipe<?=$info?></a></li>
<?php if ($_team->getValidationStatus() == ValidationStatus::VALIDATED) { ?>
<li class="nav-item active"><a class="nav-link" href="/ma-participation<?= $appendice ?>">Ma participation<?=$info?></a></li>
<?php
switch (Phase::getCurrentPhase()) {
case Phase::PHASE1: ?>
<li class="nav-item active"><a class="nav-link" href="/envoyer-video-1<?= $appendice ?>">
Envoyer ma vidéo (phase 1)<?=$info?></a>
</li>
<?php break;
case Phase::PHASE2: ?>
<li class="nav-item active"><a class="nav-link" href="/poser-questions-2<?= $appendice ?>">
Poser des questions (phase 2)<?=$info?></a>
</li>
<?php break;
case Phase::PHASE3: ?>
<li class="nav-item active"><a class="nav-link" href="/repondre-questions-3<?= $appendice ?>">
Répondre aux questions (phase 3)<?=$info?></a>
</li>
<?php break;
case Phase::PHASE4: ?>
<li class="nav-item active"><a class="nav-link" href="/commenter-echange-4<?= $appendice ?>">
Commenter l'échange (phase 4)<?=$info?></a></li>
<?php break;
}
} ?>
<?php } ?>
<?php } ?>
<?php } ?>
<?php if ($_SESSION["role"] == Role::ADMIN) { ?>
<li class="nav-item active">
<a class="nav-link">Liste des équipes</a>
<ul class="deroule">
<li class="nav-item active"><a class="nav-link" href="/probleme/1">Problème 1</a></li>
<li class="nav-item active"><a class="nav-link" href="/probleme/2">Problème 2</a></li>
<li class="nav-item active"><a class="nav-link" href="/probleme/3">Problème 3</a></li>
<li class="nav-item active"><a class="nav-link" href="/probleme/4">Problème 4</a></li>
<li class="nav-item active"><a class="nav-link" href="/probleme/0">Équipes sans problème</a></li>
<li class="nav-item active"><a class="nav-link" href="/profils-orphelins">Profils orphelins</a></li>
<li class="nav-item active"><a class="nav-link" href="/admins">Administrateurs</a></li>
</ul>
</li>
<li class="nav-item active">
<a class="nav-link" href="/ajouter-admin">Ajouter un admin</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/suivi-correspondances">Suivi des Correspondances</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/exporter-donnees">Exporter les données</a>
</li>
<?php } ?>
<?php } ?>
</ul>
<ul class="navbar-nav">
<?php if (isset($_SESSION["admin"])) { ?>
<li class="nav-item active">
<a class="nav-link" href="/?view-as-admin">Retourner en vue administrateur</a>
</li>
<?php } ?>
<?php if (isset($_SESSION["user_id"])) { ?>
<li class="nav-item active">
<a class="nav-link" href="/deconnexion">Déconnexion</a>
</li>
<?php } else { ?>
<?php if (date("Y-m-d H:i:s") < $CONFIG->getInscriptionDate()) { ?>
<li class="nav-item active">
<a class="nav-link" href="/inscription">Inscription</a>
</li>
<?php } ?>
<li class="nav-item active">
<a class="nav-link" href="/connexion">Connexion</a>
</li>
<?php } ?>
</ul>
</div>
</nav>
</div>
<div class="container">
<div class="mt-4 mb-4">
</div>
<?php
if (isset($has_error) && $has_error) { ?>
<div class="alert alert-danger">
<strong>Erreur :</strong> <?= $error_message ?>
</div>
<?php }
if (!isset($_SESSION["role"]) || $_SESSION["role"] != Role::ADMIN && !isset($_SESSION["admin"])) { ?>
<div class="alert alert-warning">
Le site est actuellement en maintenance. Veuillez réessayer ultérieurement.
</div>
<?php
exit(-1);
}