Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Funzione per l'invio della richiesta traspoti*/
- function invia_richiesta_trasporti(){
- //Invio mail di richiesta
- print_r($_POST['inviaRich']);
- if (isset($_POST['inviaRich'])) {
- $volontario = $_POST['volontario'];
- $email = $_POST['email'];
- $delegazione = $_POST['delegazione'];
- $motivo = $_POST['motivo'];
- if($_POST['sostitutoSuem'] == "" && $_POST['motivo'] != "Non disponibile") {
- $sostituto = "Non occorre";
- }else{
- $sostituto = $_POST['sostitutoSuem'];
- }
- if (isset($_POST['altro'])){
- $qualifiche = implode(", ",$_POST['altro']);
- }
- $note = $_POST['noteAggiuntive'];
- $testoMail = <<<EOD
- <style>
- td,p{ font-family: Arial, Helvetica, sans-serif;}
- table, td{
- border: 1px solid black;
- border-collapse: collapse;
- }
- td{
- padding: 5px;
- text-align: left;
- }
- #int{font-weight: bold;}
- tr:nth-child(even) {background-color: #f2f2f2;}
- </style>
- <p>Ciao,<br>
- Di seguito la tabella con la richiesta effettuata dal Portale:<br>
- </p>
- <table id="richieste">
- <tr>
- <td id="int">Volontario</td>
- <td>{$volontario}</td>
- </tr>
- <tr>
- <td id="int">Email</td
- <td>{$email}</td>
- </tr>
- <tr>
- <td id="int">Delegazione</td>
- <td>{$delegazione}</td>
- </tr>
- <tr>
- <td id="int">Data del turno</td>
- <td>{$dataTurno}</td>
- </tr>
- <tr>
- <td id="int">Motivazione</td>
- <td>{$motivo}</td>
- </tr>
- <tr>
- <td id="int">Qualifiche</td>
- <td>{$qualifiche}</td>
- </tr>
- <tr>
- <td id="int">Sostituto</td>
- <td>{$sostituto}</td>
- </tr>
- <tr>
- <td id="int">Note aggiuntive</td>
- <td>{$note}</td>
- </tr>
- </table>
- EOD;
- echo $testoMail; //disattivare in remoto
- //Invio di una mail (attivare in remoto)
- $destinatario = "test@matteoferron.it"; //solo per staging
- $headers[] = 'MIME-Version: 1.0';
- $headers[] = 'Content-type: text/html; charset=utf-8';
- $headers[] = 'Bcc: sviluppo@matteoferron.it';
- $headers[] = 'From: <no-reply@crivigodarzere.it>';
- $headers[] = 'Reply-To: '.$email;
- $oggetto = "Richiesta turno Manifestazione di: ".$volontario;
- $invio = mail($destinatario, $oggetto, $testoMail,implode("\r\n",$headers));
- if ($invio) {
- creaAvviso("<div class=\"alert alert-success\" role=\"alert\">Richiesta inviata correttamente</div>");
- }else {
- creaAvviso("<div class=\"alert alert-success\" role=\"alert\">Errore nell'invio della richiesta. Contattare l'assistenza</div>");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement