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 '

Page introuvable

'; require('views/footer.php'); diff --git a/views/creation_compte_view.php b/views/creation_compte_view.php index 32921c2..e55e3d0 100644 --- a/views/creation_compte_view.php +++ b/views/creation_compte_view.php @@ -5,18 +5,13 @@ Modifier un compte -

Ajout d'un nouveau compte

+

Créer un compte

+
+

+

- Nom : -

- -

- Prénom : -

- -

- +

- -

- NOM DEP : -

- -

- n°tel : -

- -

- - -

- -

- - -

- -

- -

+

+

+

+

+

diff --git a/views/header.php b/views/header.php index 022ac11..df7a6a6 100644 --- a/views/header.php +++ b/views/header.php @@ -1,7 +1,6 @@ Déconnexion'; } -// --- BARRE DE SESSION --- if (is_logged()) { $session = 'Connecté : ' . htmlentities($_SESSION['login']) . ' (' . htmlentities($_SESSION['role']) . ')'; } else { $session = 'Non connecté'; } -// --- NOTIFICATION --- $notif = ''; if (!empty($_SESSION['notification'])) { $notif = '
' . htmlentities($_SESSION['notification']) . '
'; diff --git a/views/lecture_page.php b/views/lecture_page.php index eb178c8..746ae8a 100644 --- a/views/lecture_page.php +++ b/views/lecture_page.php @@ -1,11 +1,14 @@ '#2ecc71', 'Sauveteur en approche de la cavite' => '#9b59b6', @@ -40,34 +43,33 @@ function planning_view(array $sauveteurs, array $creneaux, array $missions_par_s modify('+30 minutes'); + // On cherche si une mission couvre ce créneau $liste_missions = $missions_par_sauveteur[$sauveteur['ID']] ?? []; foreach ($liste_missions as $mission) { $debut_mission = new DateTime($mission['DateHeureDebut']); - $fin_mission = new DateTime($mission['DateHeureFin']); + $fin_mission = new DateTime($mission['DateHeureFin']); if ($debut_mission < $fin_creneau && $fin_mission > $debut_creneau) { - $statut = $mission['TypeStatut']; + $statut = $mission['TypeStatut']; $en_prepa = (bool) $mission['EnPrepa']; break; } } - // Affichage de la cellule if ($statut === null) { $style = ''; $titre = ''; $texte = ''; } else { $couleur = $couleurs[$statut] ?? '#ccc'; - $titre = htmlspecialchars($statut); + $titre = htmlspecialchars($statut); if ($en_prepa) { $style = 'background:' . $couleur . '; opacity:0.4;'; $titre .= ' (préparation)'; @@ -88,9 +90,8 @@ function planning_view(array $sauveteurs, array $creneaux, array $missions_par_s

Légende

- - Sauveteur disponible + Disponible En approche de la cavité @@ -108,7 +109,7 @@ function planning_view(array $sauveteurs, array $creneaux, array $missions_par_s En repos - En brancardage civière + Brancardage civière diff --git a/views/login_views.php b/views/login_views.php index 9e676cc..91c62e1 100644 --- a/views/login_views.php +++ b/views/login_views.php @@ -1,15 +1,17 @@ Page d\'authentification'; - echo '

Merci de vous authentifier pour accéder à cette fonctionnalité.

'; + echo '

Connexion

'; + echo '

Merci de vous authentifier pour accéder à l\'application.

'; echo '
'; echo '

'; echo '

'; - echo '

'; + echo '

'; 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 -

Modifier un compte existant

+

Modifier un compte

- - - -

Liste des comptes

    @@ -31,55 +33,37 @@ function modif_compte_view(array $comptes, ?array $compte_select) {
-

Modifier les informations

+

Informations

-

- - -

-

- - -

-

- +

+

+

+

+

-

-

- - -

-

- - -

-

- - -

-

- - -

-

- -

+

+

+

+

+

+

+

+

+

+

Cliquez sur un compte dans la liste pour le modifier.

diff --git a/views/welcome_view.php b/views/welcome_view.php deleted file mode 100644 index 2391aee..0000000 --- a/views/welcome_view.php +++ /dev/null @@ -1,8 +0,0 @@ - -

Bienvenue sur l'application de gestion

-

Ceci est le contenu central de ma page d'accueil.

-