1
0
This commit is contained in:
2022-10-19 15:51:41 +02:00
parent e89dcf2cc7
commit 7422d5c89b
9 changed files with 173 additions and 119 deletions

View File

@ -3,8 +3,9 @@ require_once '../session_init.php';
require_once 'config.inc.php';
require_once 'db.class.php';
require_once 'entete.php';
require_once 'fonctions.inc.php';
$idVotation = $_GET["idVotation"];
$idVotation = getpost("idVotation");
print('<br><br>
<!-- lalis Grid Section -->
@ -17,6 +18,7 @@ print('<br><br>
$db = new db();
$dolibarr = new dbDolibarr();
$status = getpost("status");
if (empty($idVotation))
{
@ -27,7 +29,7 @@ if (empty($idVotation))
$db->query("SELECT *, UNIX_TIMESTAMP( DATE_ADD(dateFin, INTERVAL 1 DAY)) as tf, UNIX_TIMESTAMP(dateFin) as df, UNIX_TIMESTAMP(dateDebut) as dd FROM liste_votations WHERE id=" . $idVotation);
$votation = $db->result->fetch_array();
if(empty($_GET['status']))
if(empty($status))
{
print('<form method="get" action="envoiMailing.php">
<input type="hidden" name="idVotation" value="' . $idVotation . '">
@ -40,7 +42,7 @@ if (empty($idVotation))
</div>
</form>
');
}elseif($_GET['status'] == 'Oui' OR $_GET['status'] == 'Test')
}elseif($status == 'Oui' OR $status == 'Test')
{
// message
@ -54,20 +56,25 @@ if (empty($idVotation))
$textFin = "\n\nNous vous rappelons que pour pouvoir voter, vous devez être à jour de cotisation à la date du vote.\nLes résultats seront visibles dès le " . formatteDate('fr', $votation['tf'], 'Europe/Paris') . " par le lien suivant : https://lalis69.ddns.net:10443/vote/vote.resultat.php?id=" . $idVotation . "\nAttention: ce lien contient votre identifiant de vote, ne le transmettez pas car la personne pourra voter à votre place.\n\nEn cas de problème appeler le 09 53 00 03 20 ou le 06 52 34 07 60\n\nVous pouvez voter par procuration en envoyant un courriel avec vos nom, prénom, et le nom de la personne à laquelle vous donnez procuration (voir modèle ci-dessous). Si vous ne précisez pas le nom du bénéficiaire de la procuration, celle-ci sera assignée aléatoirement à une personne ayant voté.\n\n";
$textFin .= "Modèle de procuration\n\nJe soussigné (nom, prénom)................................. demeurant à ........................... donne pouvoir à (nom, prénom)................... pour me représenter et prendre part aux votes en mon nom lors de l'Assemblée Générale Ordinaire de l'association .... du .... (date).\nDate et signature\n\n";
$textFin .= "Pour Lalis, Le Président, David Larochette.";
if ($_GET['status'] == 'Oui')
if ($status == 'Oui')
{
foreach($adherents as $adherent)
{
$text = $textDebut . base64_encode($adherent['login']) . $textFin;
print '<pre>' . $adherent['email'] . ' ' . $adherent['firstname'] . ' ' . $adherent['lastname'] . EOLH . nl2br($text) . '</pre>';
//print $text;
envoiMail($adherent['email'], $sujet, $text, $html=false, $cc='', $bcc='');
//envoiMail('dtux@free.fr', $sujet, $text, $html=false, $cc='', $bcc='');
if (!empty($adherent['email']))
{
if (envoiMail($adherent['email'], $sujet, $text, $html=false, $cc='', $bcc='') == false)
{
$erreurEnvoiMail[] = $adherent["firstname"] . " " . $adherent['lastname'];
}
}
}
}else
{
//print $text;
$text = $textDebut . base64_encode("login") . $textFin;
$text = $textDebut . base64_encode($dolibarrAdmin) . $textFin;
envoiMail($admin, $sujet, $text, $html=false, $cc='', $bcc='');
}
}else
@ -75,7 +82,11 @@ if (empty($idVotation))
print("<pre><h4>Annulation de l'envoi du Mailing pour la votation : " . $votation['libelle'] . "</h4>
</pre><br>");
}
print('Liste des envoi en erreur: ' . EOLH);
foreach ($erreurEnvoiMail as $adherent)
{
print ($adherent . EOLH);
}
print(' </div>
</div>
</div>