mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2024-12-05 02:06:52 +00:00
Bouton pour envoyer un mail à tout le monde
This commit is contained in:
parent
eb53514eb9
commit
8cab38e216
@ -70,7 +70,7 @@ class Team
|
||||
return $team;
|
||||
}
|
||||
|
||||
public static function getAllTeams($problem, $only_validated = false)
|
||||
public static function getAllTeams($problem = -1, $only_validated = false)
|
||||
{
|
||||
global $DB, $YEAR;
|
||||
$req = $DB->prepare("SELECT * FROM `teams` WHERE " . ($problem < 0 ? "" : "`problem` = ? AND ") . ($only_validated ? "`validation_status` = 'VALIDATED' AND " : "") . "`year` = $YEAR;");
|
||||
|
@ -121,4 +121,11 @@ if (isset($req)) {
|
||||
}
|
||||
}
|
||||
|
||||
$all_emails = [];
|
||||
foreach (Team::getAllTeams() as $team) {
|
||||
if (Phase::getCurrentPhase() >= Phase::PHASE12 && $team->getSolution() == null)
|
||||
continue;
|
||||
$all_emails = array_merge($all_emails, $team->getAllEmails());
|
||||
}
|
||||
|
||||
require_once "server_files/views/suivi_correspondances.php";
|
@ -24,6 +24,10 @@ if (sizeof($waiting_teams) > 0) { ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<a href="mailto:contact@correspondances-maths.fr?<? foreach ($all_emails as $email) echo "bcc=" . $email . "&" ?>subject=Correspondances de Jeunes Mathématicien·ne·s" target="_blank">
|
||||
<button class="btn btn-block btn-primary">Envoyer un mail à tous les participants</button>
|
||||
</a>
|
||||
|
||||
<hr />
|
||||
|
||||
<?php
|
||||
|
Loading…
Reference in New Issue
Block a user