From 986356d5baf421dd1a0a2f150ff948506f272bbf Mon Sep 17 00:00:00 2001 From: Noah Date: Mon, 8 Jun 2026 15:06:32 +0200 Subject: [PATCH] Refactor contact controller and views for improved functionality and user experience --- controllers/contact_crtl.php | 46 +++++++----------- index.php | 5 ++ models/contact_crud.php | 18 ++----- views/contact_views.php | 92 ++++++++++++++++++------------------ views/operations_view.php | 7 ++- 5 files changed, 77 insertions(+), 91 deletions(-) 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 @@ 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/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 @@ - + -

Ajouts de personnes

+

Ajout de personnes

-
-

Nom :

-

Prénom :

- -

Département :

- - + +

+ +

-

- -

-

-

- - -

-

- - -

-

- - -

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
- - - - - - diff --git a/views/operations_view.php b/views/operations_view.php index 067a8db..9ac8fc5 100644 --- a/views/operations_view.php +++ b/views/operations_view.php @@ -1,9 +1,8 @@ -