ajout saisieModification
This commit is contained in:
@ -30,7 +30,7 @@ function getpost( $var )
|
||||
return $_POST[$var];
|
||||
}else
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,28 +44,6 @@ function mb_ucfirst($str)
|
||||
return $char . $str;
|
||||
}
|
||||
|
||||
function getLang( $lang, $gestion=false )
|
||||
{
|
||||
$dico = array();
|
||||
if ( empty($lang) )
|
||||
{
|
||||
$lang="en";
|
||||
}
|
||||
$langPath ='lang/'.$lang;
|
||||
if ($gestion)
|
||||
$langPath = "../" . $langPath;
|
||||
if (($fh = fopen($langPath, 'r') ))
|
||||
{
|
||||
$str = fgets($fh);
|
||||
fclose($fh);
|
||||
$dico = json_decode($str, true);
|
||||
return $dico;
|
||||
}else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function choixVotation($path, $methode=2) //2 = toutes les votations 1 = votations en cours 0 = votations cloturées
|
||||
{
|
||||
global $db, $base_url, $action;
|
||||
@ -103,47 +81,17 @@ function choixVotation($path, $methode=2) //2 = toutes les votations 1 = votat
|
||||
</form>';
|
||||
}
|
||||
|
||||
/*
|
||||
function envoiMailold($destinataire, $sujet, $text, $html=false, $cc='', $bcc='')
|
||||
function votationForm($path, $titre="", $libelle="", $dateDebut="", $DateFin="", $status=0)
|
||||
{
|
||||
require_once 'swiftmailer/autoload.php';
|
||||
//require_once 'include/swiftmailer/swiftmailer/lib/swift_init.php';
|
||||
$transport = (new Swift_SmtpTransport('mail.gandi.net', 465, 'ssl'))
|
||||
->setUsername('contact@lalis.fr')
|
||||
->setPassword('Gu>V$fiM{bQ^!x+FAHF+R.}bl');
|
||||
$mailer = new Swift_Mailer($transport);
|
||||
$message = (new Swift_Message($sujet))
|
||||
->setFrom(["contact@lalis.fr"])
|
||||
->setTo([$destinataire])
|
||||
->setCharset('utf-8');
|
||||
$type = $message->getHeaders()->get('Content-Type');
|
||||
if ($html)
|
||||
{
|
||||
// setParameters() takes an associative array
|
||||
$type->setValue('text/html');
|
||||
$type->setParameter('charset', 'utf-8');
|
||||
$str = nl2br($text);
|
||||
$text = "<html><head></head>\n<body>" . $str . "</body></html>";
|
||||
log_write(__FILE__ . EOL . __LINE__ . EOL . wordwrap($text, 1000, "\r\n"), INFO);
|
||||
}else
|
||||
{
|
||||
$type->setValue('text/plain');
|
||||
$type->setParameter('charset', 'utf-8');
|
||||
$text = str_replace("\n","\r\n", $text);
|
||||
}
|
||||
$message->setBody($text);
|
||||
//add date header
|
||||
$headers = $message->getHeaders();
|
||||
$headers->addDateHeader('Your-Header', new DateTimeImmutable('3 days ago'));
|
||||
if (!$mailer->send($message, $failures))
|
||||
{
|
||||
echo "Failures:";
|
||||
print_r($failures);
|
||||
log_write(__FILE__ . EOL . __LINE__ . EOL . "Le courriel n'est pas parti:" . $destinataire . EOL . $sujet . EOL . print_r($failure, true) . EOL . wordwrap($text, 1000 , "\r\n"), ERROR);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}*/
|
||||
//TODO vérification du formulaire en javascript
|
||||
print('<form method="get" action="' . $path . '">');
|
||||
print('<label for="titre">' . _("Titre") .'</label><br><input type="text" id="titre" name="titre" value="'. $titre . '">') . EOLH;
|
||||
print('<label for="libelle">' . _("Description") . '</label><br><input type="text" id="libelle" name="libelle" value="'. $libelle . '">') . EOLH;
|
||||
print('<label for="dateDebut">' . _("Date de début de la période de vote") . '</label><br><input type="date" id="dateDebut" name="dateDebut" value="'. $dateDebut . '">') . EOLH;
|
||||
print('<label for="dateFin">' . _("Date de fin de la période de vote") . '</label><br><input type="date" id="dateFin" name="dateFin" value="'. $dateFin . '">') . EOLH;
|
||||
print('<input type="submit" formaction="index.php" value="' . _("Annuler") . '">') . EOLH;
|
||||
print('<input type="submit" value="' . _("Envoyer") . '">') . EOLH;
|
||||
}
|
||||
|
||||
function envoiMail($destinataire, $sujet, $text, $html=false, $cc='', $bcc='')
|
||||
{
|
||||
@ -166,7 +114,6 @@ function envoiMail($destinataire, $sujet, $text, $html=false, $cc='', $bcc='')
|
||||
$text = str_replace("\n","\r\n", $text);
|
||||
}
|
||||
|
||||
|
||||
//Server settings
|
||||
//$mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output
|
||||
$mail->isSMTP(); //Send using SMTP
|
||||
|
Reference in New Issue
Block a user