diff --git a/controllers/contact_crtl.php b/controllers/contact_crtl.php index e5400c6..90f9abf 100644 --- a/controllers/contact_crtl.php +++ b/controllers/contact_crtl.php @@ -1,8 +1,5 @@ Erreur lors de l'enregistrement."; + } + + header('Location: index.php?route=operations'); + exit(); + } +} +?> \ No newline at end of file diff --git a/index.php b/index.php index 36b2c37..e346969 100644 --- a/index.php +++ b/index.php @@ -65,6 +65,11 @@ modif_utilisateurs_write_ctrl(); break; + case 'ajout_personnes': + require('controllers/contact_crtl.php'); + contact_ctrl(); + break; + case 'operations': require('controllers/operation_ctrl.php'); operations_form_ctrl(); diff --git a/models/contact_crud.php b/models/contact_crud.php index 2c8c533..ee95292 100644 --- a/models/contact_crud.php +++ b/models/contact_crud.php @@ -1,23 +1,15 @@ prepare($req); +function create_sauveteur(PDO $c, string $nom, string $prenom, string $dep, string $spe, string $date_heure, string $tel): void { + $req = "INSERT INTO Sauveteur (nom, prenom, departement, specialite, DateHeureEngagement, NumTel) + VALUES (:nom, :prenom, :dep, :spe, :date_heure, :tel)"; + $prep = $c->prepare($req); $prep->bindValue(':nom', $nom); $prep->bindValue(':prenom', $prenom); $prep->bindValue(':dep', $dep); $prep->bindValue(':spe', $spe); + $prep->bindValue(':date_heure', $date_heure); $prep->bindValue(':tel', $tel); - $prep->bindValue(':date', $date); - - $prep->execute(); } - - diff --git a/models/operation_crud.php b/models/operation_crud.php index e69de29..5277277 100644 --- a/models/operation_crud.php +++ b/models/operation_crud.php @@ -0,0 +1,24 @@ +prepare($req); + + $prep->bindValue(':date_debut', $date_debut); + $prep->bindValue(':date_fin', $date_fin); + $prep->bindValue(':lieu', $lieu); + $prep->bindValue(':en_prepa', $en_prepa, PDO::PARAM_INT); + $prep->bindValue(':id_sauveteur', $id_sauveteur, PDO::PARAM_INT); + $prep->bindValue(':id_statut', $id_statut, PDO::PARAM_INT); + $prep->bindValue(':id_utilisateur', $id_utilisateur, PDO::PARAM_INT); + + $resultat = $prep->execute(); + $prep->closeCursor(); + + return $resultat; +} +?> \ No newline at end of file diff --git a/views/contact_views.php b/views/contact_views.php index 3bfae72..87a1ba3 100644 --- a/views/contact_views.php +++ b/views/contact_views.php @@ -1,50 +1,50 @@ - + -