Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. ?>
  2.  
  3. <form method="post" enctype="multipart/mixed">
  4.  
  5. <h5>Disponibilité Bénévole</h5>
  6.  
  7. <label>Date : </label>
  8.  
  9. <input type="date" name="date">
  10.  
  11. Horaire début : <input type="time" name="heure_debut">
  12. Horaire fin : <input type="time" name="heure_fin">
  13.  
  14.  
  15. <label>Mission à faire : </label>
  16. <select name="action">
  17. <?php
  18. if (!empty($User['conducteur']) and $User['validation'] == 'V') {
  19. ?>
  20. <option value="conduire">Conduire un Camion</option>
  21. <?php
  22. }
  23. ?>
  24. <?php
  25. if (!empty($User['cuisine']) and $User['validation'] == 'V') {
  26. ?>
  27. <option value="cuisine">Cours de cuisine</option>
  28. <?php
  29. }
  30. ?>
  31. <?php
  32. if (!empty($User['service']) and $User['validation'] == 'V') {
  33. ?>
  34. <option value="service">Intervention chez les particulier (plomberie, électricité,bricolage)</option>
  35. <?php
  36. }
  37. ?>
  38.  
  39. <?php
  40. if (!empty($User['gardiennage']) and $User['validation'] == 'V') {
  41. ?>
  42. <option value="gardiennage">gardiennage</option>
  43. <?php
  44. }
  45. ?>
  46.  
  47. <option value="itineraire">Gérer les itinérires</option>
  48. <option value="stock">Gérer les stocks</option>
  49.  
  50. <?php
  51. if(!empty($User['autre']) AND $User['validation'] == 'V'){
  52. ?>
  53. <option value="autre">Autres</option>
  54. <?php
  55. }
  56. ?>
  57.  
  58. </select>
  59. <hr>
  60. <div align = 'center'>
  61. <input name="planning" type="submit" value="Enregistrer" class="btn btn-primary">
  62. </div>
  63.  
  64. </form>
  65. <hr>
  66.  
  67.  
  68.  
  69. <?php
  70. if (isset($_POST['planning'])) {
  71. if (!empty($_POST['date']) and !empty($_POST['heure_debut']) and !empty($_POST['heure_fin']) and !empty($_POST['action'])) {
  72. $_POST['id_user'] = $User['ID_Utilisateurs'];
  73.  
  74. if ($_POST['heure_debut'] < $_POST['heure_fin']) {
  75.  
  76.  
  77. ini_set('SMTP', 'smtp.nowaste.com');
  78. ini_set('sendmail_from', $User['Email']);
  79.  
  80. $to = $User['Email']; // Pour celui qui recevra l'email
  81. $header = "MIME-Version: 1.0\r\n";
  82. $header .= 'From:"FightFoodWaste"<daniel.seck.98@gmail.com>' . "\n";
  83. $header .= 'Content-Type:text/html; charset="uft-8"' . "\n";
  84. $header .= 'Content-Transfer-Encoding: 8bit';
  85.  
  86. $message = '
  87. <html>
  88. <body>
  89. <div align="center">
  90. Voici votre planning de la semaine !
  91. <br />
  92. <h3>Votre planning à été mise à jour directement, veuillez le télécharger sur votre profil</h3>
  93. </div>
  94. </body>
  95.  
  96. </html>
  97. ';
  98. mail($to, "Planning FightFoodWaste", $message, $header);
  99.  
  100.  
  101.  
  102. User::planning();
  103. } else {
  104. echo ' <div align="center" class ="alert alert-danger"><h4><strong>L\'heure de début ne peut pas être antérieur ou égale à l\'heure de fin </strong></h4></div>';
  105. }
  106. } else {
  107. echo ' <div align="center" class ="alert alert-danger"><h4><strong>Tous les champs doivent être remplis</strong></h4></div>';
  108. }
  109. }
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement