24 lines
841 B
HTML
24 lines
841 B
HTML
<?php
|
|
|
|
$bdd = new PDO('mysql:host=mysql5-5.pro;dbname=crystalysup', 'crystalysup', 'Supinf0');
|
|
$bdd->query('SET NAMES UTF8');
|
|
|
|
$headers ='From: "GlaDOS"<xefir@supinfo.com>'."\n";
|
|
$headers .='Reply-To: xefir@supinfo.com'."\n";
|
|
$headers .='Content-Type: text/plain; charset="iso-8859-1"'."\n";
|
|
$headers .='Content-Transfer-Encoding: 8bit';
|
|
|
|
$destinataires = '';
|
|
|
|
$message = "Bonjour\n\nTu n'a pas encore effectué ton rapport sur le site\nhttp://supinfo.crystalyx.net\nJe t'invite à le faire le plus rapidement possible !\n\nMerci et @ bientôt =)";
|
|
|
|
$sql = $bdd->query('SELECT id FROM users WHERE done=0 AND group_id != 0 AND group_id != 8');
|
|
|
|
while ($result = $sql->fetch()) {
|
|
$destinataires .= $result['id'] .'@supinfo.com, ';
|
|
}
|
|
|
|
mail($destinataires, '[LSTM Orléans] Reporting à faire !', wordwrap($message, 70), $headers);
|
|
|
|
?>
|