1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-25 05:40:32 +02:00

Ajouts & correction de bugs

This commit is contained in:
Yohann D'ANELLO
2019-12-26 22:30:42 +01:00
parent e9f10ca14f
commit da8efde057
16 changed files with 363 additions and 32 deletions

View File

@ -35,8 +35,16 @@ require_once "header.php";
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="admin">Compte administrateur :</label>
<input type="checkbox" id="admin" name="admin"
value="<?php if (isset($orga)) echo $orga->admin ?>"/>
</div>
</div>
<div class="form-group row">
<input class="btn btn-primary btn-lg btn-block" name="add_admin" type="submit" value="Ajouter un administrateur" />
<input class="btn btn-primary btn-lg btn-block" name="add_admin" type="submit" value="Ajouter un organisateur" />
</div>
</form>

View File

@ -39,7 +39,7 @@
<div class="alert alert-info">
<?php
for ($i = 1; $i <= 2; ++$i) {
if ($team->getEncadrants()[$i] == NULL)
if ($team->getEncadrants()[$i - 1] == NULL)
continue;
$encadrant = User::fromId($team->getEncadrants()[$i - 1]);
$id = $encadrant->getId();

View File

@ -28,6 +28,11 @@
</li>
<li class="nav-item active">
<a class="nav-link" href="/tournois">Liste des tournois</a>
<ul class="deroule">
<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="/profils">Tous les profils</a></li>
<li class="nav-item active"><a class="nav-link" href="/organisateurs">Organisateurs</a></li>
</ul>
</li>
<?php if (isset($_SESSION["user_id"])) { ?>
<li class="nav-item active">

View File

@ -112,7 +112,7 @@ if ($user->getRole() == Role::ADMIN || $user->getRole() == Role::ORGANIZER) {
echo "<div class=\"alert alert-info\">Organise le tournoi <a href=\"/tournoi/" . $tournament->getName(). "\">" . $tournament->getName() . "</a></div>";
}
}
elseif ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
elseif (($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) && $user->getTeamId() !== NULL) { ?>
<h2>Autorisations</h2>
<?php

View File

@ -0,0 +1,76 @@
<?php
require_once "header.php";
?>
<div class="mt-4 mb-4">
<h1 class="display-4">Liste des organisateurs</h1>
</div>
<hr />
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th scope="col">
Nom
</th>
<th scope="col">
Prénom
</th>
<th scope="col">
Adresse e-mail
</th>
<th>
Est administrateur
</th>
</tr>
</thead>
<tbody>
<?php
/** @var User $orga */
foreach ($organizers as $orga) {
?>
<tr>
<td>
<a href="/informations/<?= $orga->getId() ?>/<?= $orga->getFirstName() . " " . $orga->getSurname() ?>">
<?= $orga->getSurname() ?>
</a>
</td>
<td>
<a href="/informations/<?= $orga->getId() ?>/<?= $orga->getFirstName() . " " . $orga->getSurname() ?>">
<?= $orga->getFirstName() ?>
</a>
</td>
<td>
<a href="mailto:<?= $orga->getEmail() ?>">
<?= $orga->getEmail() ?>
</a>
</td>
<td>
<?= $orga->getRole() == Role::ADMIN ? "oui" : "non" ?>
</td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th>
Nom
</th>
<th>
Prénom
</th>
<th>
Adresse e-mail
</th>
<th>
Est administrateur
</th>
</tr>
</tfoot>
</table>
<?php
require_once "footer.php";

View File

@ -0,0 +1,63 @@
<?php
require_once "header.php";
?>
<div class="mt-4 mb-4">
<h2 class="display-3"><?= $orphans ? "Profils orphelins" : "Tous les profils" ?></h2>
</div>
<div>
Cette page recense tous les utilisateurs inscrits<?= $orphans ? " mais qui n'ont pas rejoint d'équipe" : "" ?>.
</div>
<br />
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th scope="col">
Nom
</th>
<th scope="col">
Rôle
</th>
<th scope="col">
Inscrit le
</th>
</tr>
</thead>
<tbody>
<?php
/** @var User $user */
foreach ($users as $user) {
?>
<tr>
<th scope="row">
<a href="/informations/<?= $user->getId() . "/" . $user->getFirstName() . " " . $user->getSurname() ?>">
<?= $user->getFirstName() . " " . $user->getSurname() ?>
</a>
</th>
<td><?= Role::getTranslatedName($user->getRole()) ?></td>
<td><?= formatDate($user->getInscriptionDate(), true) ?></td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th scope="col">
Nom
</th>
<th scope="col">
Rôle
</th>
<th scope="col">
Inscrit le
</th>
</tr>
</tfoot>
</table>
<?php
require_once "footer.php";