1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-01-27 17:01:19 +00:00

33 lines
884 B
PHP
Raw Normal View History

2019-09-06 13:48:50 +02:00
<?php
2019-09-08 01:35:05 +02:00
$tournaments = Tournament::getAllTournaments();
2019-09-06 13:48:50 +02:00
2020-04-13 00:35:22 +02:00
$emails = [];
2020-04-13 03:41:15 +02:00
if ($_SESSION["role"] == Role::ORGANIZER || $_SESSION["role"] == Role::ADMIN) {
2020-04-13 00:35:22 +02:00
foreach ($tournaments as $tournament) {
foreach ($tournament->getOrganizers() as $organizer)
$emails[] = $organizer->getEmail();
foreach ($tournament->getAllTeams() as $team) {
foreach ($team->getEncadrants() as $encadrant_id) {
$encadrant = User::fromId($encadrant_id);
if ($encadrant != null)
$emails[] = $encadrant->getEmail();
}
foreach ($team->getParticipants() as $participant_id) {
$participant = User::fromId($participant_id);
if ($participant != null) {
$emails[] = $participant->getEmail();
if ($participant->getResponsibleEmail() != null) {
$emails[] = $participant->getResponsibleEmail();
}
}
}
}
}
}
require_once "server_files/views/tournois.php";