From 65abef740d4ff3370cbd31ee52c52e7737a6c51d Mon Sep 17 00:00:00 2001 From: Noah Date: Wed, 10 Jun 2026 22:05:40 +0200 Subject: [PATCH] =?UTF-8?q?Formulaire=20mission=20complet=20:=20s=C3=A9lec?= =?UTF-8?q?tion=20sauveteur/statut,=20dur=C3=A9e=20ind=C3=A9termin=C3=A9e,?= =?UTF-8?q?=20pr=C3=A9paration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ajout get_statuts() et get_sauveteurs() pour les select du formulaire - Stockage ID utilisateur en session pour lier la mission au créateur - Durée indéterminée -> date_fin = 2099-12-31 - Checkbox "En préparation" - Renommage Opérations -> Missions (header + sub-nav) - Sub-nav harmonisée entre nouvelle mission et ajout sauveteur --- controllers/auth_ctrl2.php | 1 + controllers/operation_ctrl.php | 52 +++++++++++++++++++++--------- models/lecture_page_model.php | 6 ++++ models/user_crud.php | 2 +- views/contact_views.php | 7 +++- views/header.php | 2 +- views/operations_view.php | 58 ++++++++++++++++++++++++++++------ 7 files changed, 101 insertions(+), 27 deletions(-) diff --git a/controllers/auth_ctrl2.php b/controllers/auth_ctrl2.php index 8d7d65b..92ac25c 100644 --- a/controllers/auth_ctrl2.php +++ b/controllers/auth_ctrl2.php @@ -32,6 +32,7 @@ function verify_login_ctrl(?string $route) if ($user && password_verify($passwd, $user['passwd'])) { session_regenerate_id(true); + $_SESSION['id'] = $user['ID']; $_SESSION['login'] = $user['login']; $_SESSION['role'] = $user['type']; diff --git a/controllers/operation_ctrl.php b/controllers/operation_ctrl.php index 71fe957..62473f5 100644 --- a/controllers/operation_ctrl.php +++ b/controllers/operation_ctrl.php @@ -1,15 +1,24 @@ query($sql)->fetchAll(PDO::FETCH_ASSOC); +} + function get_sauveteurs(PDO $pdo): array { $sql = "SELECT ID, nom, prenom, specialite diff --git a/models/user_crud.php b/models/user_crud.php index 9e3e3ad..5f1d5e2 100644 --- a/models/user_crud.php +++ b/models/user_crud.php @@ -4,7 +4,7 @@ function recuperation_auth(PDO $connex, string $login):?array { require_once('config/config.php'); - $req = "SELECT login, passwd, type FROM Utilisateur WHERE login = :login"; + $req = "SELECT ID, login, passwd, type FROM Utilisateur WHERE login = :login"; $prep = $connex->prepare($req); $prep->bindValue(':login', $login); diff --git a/views/contact_views.php b/views/contact_views.php index 521eab2..8778c19 100644 --- a/views/contact_views.php +++ b/views/contact_views.php @@ -1,6 +1,11 @@ -

Ajout de personnes

+ + +

Ajout d'un sauveteur

diff --git a/views/header.php b/views/header.php index 752cd12..022ac11 100644 --- a/views/header.php +++ b/views/header.php @@ -8,7 +8,7 @@ if (is_logged()) { $nav .= '

  • Accueil
  • '; if (has_any_role(['gestionnaire', 'administration'])) { - $nav .= '
  • Opérations
  • '; + $nav .= '
  • Missions
  • '; } if (has_role('administration')) { diff --git a/views/operations_view.php b/views/operations_view.php index 9ac8fc5..72b6cff 100644 --- a/views/operations_view.php +++ b/views/operations_view.php @@ -1,14 +1,41 @@ -

    Création d'une opération

    +

    Assigner une mission

    - + +

    + + +

    + +

    + + +

    + +

    + + +

    +

    @@ -16,18 +43,31 @@

    - +

    - - +

    - + +

    + +

    +

    - \ No newline at end of file +