Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ?>
- <form method="post" enctype="multipart/mixed">
- <h5>Disponibilité Bénévole</h5>
- <label>Date : </label>
- <input type="date" name="date">
- Horaire début : <input type="time" name="heure_debut">
- Horaire fin : <input type="time" name="heure_fin">
- <label>Mission à faire : </label>
- <select name="action">
- <?php
- if (!empty($User['conducteur']) and $User['validation'] == 'V') {
- ?>
- <option value="conduire">Conduire un Camion</option>
- <?php
- }
- ?>
- <?php
- if (!empty($User['cuisine']) and $User['validation'] == 'V') {
- ?>
- <option value="cuisine">Cours de cuisine</option>
- <?php
- }
- ?>
- <?php
- if (!empty($User['service']) and $User['validation'] == 'V') {
- ?>
- <option value="service">Intervention chez les particulier (plomberie, électricité,bricolage)</option>
- <?php
- }
- ?>
- <?php
- if (!empty($User['gardiennage']) and $User['validation'] == 'V') {
- ?>
- <option value="gardiennage">gardiennage</option>
- <?php
- }
- ?>
- <option value="itineraire">Gérer les itinérires</option>
- <option value="stock">Gérer les stocks</option>
- <?php
- if(!empty($User['autre']) AND $User['validation'] == 'V'){
- ?>
- <option value="autre">Autres</option>
- <?php
- }
- ?>
- </select>
- <hr>
- <div align = 'center'>
- <input name="planning" type="submit" value="Enregistrer" class="btn btn-primary">
- </div>
- </form>
- <hr>
- <?php
- if (isset($_POST['planning'])) {
- if (!empty($_POST['date']) and !empty($_POST['heure_debut']) and !empty($_POST['heure_fin']) and !empty($_POST['action'])) {
- $_POST['id_user'] = $User['ID_Utilisateurs'];
- if ($_POST['heure_debut'] < $_POST['heure_fin']) {
- ini_set('SMTP', 'smtp.nowaste.com');
- ini_set('sendmail_from', $User['Email']);
- $to = $User['Email']; // Pour celui qui recevra l'email
- $header = "MIME-Version: 1.0\r\n";
- $header .= 'From:"FightFoodWaste"<daniel.seck.98@gmail.com>' . "\n";
- $header .= 'Content-Type:text/html; charset="uft-8"' . "\n";
- $header .= 'Content-Transfer-Encoding: 8bit';
- $message = '
- <html>
- <body>
- <div align="center">
- Voici votre planning de la semaine !
- <br />
- <h3>Votre planning à été mise à jour directement, veuillez le télécharger sur votre profil</h3>
- </div>
- </body>
- </html>
- ';
- mail($to, "Planning FightFoodWaste", $message, $header);
- User::planning();
- } else {
- 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>';
- }
- } else {
- echo ' <div align="center" class ="alert alert-danger"><h4><strong>Tous les champs doivent être remplis</strong></h4></div>';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement