Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. /*Funzione per l'invio della richiesta traspoti*/
  2. function invia_richiesta_trasporti(){
  3. //Invio mail di richiesta
  4. print_r($_POST['inviaRich']);
  5. if (isset($_POST['inviaRich'])) {
  6. $volontario = $_POST['volontario'];
  7. $email = $_POST['email'];
  8. $delegazione = $_POST['delegazione'];
  9. $motivo = $_POST['motivo'];
  10. if($_POST['sostitutoSuem'] == "" && $_POST['motivo'] != "Non disponibile") {
  11. $sostituto = "Non occorre";
  12. }else{
  13. $sostituto = $_POST['sostitutoSuem'];
  14. }
  15. if (isset($_POST['altro'])){
  16. $qualifiche = implode(", ",$_POST['altro']);
  17. }
  18. $note = $_POST['noteAggiuntive'];
  19.  
  20. $testoMail = <<<EOD
  21. <style>
  22. td,p{ font-family: Arial, Helvetica, sans-serif;}
  23. table, td{
  24. border: 1px solid black;
  25. border-collapse: collapse;
  26. }
  27. td{
  28. padding: 5px;
  29. text-align: left;
  30. }
  31. #int{font-weight: bold;}
  32. tr:nth-child(even) {background-color: #f2f2f2;}
  33. </style>
  34. <p>Ciao,<br>
  35. Di seguito la tabella con la richiesta effettuata dal Portale:<br>
  36. </p>
  37. <table id="richieste">
  38. <tr>
  39. <td id="int">Volontario</td>
  40. <td>{$volontario}</td>
  41. </tr>
  42. <tr>
  43. <td id="int">Email</td
  44. <td>{$email}</td>
  45. </tr>
  46. <tr>
  47. <td id="int">Delegazione</td>
  48. <td>{$delegazione}</td>
  49. </tr>
  50. <tr>
  51. <td id="int">Data del turno</td>
  52. <td>{$dataTurno}</td>
  53. </tr>
  54. <tr>
  55. <td id="int">Motivazione</td>
  56. <td>{$motivo}</td>
  57. </tr>
  58. <tr>
  59. <td id="int">Qualifiche</td>
  60. <td>{$qualifiche}</td>
  61. </tr>
  62. <tr>
  63. <td id="int">Sostituto</td>
  64. <td>{$sostituto}</td>
  65. </tr>
  66. <tr>
  67. <td id="int">Note aggiuntive</td>
  68. <td>{$note}</td>
  69. </tr>
  70. </table>
  71. EOD;
  72. echo $testoMail; //disattivare in remoto
  73.  
  74. //Invio di una mail (attivare in remoto)
  75. $destinatario = "test@matteoferron.it"; //solo per staging
  76.  
  77. $headers[] = 'MIME-Version: 1.0';
  78. $headers[] = 'Content-type: text/html; charset=utf-8';
  79. $headers[] = 'Bcc: sviluppo@matteoferron.it';
  80. $headers[] = 'From: <no-reply@crivigodarzere.it>';
  81. $headers[] = 'Reply-To: '.$email;
  82.  
  83. $oggetto = "Richiesta turno Manifestazione di: ".$volontario;
  84.  
  85. $invio = mail($destinatario, $oggetto, $testoMail,implode("\r\n",$headers));
  86. if ($invio) {
  87. creaAvviso("<div class=\"alert alert-success\" role=\"alert\">Richiesta inviata correttamente</div>");
  88. }else {
  89. creaAvviso("<div class=\"alert alert-success\" role=\"alert\">Errore nell'invio della richiesta. Contattare l'assistenza</div>");
  90. }
  91. }
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement