diff --git a/controllers/auth_ctrl2.php b/controllers/auth_ctrl2.php index 92ac25c..9958a26 100644 --- a/controllers/auth_ctrl2.php +++ b/controllers/auth_ctrl2.php @@ -1,11 +1,11 @@ prepare($req); $prep->bindValue(':nom', $nom); $prep->bindValue(':prenom', $prenom); diff --git a/models/lecture_page_model.php b/models/lecture_page_model.php index 5139743..60f6d86 100644 --- a/models/lecture_page_model.php +++ b/models/lecture_page_model.php @@ -1,19 +1,26 @@ query($sql)->fetchAll(PDO::FETCH_ASSOC); } +/** + * Liste des sauveteurs + */ function get_sauveteurs(PDO $pdo): array { - $sql = "SELECT ID, nom, prenom, specialite - FROM Sauveteur - ORDER BY nom, prenom"; + $sql = "SELECT ID, nom, prenom, specialite FROM Sauveteur ORDER BY nom, prenom"; return $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC); } +/** + * Missions d'une journée avec leur statut + */ function get_missions_planning(PDO $pdo, string $date): array { $sql = "SELECT m.ID_Sauveteur, m.DateHeureDebut, m.DateHeureFin, m.EnPrepa, s.TypeStatut diff --git a/models/modif_compte_model.php b/models/modif_compte_model.php index e77e919..aba5ea0 100644 --- a/models/modif_compte_model.php +++ b/models/modif_compte_model.php @@ -1,7 +1,10 @@ query($req); $comptes = $res->fetchAll(PDO::FETCH_ASSOC); @@ -9,8 +12,11 @@ function get_all_comptes(PDO $c): array { return $comptes; } -// Récupère un compte par son ID -function get_compte_by_id(PDO $c, int $id): ?array { +/** + * Récupère un compte par son ID + */ +function get_compte_by_id(PDO $c, int $id): ?array +{ $req = "SELECT ID, login, type, nom, prenom, nomdep, num_tel FROM Utilisateur WHERE ID = :id"; $prep = $c->prepare($req); $prep->bindValue(':id', $id, PDO::PARAM_INT); @@ -20,8 +26,11 @@ function get_compte_by_id(PDO $c, int $id): ?array { return $compte ?: null; } -// Met à jour un compte utilisateur -function update_compte(PDO $c, int $id, string $nom, string $prenom, string $role, string $nomdep, string $num_tel, string $login, string $passwd): void { +/** + * Met à jour un compte (mot de passe optionnel) + */ +function update_compte(PDO $c, int $id, string $nom, string $prenom, string $role, string $nomdep, string $num_tel, string $login, string $passwd): void +{ $req = "UPDATE Utilisateur SET nom = :nom, prenom = :prenom, type = :role, nomdep = :dep, num_tel = :tel, login = :login WHERE ID = :id"; $prep = $c->prepare($req); $prep->bindValue(':nom', $nom); diff --git a/models/operation_crud.php b/models/operation_crud.php index 5277277..8861825 100644 --- a/models/operation_crud.php +++ b/models/operation_crud.php @@ -1,13 +1,13 @@ prepare($req); - $prep->bindValue(':date_debut', $date_debut); $prep->bindValue(':date_fin', $date_fin); $prep->bindValue(':lieu', $lieu); @@ -15,10 +15,7 @@ function create_operation_crud(PDO $connex, string $date_debut, string $date_fin $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/models/user_crud.php b/models/user_crud.php index 5f1d5e2..61a74d6 100644 --- a/models/user_crud.php +++ b/models/user_crud.php @@ -1,16 +1,16 @@ prepare($req); $prep->bindValue(':login', $login); $prep->execute(); $auth = $prep->fetch(PDO::FETCH_ASSOC); $prep->closeCursor(); return $auth ?: null; - } - \ No newline at end of file +} diff --git a/models/utilisateur_crud.php b/models/utilisateur_crud.php index a95829c..fd2bc0d 100644 --- a/models/utilisateur_crud.php +++ b/models/utilisateur_crud.php @@ -1,8 +1,12 @@ prepare($req); $prep->bindValue(':login', $login); $prep->bindValue(':passwd', $mdp_hache); diff --git a/views/404_view.php b/views/404_view.php index c5c3138..56c0e44 100644 --- a/views/404_view.php +++ b/views/404_view.php @@ -1,8 +1,5 @@ Page introuvable !'; - +echo '
Merci de vous authentifier pour accéder à cette fonctionnalité.
'; + echo 'Merci de vous authentifier pour accéder à l\'application.
'; echo ''; - require('views/footer.php'); } diff --git a/views/modif_compte_view.php b/views/modif_compte_view.php index fc79688..d261920 100644 --- a/views/modif_compte_view.php +++ b/views/modif_compte_view.php @@ -1,6 +1,10 @@ @@ -9,12 +13,10 @@ function modif_compte_view(array $comptes, ?array $compte_select) { Modifier un compte -
Liste des comptes
|
-
- Modifier les informations+InformationsCliquez sur un compte dans la liste pour le modifier. |
-
Ceci est le contenu central de ma page d'accueil.
-