diff --git a/.env b/.env new file mode 100644 index 0000000..e56a995 --- /dev/null +++ b/.env @@ -0,0 +1,4 @@ +MYSQL_HOST=192.168.100.100 +MYSQL_DATABASE=sdis29 +MYSQL_USER=adminBDsdis +MYSQL_PASSWORD=mdp \ No newline at end of file diff --git a/nb-configuration.xml b/nb-configuration.xml new file mode 100644 index 0000000..020b24f --- /dev/null +++ b/nb-configuration.xml @@ -0,0 +1,20 @@ + + + + + + 10-web + pfv5ee8 + ide + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..a180121 --- /dev/null +++ b/pom.xml @@ -0,0 +1,72 @@ + + 4.0.0 + com.mycompany + SDIS29MedhiEmile + 1.0-SNAPSHOT + war + SDIS29MedhiEmile-1.0-SNAPSHOT + + + UTF-8 + 10.0.0 + + + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + provided + + + io.github.cdimascio + dotenv-java + 3.0.0 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + 11 + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.2 + + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + copy-env + process-resources + + copy-resources + + + ${project.build.outputDirectory} + + + ${basedir} + + .env + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mycompany/sdis29medhiemile/JakartaRestConfiguration.java b/src/main/java/com/mycompany/sdis29medhiemile/JakartaRestConfiguration.java new file mode 100644 index 0000000..0e65150 --- /dev/null +++ b/src/main/java/com/mycompany/sdis29medhiemile/JakartaRestConfiguration.java @@ -0,0 +1,13 @@ +package com.mycompany.sdis29medhiemile; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +/** + * Configures Jakarta RESTful Web Services for the application. + * @author Juneau + */ +@ApplicationPath("resources") +public class JakartaRestConfiguration extends Application { + +} diff --git a/src/main/java/com/mycompany/sdis29medhiemile/resources/JakartaEE10Resource.java b/src/main/java/com/mycompany/sdis29medhiemile/resources/JakartaEE10Resource.java new file mode 100644 index 0000000..a70ecf8 --- /dev/null +++ b/src/main/java/com/mycompany/sdis29medhiemile/resources/JakartaEE10Resource.java @@ -0,0 +1,20 @@ +package com.mycompany.sdis29medhiemile.resources; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; + +/** + * + * @author + */ +@Path("jakartaee10") +public class JakartaEE10Resource { + + @GET + public Response ping(){ + return Response + .ok("ping Jakarta EE") + .build(); + } +} diff --git a/src/main/java/com/sdsi29/bdd/caserneMySQL.java b/src/main/java/com/sdsi29/bdd/caserneMySQL.java new file mode 100644 index 0000000..dbb960e --- /dev/null +++ b/src/main/java/com/sdsi29/bdd/caserneMySQL.java @@ -0,0 +1,49 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package com.sdsi29.bdd; + +import com.sdsi29.beans.caserne; +import io.github.cdimascio.dotenv.Dotenv; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +/** + * + * @author emile.malcuit + */ + +/** + * Class CaserneMySQL + * Classe de récupération bdd caserne + * @author emile.malcuit + */ +public class caserneMySQL { + Dotenv dotenv = Dotenv.load(); + Connection laConnexion = connexionSQL.getConnect(dotenv.get("MYSQL_HOST"), dotenv.get("MYSQL_DATABASE"), dotenv.get("MYSQL_USER"), dotenv.get("MYSQL_PASSWORD")); + + public caserne getLaCaserne (String loginPompier){ + caserne laCaserne = new caserne(); + String requete = "SELECT caserne.id, caserne.nom, caserne.adresse, caserne.groupement " + + "FROM `pompier` INNER JOIN caserne on pompier.idCaserne = caserne.id WHERE pompier.login LIKE ?"; + + try (PreparedStatement stmt = laConnexion.prepareStatement(requete)){ + stmt.setString(1, loginPompier); + ResultSet result = stmt.executeQuery(); + + if(result.next()){ + laCaserne.setIdCaserne(result.getInt("id")); + laCaserne.setNomCaserne(result.getString("nom")); + laCaserne.setAdresse(result.getString("adresse")); + laCaserne.setGroupement(result.getString("groupement")); + } + }catch(SQLException ex){ + System.out.println(ex.toString()); + } + + return laCaserne; + } +} diff --git a/src/main/java/com/sdsi29/bdd/connexionSQL.java b/src/main/java/com/sdsi29/bdd/connexionSQL.java new file mode 100644 index 0000000..72b152a --- /dev/null +++ b/src/main/java/com/sdsi29/bdd/connexionSQL.java @@ -0,0 +1,62 @@ +package com.sdsi29.bdd; + +/* +Connexion.java +Classe permettant d'établir une connexion avec une base de données mySQL +*/ +import java.sql.Connection; +import java.sql.DriverManager; + +public class connexionSQL { + private static Connection connect; // Variable de connexion + + /** + * Constructeur d'une connexion avec une base de données + * @param serveur nom du serveur, localhost si local + * @param bdd nom de la base de données + * @param nomUtil nom utilisateur + * @param mdp mot de passe lié à l'utilisateur + */ + connexionSQL(String serveur, String bdd, String nomUtil, String mdp) { + try { + // 1. Chargement du driver + //Class.forName("com.mysql.jdbc.Driver"); + System.out.println("Driver MariaDb Ok"); + //Class.forName("org.mariadb.jdbc.Driver"); + + + // 2. Initialisation des paramètres de connexion + String host = serveur; // Serveur de bd + String dbname = bdd; // Nom bd + String url = "jdbc:mariadb://" + host + ":3306/" + dbname; // url de connexion + System.out.println("url : "+url); + String user = nomUtil; // nom du user + System.out.println("nomUtil : "+nomUtil); + String passwd = mdp; // mot de passe + System.out.println("mdp : "+mdp); + + // 3. Connexion + connect = (Connection) DriverManager.getConnection(url, user, passwd); + System.out.println("Connexion réussie !"); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Retourne la connection �tablie (Cr�ation d'une connection si elle n'existe pas) + * @param serveur nom du serveur, localhost si local + * @param bdd nom de la base de donn�es + * @param nomUtil nom utilisateur + * @param mdp mot de passe li� � l'utilisateur + * @return connection �tablie + */ + public static Connection getConnect(String serveur, String bdd, String nomUtil, String mdp) { + if (connect == null) { + new connexionSQL(serveur, bdd, nomUtil, mdp); + } + System.out.println("Connexion validé"); + return connect; + } +} diff --git a/src/main/java/com/sdsi29/bdd/pompierMySQL.java b/src/main/java/com/sdsi29/bdd/pompierMySQL.java new file mode 100644 index 0000000..ce62713 --- /dev/null +++ b/src/main/java/com/sdsi29/bdd/pompierMySQL.java @@ -0,0 +1,157 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package com.sdsi29.bdd; + +import com.sdsi29.beans.pompier; +import io.github.cdimascio.dotenv.Dotenv; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; + +/** + * + * @author emile.malcuit + */ +public class pompierMySQL { + Dotenv dotenv = Dotenv.load(); + Connection laConnexion = connexionSQL.getConnect(dotenv.get("MYSQL_HOST"), dotenv.get("MYSQL_DATABASE"), dotenv.get("MYSQL_USER"), dotenv.get("MYSQL_PASSWORD")); + + public pompier read(int id) { + pompier lecture = new pompier(); + String sql = "SELECT id, nom, prenom, mail, idCaserne,( SELECT parametre.libelle FROM parametre WHERE idType = 'grade' AND po.grade = parametre.indice) AS grade," + + "(SELECT parametre.libelle FROM parametre WHERE idType = 'statAgt' and po.statut = parametre.indice) AS status," + + "typePers FROM pompier po WHERE id = ? ;"; + + try (PreparedStatement stmt = laConnexion.prepareStatement(sql)) { + stmt.setInt(1, id); + ResultSet result = stmt.executeQuery(); + + if (result.next()) { + lecture.setId(result.getInt("id")); + lecture.setCaserne(result.getInt("idCaserne")); + lecture.setNom(result.getString("nom")); + lecture.setPrenom(result.getString("prenom")); + lecture.setStatus(result.getString("status")); + lecture.setTypePers(result.getInt("typePers")); + lecture.setMail(result.getString("mail")); + lecture.setGrade(result.getString("grade")); + } + }catch (SQLException ex){ + + } + return lecture; + } + + public boolean authentifier(String login, String motDePasse) throws SQLException { + String sql = "SELECT * FROM pompier WHERE login = ? AND mdp = ?"; + try (PreparedStatement stmt = laConnexion.prepareStatement(sql)) { + stmt.setString(1, login); + stmt.setString(2, motDePasse); + ResultSet result = stmt.executeQuery(); + return result.next(); + } + } + + public boolean newPompier(String nom, String prenom, String login, String email, String mdp, int grade, int idCaserne) throws SQLException { + String sql = "INSERT INTO pompier (nom, prenom, mail, idCaserne, statut, typePers, mdp, mdps, salt, login, grade)\n" + +" VALUES (?, ?, ?, ?, 1, 2, ?, 'auhfuhuhuh7262', 'ijirelkj26988', ?, ?)"; + + try (PreparedStatement stmt = laConnexion.prepareStatement(sql)) { + stmt.setString(1, nom); + stmt.setString(2, prenom); + stmt.setString(3, email); + stmt.setInt(4, idCaserne); + stmt.setString(5, mdp); + stmt.setString(6, login); + stmt.setInt(7, grade); + int rows = stmt.executeUpdate(); + return rows > 0; + } +} + + + + public String getGrade(String login) throws SQLException { + String grade = null; + String sql = "SELECT libelle FROM pompierParametre WHERE login = ? AND idType = 'grade'"; + + try (PreparedStatement stmt = laConnexion.prepareStatement(sql)) { + stmt.setString(1, login); + ResultSet result = stmt.executeQuery(); + result.next(); + grade = result.getString("libelle"); + } + return grade; +} + + public ArrayList getLesPompiersCaserne (int caserne){ + + ArrayList lesPompiers = new ArrayList<>(); + + String requete = "SELECT id, nom, prenom, mail, idCaserne, " + + "( SELECT parametre.libelle FROM parametre WHERE idType = 'grade' AND po.grade = parametre.indice) AS grade, " + + "(SELECT parametre.libelle FROM parametre WHERE idType = 'statAgt' and po.statut = parametre.indice) AS status, " + + "typePers FROM pompier po WHERE idCaserne = ? ;"; + try (PreparedStatement stmt = laConnexion.prepareStatement(requete)){ + stmt.setInt(1, caserne); + ResultSet result = stmt.executeQuery(); + + while(result.next()){ + + pompier resultPompier = new pompier(result.getInt("id"), + result.getString("nom"), result.getString("prenom"), + result.getString("mail"), result.getInt("idCaserne"), + result.getString("status"), result.getString("grade"), + result.getInt("typePers")); + + lesPompiers.add(resultPompier); + } + }catch(SQLException ex){ + + } + return lesPompiers; + } + + public int getIndiceGrade (String gradeLibelle){ + int indiceGrade = 0; + String requete = "SELECT indice FROM parametre WHERE idType like 'grade' and libelle like ?"; + + try (PreparedStatement stmt = laConnexion.prepareStatement(requete)){ + stmt.setString(1, gradeLibelle); + ResultSet result = stmt.executeQuery(); + + if(result.next()){ + indiceGrade = result.getInt("indice"); + } + }catch(SQLException ex){ + System.out.println(ex); + } + return indiceGrade; + } + + public void updatePompier(int id, String mail, int grade) { + String requete = "UPDATE `pompier` SET mail = ?, grade = ? WHERE id = ?"; + + try (PreparedStatement stmt = laConnexion.prepareStatement(requete)) { + stmt.setString(1, mail); + stmt.setInt(2, grade); + stmt.setInt(3, id); + + System.out.println("Tentative de mise à jour de : " + id); + int rowsAffected = stmt.executeUpdate(); + + if (rowsAffected > 0) { + System.out.println("Mise à jour réussie pour " + rowsAffected + " pompier(s)."); + } else { + System.out.println("Aucun pompier mis à jour. Vérifie les noms/prénoms."); + } + } catch (SQLException ex) { + System.out.println("Erreur SQL : " + ex.getMessage()); + } + } +} + diff --git a/src/main/java/com/sdsi29/beans/caserne.java b/src/main/java/com/sdsi29/beans/caserne.java new file mode 100644 index 0000000..f554f3b --- /dev/null +++ b/src/main/java/com/sdsi29/beans/caserne.java @@ -0,0 +1,64 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package com.sdsi29.beans; + +/** + * + * @author emile.malcuit + */ +public class caserne { + private int idCaserne; + private String nomCaserne; + private String adresse; + private String groupement; + + + public caserne(){ + + } + + public caserne(int idCaserne, String nomCaserne, String adresse, String groupement){ + this.idCaserne = idCaserne; + this.nomCaserne = nomCaserne; + this.adresse = adresse; + this.groupement = groupement; + } + + public int getIdCaserne() { + return idCaserne; + } + + public void setIdCaserne(int idCaserne) { + this.idCaserne = idCaserne; + } + + public String getNomCaserne() { + return nomCaserne; + } + + public void setNomCaserne(String nomCaserne) { + this.nomCaserne = nomCaserne; + } + + public String getAdresse() { + return adresse; + } + + public void setAdresse(String adresse) { + this.adresse = adresse; + } + + public String getGroupement() { + return groupement; + } + + public void setGroupement(String groupement) { + this.groupement = groupement; + } + + + +} + diff --git a/src/main/java/com/sdsi29/beans/listePompier.java b/src/main/java/com/sdsi29/beans/listePompier.java new file mode 100644 index 0000000..f34a9e3 --- /dev/null +++ b/src/main/java/com/sdsi29/beans/listePompier.java @@ -0,0 +1,28 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package com.sdsi29.beans; + +import java.util.ArrayList; + +/** + * + * @author emile.malcuit + */ +public class listePompier { + private ArrayList lesPompiers = new ArrayList<>(); + + public boolean addPompier(pompier unPompier){ + lesPompiers.add(unPompier); + return false; + } + + public ArrayList getLesPompiers(){ + return lesPompiers; + } + + public void setLesPompiers(ArrayList lesPompiers){ + this.lesPompiers = lesPompiers; + } +} diff --git a/src/main/java/com/sdsi29/beans/pompier.java b/src/main/java/com/sdsi29/beans/pompier.java new file mode 100644 index 0000000..55d96e6 --- /dev/null +++ b/src/main/java/com/sdsi29/beans/pompier.java @@ -0,0 +1,183 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package com.sdsi29.beans; + +import java.util.Objects; + +/** + * + * @author emile.malcuit + */ +public class pompier { + private int id; + private String nom; + private String prenom; + private String mail; + private int Caserne; + private String status; //aller cherché le libelle de status + private String grade; //utilisé le grade(int) pour aller chercher le libelle + private int typePers; + + + + public pompier(){ + + } + + + + /** + * Constructeur 1: pompier + * Ce constructeur sert à la récupération des données depuis la bdd + * @param id + * @param nom + * @param prenom + * @param mail + * @param Caserne + * @param status + * @param grade + * @param typePers + */ + public pompier(int id, String nom, String prenom, String mail, int Caserne, + String status, String grade, int typePers) { + this.id = id; + this.nom = nom; + this.prenom = prenom; + this.mail = mail; + this.Caserne = Caserne; + this.status = status; + this.grade = grade; + this.typePers = typePers; + } + + /** + * Constructeur 2: pompier + * Ce constructeur est utilisé par le chef de caserne pour créer un nouveau personnel + * @param nom + * @param prenom + * @param mail + * @param Caserne + * @param status + * @param grade + * @param typePers + */ + public pompier(String nom, String prenom, String mail, int Caserne, + String status, String grade, int typePers) { + this.nom = nom; + this.prenom = prenom; + this.mail = mail; + this.Caserne = Caserne; + this.status = status; + this.grade = grade; + this.typePers = typePers; + } + + public int getId() { + return id; + } + + public void setId(int id){ + this.id = id; + } + + public String getNom() { + return nom; + } + + public void setNom(String nom) { + this.nom = nom; + } + + public String getPrenom() { + return prenom; + } + + public void setPrenom(String prenom) { + this.prenom = prenom; + } + + public String getMail() { + return mail; + } + + public void setMail(String mail) { + this.mail = mail; + } + + public int getCaserne() { + return Caserne; + } + + public void setCaserne(int Caserne) { + this.Caserne = Caserne; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getGrade() { + return grade; + } + + public void setGrade(String grade) { + this.grade = grade; + } + + public int getTypePers() { + return typePers; + } + + public void setTypePers(int typePers) { + this.typePers = typePers; + } + + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final pompier other = (pompier) obj; + if (this.id != other.id) { + return false; + } + if (this.Caserne != other.Caserne) { + return false; + } + if (this.typePers != other.typePers) { + return false; + } + if (!Objects.equals(this.nom, other.nom)) { + return false; + } + if (!Objects.equals(this.prenom, other.prenom)) { + return false; + } + if (!Objects.equals(this.mail, other.mail)) { + return false; + } + if (!Objects.equals(this.status, other.status)) { + return false; + } + return Objects.equals(this.grade, other.grade); + } + + + @Override + public String toString() { + return "Pompier{" + "id=" + id + ", nom=" + nom + ", prenom=" + prenom + ", mail=" + mail + ", Caserne=" + Caserne + ", status=" + status + ", grade=" + grade + ", typePers=" + typePers + '}'; + } +} diff --git a/src/main/java/com/sdsi29/controler/AjoutPompierServlet.java b/src/main/java/com/sdsi29/controler/AjoutPompierServlet.java new file mode 100644 index 0000000..3c9f656 --- /dev/null +++ b/src/main/java/com/sdsi29/controler/AjoutPompierServlet.java @@ -0,0 +1,121 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/Servlet.java to edit this template + */ +package com.sdsi29.controler; + +import com.sdsi29.bdd.pompierMySQL; +import com.sdsi29.beans.caserne; +import java.io.IOException; +import java.io.PrintWriter; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import java.sql.SQLException; + +/** + * + * @author emile.malcuit + */ +@WebServlet(name="AjoutPompier", urlPatterns={"/Ajout"}) +public class AjoutPompierServlet extends HttpServlet { + + /** + * Processes requests for both HTTP GET and POST + * methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + try (PrintWriter out = response.getWriter()) { + /* TODO output your page here. You may use following sample code. */ + out.println(""); + out.println(""); + out.println(""); + out.println("Servlet AjoutPompierServlet"); + out.println(""); + out.println(""); + out.println("

Servlet AjoutPompierServlet at " + request.getContextPath() + "

"); + out.println(""); + out.println(""); + } + } + + // + /** + * Handles the HTTP GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + //processRequest(request, response); + getServletContext().getRequestDispatcher("/WEB-INF/AjoutPompierJSP.jsp").forward(request, response); + } + + /** + * Handles the HTTP POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + System.out.print("test ajout pompier"); + //processRequest(request, response); + String nom = request.getParameter("nom"); + String prenom = request.getParameter("prenom"); + String login = request.getParameter("login"); + String email = request.getParameter("email"); + String mdp = request.getParameter("mdp"); + int grade = Integer.parseInt(request.getParameter("grade")); + + HttpSession laSession = request.getSession(); + caserne laCaserne = (caserne)laSession.getAttribute("laCaserne"); + int caserne = laCaserne.getIdCaserne(); + + try { + pompierMySQL creaUnPompier = new pompierMySQL(); + if (creaUnPompier.newPompier(nom, prenom, login, email, mdp, grade, caserne)) { + request.setAttribute("ajoutValide", "Bon ajout d'un pompier"); + getServletContext().getRequestDispatcher("/Accueil").forward(request, response); + }else { + + request.setAttribute("ajoutNonValide", "Erreur de la création d'un pompier"); + getServletContext().getRequestDispatcher("/Accueil").forward(request, response); + } + + }catch (SQLException e) { + request.setAttribute("Erreur e", e); + getServletContext().getRequestDispatcher("/WEB-INF/ConnexionJSP.jsp").forward(request, response); + + } + + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// + +} diff --git a/src/main/java/com/sdsi29/controler/AuthentificationServlet.java b/src/main/java/com/sdsi29/controler/AuthentificationServlet.java new file mode 100644 index 0000000..01e7434 --- /dev/null +++ b/src/main/java/com/sdsi29/controler/AuthentificationServlet.java @@ -0,0 +1,122 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/Servlet.java to edit this template + */ +package com.sdsi29.controler; + +import com.sdsi29.bdd.caserneMySQL; +import com.sdsi29.bdd.pompierMySQL; +import com.sdsi29.beans.caserne; +import java.io.IOException; +import java.io.PrintWriter; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import java.sql.SQLException; + +/** + * + * @author emile.malcuit + */ +@WebServlet(name="Authentification", urlPatterns={"/Authentification"}) +public class AuthentificationServlet extends HttpServlet { + + /** + * Processes requests for both HTTP GET and POST + * methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + try (PrintWriter out = response.getWriter()) { + /* TODO output your page here. You may use following sample code. */ + out.println(""); + out.println(""); + out.println(""); + out.println("Servlet AuthentificationServlet"); + out.println(""); + out.println(""); + out.println("

Servlet AuthentificationServlet at " + request.getContextPath() + "

"); + out.println(""); + out.println(""); + } + } + + // + /** + * Handles the HTTP GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + getServletContext().getRequestDispatcher("/WEB-INF/ConnexionJSP.jsp").forward(request, response); + } + + /** + * Handles the HTTP POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + System.out.print("Test de passage dans le do post"); + String login = request.getParameter("login"); + String mdp = request.getParameter("motdepasse"); + System.out.print(login); + + try { + pompierMySQL unPompier = new pompierMySQL(); + if (unPompier.authentifier(login, mdp)) { + + String gradePompier = unPompier.getGrade(login); + System.out.print("Test d'obtention du grade" + "" + gradePompier); + + caserneMySQL caserneSQL = new caserneMySQL(); + caserne laCaserne = caserneSQL.getLaCaserne(login); + System.out.println(laCaserne.getAdresse()); + + HttpSession maSession = request.getSession(); + maSession.setAttribute("connexionValide", gradePompier); + maSession.setAttribute("laCaserne", laCaserne); + + request.setAttribute("valide", "Bienvenue" + " " + gradePompier + " " + login + "!"); + getServletContext().getRequestDispatcher("/Accueil").forward(request, response); + } else { + request.setAttribute("erreur", "Identifiant ou mot de passe incorrect"); + getServletContext().getRequestDispatcher("/WEB-INF/ConnexionJSP.jsp").forward(request, response); + } + } catch (SQLException e) { + request.setAttribute("erreur", "Erreur de connexion à la base de données"); + getServletContext().getRequestDispatcher("/WEB-INF/ConnexionJSP.jsp").forward(request, response); + } + + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// + +} diff --git a/src/main/java/com/sdsi29/controler/ListePompierServlet.java b/src/main/java/com/sdsi29/controler/ListePompierServlet.java new file mode 100644 index 0000000..75e238e --- /dev/null +++ b/src/main/java/com/sdsi29/controler/ListePompierServlet.java @@ -0,0 +1,110 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/Servlet.java to edit this template + */ +package com.sdsi29.controler; + +import com.sdsi29.bdd.pompierMySQL; +import com.sdsi29.beans.caserne; +import com.sdsi29.beans.pompier; +import java.io.IOException; +import java.io.PrintWriter; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import java.util.ArrayList; + +/** + * + * @author emile.malcuit + */ +@WebServlet(name="Accueil", urlPatterns={"/Accueil"}) +public class ListePompierServlet extends HttpServlet { + + /** + * Processes requests for both HTTP GET and POST + * methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + try (PrintWriter out = response.getWriter()) { + /* TODO output your page here. You may use following sample code. */ + out.println(""); + out.println(""); + out.println(""); + out.println("Servlet ListePompierServlet"); + out.println(""); + out.println(""); + out.println("

Servlet ListePompierServlet at " + request.getContextPath() + "

"); + out.println(""); + out.println(""); + } + } + + // + /** + * Handles the HTTP GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + System.out.println("Hello vous etes dans liste pompier servlet"); + pompierMySQL poSQL = new pompierMySQL(); + HttpSession maSession = request.getSession(); + if(maSession.getAttribute("laCaserne") != null){ + caserne laCaserne = (caserne) maSession.getAttribute("laCaserne"); + ArrayList lesPompiers = poSQL.getLesPompiersCaserne(laCaserne.getIdCaserne()); + request.setAttribute("lesPompiers", lesPompiers); + } + getServletContext().getRequestDispatcher("/WEB-INF/ListePompierJSP.jsp").forward(request, response); + } + + /** + * Handles the HTTP POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + //processRequest(request, response); + System.out.println("Hello doPost listePompier"); + System.out.println("Hello vous etes dans liste pompier servlet"); + pompierMySQL poSQL = new pompierMySQL(); + HttpSession maSession = request.getSession(); + caserne laCaserne = (caserne) maSession.getAttribute("laCaserne"); + ArrayList lesPompiers = poSQL.getLesPompiersCaserne(laCaserne.getIdCaserne()); + + request.setAttribute("lesPompiers", lesPompiers); + + getServletContext().getRequestDispatcher("/WEB-INF/ListePompierJSP.jsp").forward(request, response); + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// + +} diff --git a/src/main/java/com/sdsi29/controler/ModificationServlet.java b/src/main/java/com/sdsi29/controler/ModificationServlet.java new file mode 100644 index 0000000..b6dd535 --- /dev/null +++ b/src/main/java/com/sdsi29/controler/ModificationServlet.java @@ -0,0 +1,114 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/Servlet.java to edit this template + */ +package com.sdsi29.controler; + +import com.sdsi29.bdd.pompierMySQL; +import com.sdsi29.beans.pompier; +import java.io.IOException; +import java.io.PrintWriter; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +/** + * + * @author emile.malcuit + */ +@WebServlet(name="Modification", urlPatterns={"/Modification"}) +public class ModificationServlet extends HttpServlet { + + /** + * Processes requests for both HTTP GET and POST + * methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + try (PrintWriter out = response.getWriter()) { + /* TODO output your page here. You may use following sample code. */ + out.println(""); + out.println(""); + out.println(""); + out.println("Servlet ModificationServlet"); + out.println(""); + out.println(""); + out.println("

Servlet ModificationServlet at " + request.getContextPath() + "

"); + out.println(""); + out.println(""); + } + } + + // + /** + * Handles the HTTP GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + System.out.println("You are in ModificationServlet"); + int idLePompier = Integer.parseInt(request.getParameter("id")); + System.out.println(idLePompier); + + pompierMySQL readLePompier = new pompierMySQL(); + pompier lePompier = readLePompier.read(idLePompier); + + request.setAttribute("lePompier", lePompier); + getServletContext().getRequestDispatcher("/WEB-INF/ModificationPompierJSP.jsp").forward(request, response); + + + } + + /** + * Handles the HTTP POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + System.out.println("doPost ModificationServlet"); + String mail = (String) request.getParameter("mail"); + int grade = Integer.parseInt(request.getParameter("grade")); + String nom = (String) request.getParameter("nom"); + String prenom= (String) request.getParameter("prenom"); + int id = Integer.parseInt(request.getParameter("id")); + System.out.println(nom); + System.out.println(prenom); + System.out.println(mail); + System.out.println(grade); + pompierMySQL poSQL = new pompierMySQL(); + poSQL.updatePompier(id, mail, grade); + System.out.println("hello 30"); + + getServletContext().getRequestDispatcher("/Accueil").forward(request, response); + + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// + +} diff --git a/src/main/java/com/sdsi29/controler/ProfilServlet.java b/src/main/java/com/sdsi29/controler/ProfilServlet.java new file mode 100644 index 0000000..17a38aa --- /dev/null +++ b/src/main/java/com/sdsi29/controler/ProfilServlet.java @@ -0,0 +1,87 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/Servlet.java to edit this template + */ +package com.sdsi29.controler; + +import java.io.IOException; +import java.io.PrintWriter; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +/** + * + * @author emile.malcuit + */ +@WebServlet(name="Profil", urlPatterns={"/Profil"}) +public class ProfilServlet extends HttpServlet { + + /** + * Processes requests for both HTTP GET and POST + * methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + try (PrintWriter out = response.getWriter()) { + /* TODO output your page here. You may use following sample code. */ + out.println(""); + out.println(""); + out.println(""); + out.println("Servlet ProfilServlet"); + out.println(""); + out.println(""); + out.println("

Servlet ProfilServlet at " + request.getContextPath() + "

"); + out.println(""); + out.println(""); + } + } + + // + /** + * Handles the HTTP GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Handles the HTTP POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// + +} diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..7582bf1 --- /dev/null +++ b/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/main/webapp/WEB-INF/AjoutPompierJSP.jsp b/src/main/webapp/WEB-INF/AjoutPompierJSP.jsp new file mode 100644 index 0000000..27830ba --- /dev/null +++ b/src/main/webapp/WEB-INF/AjoutPompierJSP.jsp @@ -0,0 +1,72 @@ +<%-- + Document : AjoutPompierJSP.jsp + Created on : 6 oct. 2025, 16:35:40 + Author : emile.malcuit +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + + Ajout d'un pompier + + + <%@include file="parts/enTete.jspf" %> + <%@include file="parts/menuBar.jspf" %> + + + +
+ +
+
+ +

Accès refusé, veuilez vous connecter

+
+ + diff --git a/src/main/webapp/WEB-INF/ConnexionJSP.jsp b/src/main/webapp/WEB-INF/ConnexionJSP.jsp new file mode 100644 index 0000000..b0b295d --- /dev/null +++ b/src/main/webapp/WEB-INF/ConnexionJSP.jsp @@ -0,0 +1,47 @@ +<%-- + Document : ConnexionJSP + Created on : 6 oct. 2025, 15:36:51 + Author : emile.malcuit +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Connexion + + + + + <%@include file="parts/enTete.jspf" %> + <%@include file="parts/menuBarNonCo.jspf" %> + + <% String erreur = (String) request.getAttribute("erreur"); %> + <% if (erreur != null) { %> +

<%= erreur %>

+ <% } %> + +
+
+

Seul les chefs de centre, les pompiers volontaires et les gestionnaires d’appel sont autorisés à se connecter

+
+ + +
+ + + diff --git a/src/main/webapp/WEB-INF/ListePompierJSP.jsp b/src/main/webapp/WEB-INF/ListePompierJSP.jsp new file mode 100644 index 0000000..2ec9401 --- /dev/null +++ b/src/main/webapp/WEB-INF/ListePompierJSP.jsp @@ -0,0 +1,49 @@ +<%-- + Document : ListePompierJSP + Created on : 6 oct. 2025, 15:37:31 + Author : emile.malcuit +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + Accueil + + + <%@include file="parts/enTete.jspf" %> + <%@include file="parts/menuBar.jspf" %> + <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + + + <% String valide = (String) request.getAttribute("valide"); %> + <% if (valide != null) { %> +

<%= valide %>

+ <% } %> +
+
+ +
+
${unPompier.id} : ${unPompier.nom}
+
+

Grade : ${unPompier.grade}

+

Status : ${unPompier.status}

+

Mail : ${unPompier.mail}

+
+ Modifier les données +
+
+
+
+ + + + +

Accès refusé, veuilez vous connecter

+
+ + + diff --git a/src/main/webapp/WEB-INF/ModificationPompierJSP.jsp b/src/main/webapp/WEB-INF/ModificationPompierJSP.jsp new file mode 100644 index 0000000..4c470e5 --- /dev/null +++ b/src/main/webapp/WEB-INF/ModificationPompierJSP.jsp @@ -0,0 +1,73 @@ +<%-- + Document : ModificationPompierJSP + Created on : 6 oct. 2025, 15:37:18 + Author : emile.malcuit +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + JSP Page + + + <%@include file="parts/enTete.jspf" %> + <%@include file="parts/menuBar.jspf" %> +
+ +
+ +
+ + diff --git a/src/main/webapp/WEB-INF/ProfilJSP.jsp b/src/main/webapp/WEB-INF/ProfilJSP.jsp new file mode 100644 index 0000000..e504eee --- /dev/null +++ b/src/main/webapp/WEB-INF/ProfilJSP.jsp @@ -0,0 +1,17 @@ +<%-- + Document : ProfilJSP + Created on : 6 oct. 2025, 15:38:13 + Author : emile.malcuit +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + JSP Page + + +

Hello World!

+ + diff --git a/src/main/webapp/WEB-INF/beans.xml b/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..9dfae34 --- /dev/null +++ b/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/parts/enTete.jspf b/src/main/webapp/WEB-INF/parts/enTete.jspf new file mode 100644 index 0000000..20a79ac --- /dev/null +++ b/src/main/webapp/WEB-INF/parts/enTete.jspf @@ -0,0 +1,11 @@ +<%-- any content can be specified here e.g.: --%> +<%@ page pageEncoding="UTF-8" %> +
+ Logo SDIS 29 +
+ Service Départemental d’Incendie et Secours +
+
+ connexionIcon +
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/parts/menuBar.jspf b/src/main/webapp/WEB-INF/parts/menuBar.jspf new file mode 100644 index 0000000..9919af1 --- /dev/null +++ b/src/main/webapp/WEB-INF/parts/menuBar.jspf @@ -0,0 +1,14 @@ +<%-- any content can be specified here e.g.: --%> +<%@ page pageEncoding="UTF-8" %> + diff --git a/src/main/webapp/WEB-INF/parts/menuBarNonCo.jspf b/src/main/webapp/WEB-INF/parts/menuBarNonCo.jspf new file mode 100644 index 0000000..1b8bcd4 --- /dev/null +++ b/src/main/webapp/WEB-INF/parts/menuBarNonCo.jspf @@ -0,0 +1,11 @@ +<%-- any content can be specified here e.g.: --%> +<%@ page pageEncoding="UTF-8" %> + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..b9272dc --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,51 @@ + + + + Accueil + + + Authentification + com.sdsi29.controler.AuthentificationServlet + + + Accueil + com.sdsi29.controler.ListePompierServlet + + + Modification + com.sdsi29.controler.ModificationServlet + + + Profil + com.sdsi29.controler.ProfilServlet + + + AjoutPompier + com.sdsi29.controler.AjoutPompierServlet + + + Authentification + /Authentification + + + Accueil + /Accueil + + + Modification + /Modification + + + Profil + /Profil + + + AjoutPompier + /Ajout + + + + 30 + + + diff --git a/src/main/webapp/css/pageStyle.css b/src/main/webapp/css/pageStyle.css new file mode 100644 index 0000000..1a17e7b --- /dev/null +++ b/src/main/webapp/css/pageStyle.css @@ -0,0 +1,187 @@ +/* +Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license +Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/CascadeStyleSheet.css to edit this template +*/ +/* + Created on : 9 oct. 2025, 11:05:39 + Author : emile.malcuit +*/ +body { + margin: 0; + padding: 0; + font-family: Arial, sans-serif; + background-color: #39322e; + color: white; +} + +.container { + display: flex; + justify-content: center; + align-items: center; + min-height: 75vh; + gap: 100px; + padding: 20px; +} + +.info-box { + max-width: 300px; + font-size: 1.2em; + text-align: center; +} + +.login-form { + background-color: #a3130e; + padding: 30px; + border-radius: 20px; + width: 300px; + display: flex; + flex-direction: column; + color: white; +} + +.imgCo { + display: flex; + justify-content: center; + margin-bottom: 15px; +} + +.imgCo img { + width: 60px; + height: auto; +} + +.login-form h2 { + text-align: center; + margin-bottom: 20px; +} + +.login-form label { + margin-top: 10px; + font-weight: bold; +} + +.login-form input { + padding: 8px; + margin-top: 5px; + border: none; + border-bottom: 2px solid #333; + background: transparent; + color: white; + outline: none; +} + +.login-form button { + margin-top: 20px; + padding: 10px; + background-color: #2e2a28; + color: white; + border: none; + border-radius: 8px; + cursor: pointer; + font-size: 1em; +} + +.login-form button:hover { + background-color: #444; +} + +select { + width: 100%; + padding: 10px; + margin-top: 5px; + margin-bottom: 20px; + background-color: #b71c1c; /* même rouge que le fond du formulaire */ + color: white; + border: none; + border-bottom: 2px solid #444; + border-radius: 4px; + font-size: 16px; + font-family: inherit; + appearance: none; /* Supprime le style natif */ + -webkit-appearance: none; + -moz-appearance: none; + cursor: pointer; + box-sizing: border-box; +} + +/* Facultatif : icône de flèche personnalisée */ +select::after { + content: '▼'; + position: absolute; + right: 15px; + top: calc(50% - 7px); + pointer-events: none; +} + +/* Focus */ +select:focus { + outline: none; + border-bottom: 2px solid white; +} + + + .card-container { + display: flex; + flex-wrap: wrap; + gap: 20px; /* espace entre cards */ + max-width: 1080px; /* 5 * 200 + 4 * 20 */ + justify-content: center; + } + + .card { + background-color: #292323; + color: #fff; + width: 200px; + height: 200px; + border-radius: 12px; + overflow: hidden; + transition: transform 0.3s ease, box-shadow 0.3s ease; + display: flex; + flex-direction: column; + padding: 0; + } + + .card:hover { + transform: translateY(-10px); + box-shadow: 0 16px 40px rgba(163, 19, 14, 0.6); + } + + .card-header { + background-color: #a3130e; + padding: 8px 12px; + font-size: 1.1rem; + font-weight: bold; + line-height: 1.2; + } + + .card-body { + padding: 5px 12px; + font-size: 0.9rem; + line-height: 1; + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; + } + + .card-button { + margin: 10px auto 12px; + padding: 8px 16px; + background-color: #a3130e; + color: #fff; + border: none; + border-radius: 8px; + box-sizing: border-box; + text-align: center; + font-weight: 600; + cursor: pointer; + transition: background-color 0.3s ease; + text-decoration: none; + font-size: 0.9rem; + width: calc(100% - 24px); + max-width: 176px; + display: block; + } + + .card-button:hover { + background-color: #7f0e0a; + } diff --git a/src/main/webapp/css/styleHeaderNav.css b/src/main/webapp/css/styleHeaderNav.css new file mode 100644 index 0000000..c3b440d --- /dev/null +++ b/src/main/webapp/css/styleHeaderNav.css @@ -0,0 +1,118 @@ +/* +Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license +Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/CascadeStyleSheet.css to edit this template +*/ +/* + Created on : 6 oct. 2025, 17:29:05 + Author : emile.malcuit +*/ +.header { + display: flex; + align-items: center; + justify-content: space-between; + background-color: #39322e; /* Dark background for the header */ + padding: 10px 20px; + color: white; +} + +/* Logo Image styling */ +.header img { + height: 50px; /* Adjust height of the logo */ + width: auto; +} + +/* Title styling */ +.header-title { + font-size: 24px; + font-weight: bold; + color: white; + flex-grow: 1; + text-align: center; +} + +/* Styling for the connection icon section */ +.logoConnexion a { + display: flex; + align-items: center; + justify-content: center; + width: 40px; + height: 40px; + background-color: #9b3d34; /* Red background */ + border-radius: 50%; + text-decoration: none; +} + +.logoConnexion img { + width: 20px; + height: auto; + color: white; +} + +/* Optional hover effect for the connection icon */ +.logoConnexion a:hover { + background-color: #c0392b; /* Slightly lighter red on hover */ +} + + + + +/* Style général pour la barre de navigation */ +nav { + display: flex; + padding: 6px; + padding-left: 0px; + background-color: #39322e; +} + +/* Conteneur arrondi pour les éléments de navigation */ +.arrondi { + display: flex; + align-items: center; + justify-content: space-between; + background-color: #a7170e; /* Couleur de fond similaire au header */ + padding: 10px 20px; + border-bottom-right-radius: 15px; + border-top-right-radius: 15px; + box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); /* Ombrage léger sous le conteneur */ + width: 100%; /* S'adapte à la largeur du conteneur parent */ + max-width: 600px; /* Limite la largeur pour une meilleure mise en page */ +} + +/* Conteneur de l'icône d'accueil */ +.accueil a { + display: block; + width: 40px; + height: 40px; +} + +/* Image d'accueil */ +.accueil img { + width: 100%; + height: 100%; + object-fit: contain; /* Pour que l'image s'adapte bien dans le conteneur */ +} + +/* Conteneur pour l'ajout de pompier */ +.menuButton a { + font-size: 16px; + font-weight: bold; + color: white; + text-decoration: none; + padding: 8px 16px; + background-color: #c0392b; /* Couleur de fond rouge */ + border-radius: 4px; /* Coins arrondis pour le bouton */ + transition: background-color 0.3s ease; +} + +/* Effet de survol sur le lien "Ajout d'un pompier" */ +.menuButton a:hover { + background-color: #e74c3c; /* Légèrement plus clair au survol */ +} + +/* Style de la police et mise en forme du texte dans le lien */ +.menuButton a { + display: flex; + align-items: center; + justify-content: center; +} + diff --git a/src/main/webapp/img/connexionIcon.png b/src/main/webapp/img/connexionIcon.png new file mode 100644 index 0000000..9ee0c16 Binary files /dev/null and b/src/main/webapp/img/connexionIcon.png differ diff --git a/src/main/webapp/img/home.png b/src/main/webapp/img/home.png new file mode 100644 index 0000000..95eae8b Binary files /dev/null and b/src/main/webapp/img/home.png differ diff --git a/src/main/webapp/img/logoSDIS29.png b/src/main/webapp/img/logoSDIS29.png new file mode 100644 index 0000000..3a04083 Binary files /dev/null and b/src/main/webapp/img/logoSDIS29.png differ