Skip to content
Commits on Source (3)
...@@ -14,7 +14,10 @@ import jakarta.servlet.http.HttpServletRequest; ...@@ -14,7 +14,10 @@ import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.sql.Date;
import java.sql.SQLException; import java.sql.SQLException;
import java.time.LocalDate;
import java.time.format.DateTimeParseException;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
...@@ -88,7 +91,28 @@ public class CreerCollaborateur extends HttpServlet{ ...@@ -88,7 +91,28 @@ public class CreerCollaborateur extends HttpServlet{
CreerCollaborateurFormChecker nv = new CreerCollaborateurFormChecker(req); CreerCollaborateurFormChecker nv = new CreerCollaborateurFormChecker(req);
Collaborateur collaborateur = nv.checkForm(); Collaborateur collaborateur = nv.checkForm();
// Gestion de la sélection RQTH et de la date de renouvellement
String rqth = req.getParameter("rqth");
boolean isOuiSelected = "oui".equals(rqth);
String dateDeRenouvellementStr = req.getParameter("date_de_renouvellement");
LocalDate dateDeRenouvellement = null;
if (isOuiSelected) {
try {
dateDeRenouvellement = LocalDate.parse(dateDeRenouvellementStr);
} catch (DateTimeParseException e) {
nv.addError("date_de_renouvellement", "Date de renouvellement invalide.");
}
}
else {
dateDeRenouvellement = null; // Default date if "non" is selected
}
collaborateur.setDate_de_renouvellement(dateDeRenouvellement);
req.setAttribute("isOuiSelected", isOuiSelected);
//if (nv.getErrors().isEmpty()) {
if (nv.getErrors().isEmpty()){ if (nv.getErrors().isEmpty()){
CollaborateurDao collaborateurDao = new CollaborateurDao(); CollaborateurDao collaborateurDao = new CollaborateurDao();
// Appel de la méthode create du DOA // Appel de la méthode create du DOA
...@@ -100,24 +124,20 @@ public class CreerCollaborateur extends HttpServlet{ ...@@ -100,24 +124,20 @@ public class CreerCollaborateur extends HttpServlet{
if (collaborateurDao.exists(collaborateur.getMatricule())) { if (collaborateurDao.exists(collaborateur.getMatricule())) {
nv.addError("matricule", "Le matricule existe déjà."); nv.addError("matricule", "Le matricule existe déjà.");
req.setAttribute("errors", nv.getErrors()); req.setAttribute("errors", nv.getErrors());
req.setAttribute("collaborateur", collaborateur);
req.setAttribute("errorMsg", "Votre formulaire comporte des erreurs"); req.setAttribute("errorMsg", "Votre formulaire comporte des erreurs");
req.getRequestDispatcher("/WEB-INF/jsp/creerCollaborateur.jsp").forward(req, resp); req.getRequestDispatcher("/WEB-INF/jsp/creerCollaborateur.jsp").forward(req, resp);
return; return;
} }
collaborateurDao.create(collaborateur); collaborateurDao.create(collaborateur);
Collaborateur collab = collaborateurDao.read(collaborateur.getId()); Collaborateur collab = collaborateurDao.read(collaborateur.getId());
req.setAttribute("collaborateur", collab); req.setAttribute("collaborateur", collab);
req.setAttribute("message", "Votre collaborateur est bien enregistré"); req.setAttribute("message", "Votre collaborateur est bien enregistré");
req.getRequestDispatcher("/WEB-INF/jsp/collaborateur.jsp").forward(req, resp); req.getRequestDispatcher("/WEB-INF/jsp/collaborateur.jsp").forward(req, resp);
/*} catch (SQLException ex) {
Logger.getLogger(CreerCollaborateur.class.getName()).log(Level.SEVERE, null, ex);
req.setAttribute("errorMsg", "Votre formulaire comporte des erreurs");
req.getRequestDispatcher("/WEB-INF/jsp/creerCollaborateur.jsp/").forward(req, resp);
}*/
} catch (SQLException ex) { } catch (SQLException ex) {
if (ex.getMessage().contains("Le matricule existe déjà")) { if (ex.getMessage().contains("Le matricule existe déjà")) {
nv.addError("matricule", "Le matricule existe déjà."); nv.addError("matricule", "Le matricule existe déjà.");
...@@ -132,8 +152,11 @@ public class CreerCollaborateur extends HttpServlet{ ...@@ -132,8 +152,11 @@ public class CreerCollaborateur extends HttpServlet{
} }
}else{ }else{
req.setAttribute("errorMsg", "Votre formulaire comporte des erreurs"); req.setAttribute("errorMsg", "Votre formulaire comporte des erreurs");
req.setAttribute("errors", nv.getErrors());
req.setAttribute("collaborateur", collaborateur);
req.getRequestDispatcher("/WEB-INF/jsp/creerCollaborateur.jsp").forward(req, resp); req.getRequestDispatcher("/WEB-INF/jsp/creerCollaborateur.jsp").forward(req, resp);
} }
} //}
} }}
\ No newline at end of file
...@@ -36,16 +36,15 @@ public class CollaborateurDao extends Dao<Collaborateur> { ...@@ -36,16 +36,15 @@ public class CollaborateurDao extends Dao<Collaborateur> {
obj.setMatricule(rs.getInt("matricule")); obj.setMatricule(rs.getInt("matricule"));
obj.setNom(rs.getString("nom")); obj.setNom(rs.getString("nom"));
obj.setPrenom(rs.getString("prenom")); obj.setPrenom(rs.getString("prenom"));
obj.setDate_de_naissance(rs.getDate("date_de_naissance").toLocalDate());
obj.setNumero_voie(rs.getString("numero_voie"));
obj.setAdresse(rs.getString("adresse"));
obj.setCode_postal(rs.getInt("code_postal"));
obj.setVille(rs.getString("ville"));
obj.setTelephone_personnel(rs.getString("telephone_personnel")); obj.setTelephone_personnel(rs.getString("telephone_personnel"));
obj.setStatut(rs.getString("statut")); obj.setStatut(rs.getString("statut"));
obj.setCategorie(rs.getString("categorie")); obj.setCategorie(rs.getString("categorie"));
obj.setGenre(rs.getString("genre")); obj.setGenre(rs.getString("genre"));
obj.setRqth(rs.getString("rqth")); obj.setRqth(rs.getString("rqth"));
if(rs.getDate("date_de_renouvellement") != null){
obj.setDate_de_renouvellement(rs.getDate("date_de_renouvellement").toLocalDate());
}
obj.setMetier(rs.getString("metier")); obj.setMetier(rs.getString("metier"));
} }
} catch (SQLException ex) { } catch (SQLException ex) {
...@@ -61,16 +60,13 @@ public class CollaborateurDao extends Dao<Collaborateur> { ...@@ -61,16 +60,13 @@ public class CollaborateurDao extends Dao<Collaborateur> {
obj.setMatricule(rs.getInt("matricule")); obj.setMatricule(rs.getInt("matricule"));
obj.setNom(rs.getString("nom")); obj.setNom(rs.getString("nom"));
obj.setPrenom(rs.getString("prenom")); obj.setPrenom(rs.getString("prenom"));
obj.setDate_de_naissance(rs.getDate("date_de_naissance").toLocalDate());
obj.setNumero_voie(rs.getString("numero_voie"));
obj.setAdresse(rs.getString("adresse"));
obj.setCode_postal(rs.getInt("code_postal"));
obj.setVille(rs.getString("ville"));
obj.setTelephone_personnel(rs.getString("telephone_personnel")); obj.setTelephone_personnel(rs.getString("telephone_personnel"));
obj.setStatut(rs.getString("statut")); obj.setStatut(rs.getString("statut"));
obj.setCategorie(rs.getString("categorie")); obj.setCategorie(rs.getString("categorie"));
obj.setGenre(rs.getString("genre")); obj.setGenre(rs.getString("genre"));
obj.setRqth(rs.getString("rqth")); obj.setRqth(rs.getString("rqth"));
obj.setDate_de_renouvellement(rs.getDate("date_de_renouvellement").toLocalDate());
obj.setMetier(rs.getString("metier")); obj.setMetier(rs.getString("metier"));
return obj; return obj;
...@@ -78,8 +74,8 @@ public class CollaborateurDao extends Dao<Collaborateur> { ...@@ -78,8 +74,8 @@ public class CollaborateurDao extends Dao<Collaborateur> {
@Override @Override
public void create(Collaborateur obj) throws SQLException{ public void create(Collaborateur obj) throws SQLException{
String sql = "INSERT INTO collaborateur (matricule, nom, prenom, date_de_naissance, numero_voie, adresse, code_postal, ville, telephone_personnel, statut, categorie, genre, rqth, metier)" String sql = "INSERT INTO collaborateur (matricule, nom, prenom, telephone_personnel, statut, categorie, genre, rqth, date_de_renouvellement, metier)"
+ "VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + "VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
try { try {
PreparedStatement pstmt = connexion.prepareStatement(sql, PreparedStatement.RETURN_GENERATED_KEYS); PreparedStatement pstmt = connexion.prepareStatement(sql, PreparedStatement.RETURN_GENERATED_KEYS);
...@@ -87,23 +83,20 @@ public class CollaborateurDao extends Dao<Collaborateur> { ...@@ -87,23 +83,20 @@ public class CollaborateurDao extends Dao<Collaborateur> {
pstmt.setString(2, obj.getNom()); pstmt.setString(2, obj.getNom());
pstmt.setString(3, obj.getPrenom()); pstmt.setString(3, obj.getPrenom());
pstmt.setString(4, obj.getTelephone_personnel());
LocalDate localDate = obj.getDate_de_naissance(); pstmt.setString(5, obj.getStatut());
pstmt.setString(6, obj.getCategorie());
pstmt.setString(7, obj.getGenre());
pstmt.setString(8, obj.getRqth());
LocalDate localDate = obj.getDate_de_renouvellement();
if (localDate != null) { if (localDate != null) {
pstmt.setDate(4, java.sql.Date.valueOf(localDate)); pstmt.setDate(9, java.sql.Date.valueOf(localDate));
} else { } else {
pstmt.setDate(4, null); pstmt.setDate(9, null);
} }
pstmt.setString(5, obj.getNumero_voie());
pstmt.setString(6, obj.getAdresse());
pstmt.setInt(7, obj.getCode_postal()); pstmt.setString(10, obj.getMetier());
pstmt.setString(8, obj.getVille());
pstmt.setString(9, obj.getTelephone_personnel());
pstmt.setString(10, obj.getStatut());
pstmt.setString(11, obj.getCategorie());
pstmt.setString(12, obj.getGenre());
pstmt.setString(13, obj.getRqth());
pstmt.setString(14, obj.getMetier());
int nbLines = pstmt.executeUpdate(); int nbLines = pstmt.executeUpdate();
if (nbLines == 1) { if (nbLines == 1) {
ResultSet autoGeneratedKeys = pstmt.getGeneratedKeys(); ResultSet autoGeneratedKeys = pstmt.getGeneratedKeys();
...@@ -121,7 +114,7 @@ public class CollaborateurDao extends Dao<Collaborateur> { ...@@ -121,7 +114,7 @@ public class CollaborateurDao extends Dao<Collaborateur> {
@Override @Override
public void update (Collaborateur obj){ public void update (Collaborateur obj){
String sql = "UPDATE collaborateur SET matricule=?, nom=?, prenom=?, date_de_naissance=?, numero_voie=?, adresse=?, code_postal=?, ville=?, telephone_personnel=?, statut=?, categorie=?, genre=?, rqth=?, metier=?" String sql = "UPDATE collaborateur SET matricule=?, nom=?, prenom=?, telephone_personnel=?, statut=?, categorie=?, genre=?, rqth=?, date_de_renouvellement=?, metier=?"
+ "WHERE id_collaborateur=?"; + "WHERE id_collaborateur=?";
try{ try{
...@@ -129,23 +122,19 @@ public class CollaborateurDao extends Dao<Collaborateur> { ...@@ -129,23 +122,19 @@ public class CollaborateurDao extends Dao<Collaborateur> {
pstmt.setInt(1, obj.getMatricule()); pstmt.setInt(1, obj.getMatricule());
pstmt.setString(2, obj.getNom()); pstmt.setString(2, obj.getNom());
pstmt.setString(3, obj.getPrenom()); pstmt.setString(3, obj.getPrenom());
pstmt.setString(4, obj.getTelephone_personnel());
LocalDate localDate = obj.getDate_de_naissance(); pstmt.setString(5, obj.getStatut());
pstmt.setString(6, obj.getCategorie());
pstmt.setString(7, obj.getGenre());
pstmt.setString(8, obj.getRqth());
LocalDate localDate = obj.getDate_de_renouvellement();
if (localDate != null) { if (localDate != null) {
pstmt.setDate(4, java.sql.Date.valueOf(localDate)); pstmt.setDate(9, java.sql.Date.valueOf(localDate));
} else { } else {
pstmt.setDate(4, null); pstmt.setDate(9, null);
} }
pstmt.setString(5, obj.getNumero_voie());
pstmt.setString(6, obj.getAdresse()); pstmt.setString(10, obj.getMetier());
pstmt.setInt(7, obj.getCode_postal());
pstmt.setString(8, obj.getVille());
pstmt.setString(9, obj.getTelephone_personnel());
pstmt.setString(10, obj.getStatut());
pstmt.setString(11, obj.getCategorie());
pstmt.setString(12, obj.getGenre());
pstmt.setString(13, obj.getRqth());
pstmt.setString(14, obj.getMetier());
pstmt.executeUpdate(); pstmt.executeUpdate();
......
...@@ -22,8 +22,7 @@ public class TestCollaborateur { ...@@ -22,8 +22,7 @@ public class TestCollaborateur {
CollaborateurDao collDao = new CollaborateurDao(); CollaborateurDao collDao = new CollaborateurDao();
Collaborateur collab = collDao.read(1); Collaborateur collab = collDao.read(1);
System.out.println("collab : " + collab.getId() + " " + collab.getMatricule() + " " + collab.getNom() + " " + collab.getPrenom() + " " + collab.getDate_de_naissance() + " " + collab.getNumero_voie() + " " System.out.println("collab : " + collab.getId() + " " + collab.getMatricule() + " " + collab.getNom() + " " + collab.getPrenom() + " " + collab.getTelephone_personnel() + " " + collab.getStatut() + " " + collab.getCategorie() + " " + collab.getGenre() + " "
+ collab.getAdresse() + " " + collab.getCode_postal() + " " + collab.getVille() + " " + collab.getTelephone_personnel() + " " + collab.getStatut() + " " + collab.getCategorie() + " " + collab.getGenre() + " "
+ collab.getRqth() + " " + collab.getMetier()); + collab.getRqth() + " " + collab.getMetier());
......
...@@ -17,16 +17,12 @@ public class Collaborateur implements Identifiable, Serializable { ...@@ -17,16 +17,12 @@ public class Collaborateur implements Identifiable, Serializable {
private Integer matricule; private Integer matricule;
private String nom; private String nom;
private String prenom; private String prenom;
private LocalDate date_de_naissance;
private String numero_voie;
private String adresse;
private Integer code_postal;
private String ville;
private String telephone_personnel; private String telephone_personnel;
private String statut; private String statut;
private String categorie; private String categorie;
private String genre; private String genre;
private String rqth; private String rqth;
private LocalDate date_de_renouvellement;
private String metier; private String metier;
@Override @Override
...@@ -37,16 +33,12 @@ public class Collaborateur implements Identifiable, Serializable { ...@@ -37,16 +33,12 @@ public class Collaborateur implements Identifiable, Serializable {
sb.append(", matricule=").append(matricule); sb.append(", matricule=").append(matricule);
sb.append(", nom=").append(nom); sb.append(", nom=").append(nom);
sb.append(", prenom=").append(prenom); sb.append(", prenom=").append(prenom);
sb.append(", date_de_naissance=").append(date_de_naissance);
sb.append(", numero_voie=").append(numero_voie);
sb.append(", adresse=").append(adresse);
sb.append(", code_postal=").append(code_postal);
sb.append(", ville=").append(ville);
sb.append(", telephone_personnel=").append(telephone_personnel); sb.append(", telephone_personnel=").append(telephone_personnel);
sb.append(", statut=").append(statut); sb.append(", statut=").append(statut);
sb.append(", categorie=").append(categorie); sb.append(", categorie=").append(categorie);
sb.append(", genre=").append(genre); sb.append(", genre=").append(genre);
sb.append(", rqth=").append(rqth); sb.append(", rqth=").append(rqth);
sb.append(", date_de_renouvellement=").append(date_de_renouvellement);
sb.append(", metier=").append(metier); sb.append(", metier=").append(metier);
sb.append('}'); sb.append('}');
return sb.toString(); return sb.toString();
...@@ -59,22 +51,17 @@ public class Collaborateur implements Identifiable, Serializable { ...@@ -59,22 +51,17 @@ public class Collaborateur implements Identifiable, Serializable {
hash = 89 * hash + Objects.hashCode(this.matricule); hash = 89 * hash + Objects.hashCode(this.matricule);
hash = 89 * hash + Objects.hashCode(this.nom); hash = 89 * hash + Objects.hashCode(this.nom);
hash = 89 * hash + Objects.hashCode(this.prenom); hash = 89 * hash + Objects.hashCode(this.prenom);
hash = 89 * hash + Objects.hashCode(this.date_de_naissance);
hash = 89 * hash + Objects.hashCode(this.numero_voie);
hash = 89 * hash + Objects.hashCode(this.adresse);
hash = 89 * hash + Objects.hashCode(this.code_postal);
hash = 89 * hash + Objects.hashCode(this.ville);
hash = 89 * hash + Objects.hashCode(this.telephone_personnel); hash = 89 * hash + Objects.hashCode(this.telephone_personnel);
hash = 89 * hash + Objects.hashCode(this.statut); hash = 89 * hash + Objects.hashCode(this.statut);
hash = 89 * hash + Objects.hashCode(this.categorie); hash = 89 * hash + Objects.hashCode(this.categorie);
hash = 89 * hash + Objects.hashCode(this.genre); hash = 89 * hash + Objects.hashCode(this.genre);
hash = 89 * hash + Objects.hashCode(this.rqth); hash = 89 * hash + Objects.hashCode(this.rqth);
hash = 89 * hash + Objects.hashCode(this.date_de_renouvellement);
hash = 89 * hash + Objects.hashCode(this.metier); hash = 89 * hash + Objects.hashCode(this.metier);
return hash; return hash;
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) { if (this == obj) {
...@@ -93,10 +80,7 @@ public class Collaborateur implements Identifiable, Serializable { ...@@ -93,10 +80,7 @@ public class Collaborateur implements Identifiable, Serializable {
if (!Objects.equals(this.prenom, other.prenom)) { if (!Objects.equals(this.prenom, other.prenom)) {
return false; return false;
} }
if (!Objects.equals(this.adresse, other.adresse)) { if (!Objects.equals(this.telephone_personnel, other.telephone_personnel)) {
return false;
}
if (!Objects.equals(this.ville, other.ville)) {
return false; return false;
} }
if (!Objects.equals(this.statut, other.statut)) { if (!Objects.equals(this.statut, other.statut)) {
...@@ -120,20 +104,15 @@ public class Collaborateur implements Identifiable, Serializable { ...@@ -120,20 +104,15 @@ public class Collaborateur implements Identifiable, Serializable {
if (!Objects.equals(this.matricule, other.matricule)) { if (!Objects.equals(this.matricule, other.matricule)) {
return false; return false;
} }
if (!Objects.equals(this.date_de_naissance, other.date_de_naissance)) { return Objects.equals(this.date_de_renouvellement, other.date_de_renouvellement);
return false;
}
if (!Objects.equals(this.numero_voie, other.numero_voie)) {
return false;
}
if (!Objects.equals(this.code_postal, other.code_postal)) {
return false;
}
return Objects.equals(this.telephone_personnel, other.telephone_personnel);
} }
@Override @Override
public Integer getId() { public Integer getId() {
return id; return id;
...@@ -168,46 +147,6 @@ public class Collaborateur implements Identifiable, Serializable { ...@@ -168,46 +147,6 @@ public class Collaborateur implements Identifiable, Serializable {
this.prenom = prenom; this.prenom = prenom;
} }
public LocalDate getDate_de_naissance() {
return date_de_naissance;
}
public void setDate_de_naissance(LocalDate date_de_naissance) {
this.date_de_naissance = date_de_naissance;
}
public String getNumero_voie() {
return numero_voie;
}
public void setNumero_voie(String numero_voie) {
this.numero_voie = numero_voie;
}
public String getAdresse() {
return adresse;
}
public void setAdresse(String adresse) {
this.adresse = adresse;
}
public Integer getCode_postal() {
return code_postal;
}
public void setCode_postal(Integer code_postal) {
this.code_postal = code_postal;
}
public String getVille() {
return ville;
}
public void setVille(String ville) {
this.ville = ville;
}
public String getTelephone_personnel() { public String getTelephone_personnel() {
return telephone_personnel; return telephone_personnel;
} }
...@@ -250,6 +189,14 @@ public class Collaborateur implements Identifiable, Serializable { ...@@ -250,6 +189,14 @@ public class Collaborateur implements Identifiable, Serializable {
this.rqth = rqth; this.rqth = rqth;
} }
public LocalDate getDate_de_renouvellement (){
return date_de_renouvellement;
}
public void setDate_de_renouvellement(LocalDate date_de_renouvellement) {
this.date_de_renouvellement = date_de_renouvellement;
}
public String getMetier() { public String getMetier() {
return metier; return metier;
} }
......
package forms; package forms;
import dao.DaoFactory; import dao.DaoFactory;
import entities.Collaborateur; import entities.Collaborateur;
import forms.FormChecker; import forms.FormChecker;
...@@ -23,16 +24,13 @@ public class CreerCollaborateurFormChecker extends FormChecker<Collaborateur> { ...@@ -23,16 +24,13 @@ public class CreerCollaborateurFormChecker extends FormChecker<Collaborateur> {
String matriculeStr = request.getParameter("matricule"); String matriculeStr = request.getParameter("matricule");
String nom = request.getParameter("nom"); String nom = request.getParameter("nom");
String prenom = request.getParameter("prenom"); String prenom = request.getParameter("prenom");
String dateDeNaissanceStr = request.getParameter("date_de_naissance");
String numero_voie = request.getParameter("numero_voie");
String adresse = request.getParameter("adresse");
String codePostalStr = request.getParameter("code_postal");
String ville = request.getParameter("ville");
String telephone_personnel = request.getParameter("telephone_personnel"); String telephone_personnel = request.getParameter("telephone_personnel");
String statut = request.getParameter("statut"); String statut = request.getParameter("statut");
String categorie = request.getParameter("categorie"); String categorie = request.getParameter("categorie");
String genre = request.getParameter("genre"); String genre = request.getParameter("genre");
String rqth = request.getParameter("rqth"); String rqth = request.getParameter("rqth");
String dateDeRenouvellement = request.getParameter("date_de_renouvellement");
String metier = request.getParameter("metier"); String metier = request.getParameter("metier");
// Convertir les champs Integer // Convertir les champs Integer
...@@ -40,110 +38,38 @@ public class CreerCollaborateurFormChecker extends FormChecker<Collaborateur> { ...@@ -40,110 +38,38 @@ public class CreerCollaborateurFormChecker extends FormChecker<Collaborateur> {
Integer matricule = Integer.parseInt(matriculeStr); Integer matricule = Integer.parseInt(matriculeStr);
obj.setMatricule(matricule); obj.setMatricule(matricule);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
System.err.println("Erreur de conversion pour le champ matricule : " + e.getMessage()); setError("matricule", "Le matricule ne peut pas contenir de caractères alphanumériques");
}
// Validation du code postal
if (codePostalStr == null || codePostalStr.isEmpty()) {
setError("code_postal", "Le code postal est trop long, 5 chiffres svp.");
} else if (!codePostalStr.matches("\\d{1,5}")) {
setError("code_postal", "Le code postal doit contenir 5 chiffres.");
} else {
try {
Integer code_postal = Integer.parseInt(codePostalStr);
obj.setCode_postal(code_postal);
} catch (NumberFormatException e) {
setError("code_postal", "Erreur de conversion pour le champ code_postal : " + e.getMessage());
}
}
// Validation du numéro de téléphone personnel
if (telephone_personnel == null || telephone_personnel.isEmpty()) {
setError("telephone_personnel", "Le numéro de téléphone personnel est trop long, 10 chiffres svp.");
} else if (!telephone_personnel.matches("\\d{1,10}")) {
setError("telephone_personnel", "Le numéro de téléphone personnel doit contenir entre 1 et 10 chiffres.");
} else {
obj.setTelephone_personnel(telephone_personnel);
} }
// Validation de la date de naissance
LocalDate date_de_naissance = null;
if (dateDeNaissanceStr != null && !dateDeNaissanceStr.isEmpty()) {
try {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
date_de_naissance = LocalDate.parse(dateDeNaissanceStr, formatter);
obj.setDate_de_naissance(date_de_naissance);
} catch (DateTimeParseException e) {
setError("date_de_naissance", "Erreur de conversion pour le champ date_de_naissance : " + e.getMessage());
}
} else {
setError("date_de_naissance", "Le champ date_de_naissance est vide ou non valide.");
}
/* 1ere Version // Validation du code postal
if (codePostalStr == null || codePostalStr.isEmpty()) {
setError("code_postal", "Le code postal est requis.");
} else if (!codePostalStr.matches("\\d{1,10}")) {
setError("code_postal", "Le code postal doit contenir entre 1 et 10 chiffres.");
} else {
try {
Integer code_postal = Integer.parseInt(codePostalStr);
obj.setCode_postal(code_postal);
} catch (NumberFormatException e) {
System.err.println("Erreur de conversion pour le champ code_postal : " + e.getMessage());
}
/*
// Convertir les champs Date // Convertir les champs Date
LocalDate date_de_naissance = null; LocalDate date_de_renouvellement = null;
if (dateDeNaissanceStr != null && !dateDeNaissanceStr.isEmpty()) { if (dateDeRenouvellement != null && !dateDeRenouvellement.isEmpty()) {
try { try {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
date_de_naissance = LocalDate.parse(dateDeNaissanceStr, formatter); date_de_renouvellement = LocalDate.parse(dateDeRenouvellement, formatter);
obj.setDate_de_naissance(date_de_naissance); obj.setDate_de_renouvellement(date_de_renouvellement);
} catch (DateTimeParseException e) { } catch (DateTimeParseException e) {
setError("date_de_naissance", "Erreur de conversion pour le champ date_de_naissance : " + e.getMessage()); setError("date_de_renouvellement", "Erreur de conversion pour le champ date_de_renouvellement : " + e.getMessage());
} }
} else {
setError("date_de_naissance", "Le champ date_de_naissance est vide ou non valide.");
} }
/*else {
setError("date_de_renouvellement", "Le champ date_de_renouvellement est vide ou non valide.");
}*/
obj.setTelephone_personnel(telephone_personnel);
if (telephone_personnel == null || telephone_personnel.isEmpty()) { if (telephone_personnel == null || telephone_personnel.isEmpty()) {
setError("telephone_personnel", "Le numéro de téléphone personnel est requis."); setError("telephone_personnel", "Le numéro de téléphone personnel est requis.");
} else if (!telephone_personnel.matches("\\d{1,10}")) { } else if (!telephone_personnel.matches("\\d{10}")) {
setError("telephone_personnel", "Le numéro de téléphone personnel doit contenir entre 1 et 10 chiffres."); setError("telephone_personnel", "Le numéro de téléphone personnel doit contenir entre 1 et 10 chiffres.");
} else { }
obj.setTelephone_personnel(telephone_personnel);
}*/
// Traiter les autres champs String // Traiter les autres champs String
obj.setNom(nom); obj.setNom(nom);
obj.setPrenom(prenom); obj.setPrenom(prenom);
obj.setNumero_voie(numero_voie);
obj.setAdresse(adresse);
obj.setVille(ville);
obj.setStatut(statut); obj.setStatut(statut);
obj.setCategorie(categorie); obj.setCategorie(categorie);
obj.setGenre(genre); obj.setGenre(genre);
obj.setRqth(rqth); obj.setRqth(rqth);
obj.setMetier(metier); obj.setMetier(metier);
if (errors.isEmpty()) { if (errors.isEmpty()) {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
...@@ -13,6 +14,8 @@ ...@@ -13,6 +14,8 @@
<title>Afficher RA</title> <title>Afficher RA</title>
</head> </head>
<body> <body>
<%@include file="/WEB-INF/jspf/header.jsp" %>
<fieldset> <fieldset>
<legend><strong>Fiche Responsable d'Activité</legend> <legend><strong>Fiche Responsable d'Activité</legend>
<p><strong>ID: </strong><c:out value="${ra.id}"/></p> <p><strong>ID: </strong><c:out value="${ra.id}"/></p>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix= "c" %> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix= "c" %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
...@@ -17,6 +18,8 @@ ...@@ -17,6 +18,8 @@
</head> </head>
<body> <body>
<%@include file="/WEB-INF/jspf/header.jsp" %>
<main> <main>
<fieldset> <fieldset>
<legend>Fiche Collaborateur</legend> <legend>Fiche Collaborateur</legend>
...@@ -26,15 +29,11 @@ ...@@ -26,15 +29,11 @@
<p><strong>Genre: </strong><c:out value="${collaborateur.genre}"/></p> <p><strong>Genre: </strong><c:out value="${collaborateur.genre}"/></p>
<p><strong>Nom: </strong><c:out value="${collaborateur.nom}"/></p> <p><strong>Nom: </strong><c:out value="${collaborateur.nom}"/></p>
<p><strong>Prénom: </strong><c:out value="${collaborateur.prenom}"/></p> <p><strong>Prénom: </strong><c:out value="${collaborateur.prenom}"/></p>
<p><strong>Date de naissance: </strong><c:out value="${collaborateur.date_de_naissance}"/></p>
<p><strong>Numéro de voie: </strong><c:out value="${collaborateur.numero_voie}"/></p>
<p><strong>Adresse: </strong><c:out value="${collaborateur.adresse}"/></p>
<p><strong>Code postal: </strong><c:out value="${collaborateur.code_postal}"/></p>
<p><strong>Ville: </strong><c:out value="${collaborateur.ville}"/></p>
<p><strong>Téléphone personnel: </strong><c:out value="${collaborateur.telephone_personnel}"/></p> <p><strong>Téléphone personnel: </strong><c:out value="${collaborateur.telephone_personnel}"/></p>
<p><strong>Statut: </strong><c:out value="${collaborateur.statut}"/></p> <p><strong>Statut: </strong><c:out value="${collaborateur.statut}"/></p>
<p><strong>Catégorie: </strong><c:out value="${collaborateur.categorie}"/></p> <p><strong>Catégorie: </strong><c:out value="${collaborateur.categorie}"/></p>
<p><strong>RQTH: </strong><c:out value="${collaborateur.rqth}"/></p> <p><strong>RQTH: </strong><c:out value="${collaborateur.rqth}"/></p>
<p><strong>Date de renouvellement: </strong><c:out value="${collaborateur.date_de_renouvellement}"/></p>
<p><strong>Métier: </strong><c:out value="${collaborateur.metier}"/></p> <p><strong>Métier: </strong><c:out value="${collaborateur.metier}"/></p>
</fieldset> </fieldset>
...@@ -42,4 +41,3 @@ ...@@ -42,4 +41,3 @@
</body> </body>
</html> </html>
\ No newline at end of file
<%-- <%--
Document : creerCollaborateur Document : creerCollaborateur
Created on : 12 juin 2024, 09:15:40 Created on : 12 juin 2024, 09:15:40
...@@ -5,87 +6,211 @@ ...@@ -5,87 +6,211 @@
--%> --%>
<%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/assets/css/styles.css">
</head> </head>
<body> <body>
<%@include file="/WEB-INF/jspf/header.jsp" %>
<main> <main>
<form action="/ProDigiUp_GesCollab/creer_collaborateur" method="post"> <form action="/ProDigiUp_GesCollab/creer_collaborateur" method="post">
<div>${requestScope.message}</div> <div>${requestScope.message}</div>
<div>${requestScope.errorMsg}</div> <div class="error-message">${requestScope.errorMsg}</div>
<fieldset> <fieldset>
<legend>Nouveau Collaborateur</legend> <legend>Nouveau Collaborateur</legend>
<div> <div>
<label for="matricule">Matricule</label> <label for="matricule">Matricule</label>
<input type="text" id="matricule" name="matricule"> <!-- pour garder en memoire les champs deja remplis si erreur quelque part-->
<div class="error">${requestScope.errors.matricule}</div>
</div> <input type="text" id="matricule" name="matricule"
<div> pattern="[0-9]*"
<label for="genre">Genre</label> required
<input type="text" id="genre" name="genre"> title="Veuillez saisir uniquement des chiffres (0-9)"
<div class="error">${requestScope.errors.genre}</div> value="${requestScope.collaborateur != null ? requestScope.collaborateur.matricule : ''}"
class="${not empty requestScope.errors.matricule ? 'error-input' : ''}"
>
<div class="error-details-message">${requestScope.errors.matricule}</div>
</div> </div>
<div> <div>
<label for="nom">Nom</label> <label for="nom">Nom</label>
<input type="text" id="nom" name="nom"> <input type="text" id="nom" name="nom"
<div class="error">${requestScope.errors.nom}</div> pattern="[a-zA-Z]*"
required
title="Veuillez saisir uniquement des lettres (A-Z, a-z)"
value="${requestScope.collaborateur != null ? requestScope.collaborateur.nom : ''}"
class="${not empty requestScope.errors.nom ? 'error-input' : ''}"
>
<div class="error-details-message">${requestScope.errors.nom}</div>
</div> </div>
<div> <div>
<label for="prenom">Prénom</label> <label for="prenom">Prénom</label>
<input type="text" id="prenom" name="prenom"> <input type="text" id="prenom" name="prenom"
<div class="error">${requestScope.errors.prenom}</div> pattern="[a-zA-Z]*"
</div> required
<div> title="Veuillez saisir uniquement des lettres (A-Z, a-z)"
<label for="date_de_naissance">Date de naissance</label> value="${requestScope.collaborateur != null ? requestScope.collaborateur.prenom : ''}"
<input type="text" id="date_de_naissance" name="date_de_naissance"> class="${not empty requestScope.errors.prenom ? 'error-input' : ''}"
<div class="error">${requestScope.errors.date_de_naissance}</div>
</div> >
<div> <div class="error-details-message">${requestScope.errors.prenom}</div>
<label for="numero_voie">Numéro de voie</label>
<input type="text" id="numero_voie" name="numero_voie">
<div class="error">${requestScope.errors.numero_voie}</div>
</div>
<div>
<label for="adresse">Adresse</label>
<input type="text" id="adresse" name="adresse">
<div class="error">${requestScope.errors.adresse}</div>
</div> </div>
<div> <div>
<label for="code_postal">Code Postal</label> <label for="telephone_personnel">Téléphone personnel</label>
<input type="text" id="code_postal" name="code_postal"pattern="\d{1,10}" maxlength="5" required> <input type="text" id="telephone_personnel" name="telephone_personnel"
<div class="error">${requestScope.errors.code_postal}</div> pattern="\d{10}"
maxlength="10"
required
title="Veuillez saisir exactement 10 chiffres"
value="${requestScope.collaborateur != null ? requestScope.collaborateur.telephone_personnel : ''}"
class="${not empty requestScope.errors.telephone_personnel ? 'error-input' : ''}"
>
<div class="error-details-message">${requestScope.errors.telephone_personnel}</div>
</div> </div>
<div> <div>
<label for="ville">Ville</label> <label for="statut">Statut</label>
<input type="text" id="ville" name="ville"> <select id="statut" name="statut">
<div class="error">${requestScope.ville}</div> <option value="CDD" ${requestScope.collaborateur != null && requestScope.collaborateur.statut == 'CDD' ? 'selected' : ''}>CDD</option>
<option value="CDI" ${requestScope.collaborateur != null && requestScope.collaborateur.statut == 'CDI' ? 'selected' : ''}>CDI</option>
<option value="CDD_Tremplin" ${requestScope.collaborateur != null && requestScope.collaborateur.statut == 'CDD_Tremplin' ? 'selected' : ''}>CDD Tremplin</option>
<option value="Stage" ${requestScope.collaborateur != null && requestScope.collaborateur.statut == 'Stage' ? 'selected' : ''}>Stage</option>
</select>
<div class="error-details-message">${requestScope.errors.statut}</div>
</div> </div>
<div> <div>
<label for="telephone_personnel">Téléphone personnel</label> <label for="categorie">Catégorie</label>
<input type="text" id="telephone_personnel" name="telephone_personnel"pattern="\d{1,10}" maxlength="10" required> <select id="categorie" name="categorie">
<div class="error">${requestScope.errors.telephone_personnel}</div> <option value="ETAM" ${requestScope.collaborateur != null && requestScope.collaborateur.categorie == 'ETAM' ? 'selected' : ''}>ETAM</option>
<option value="Cadre" ${requestScope.collaborateur != null && requestScope.collaborateur.categorie == 'Cadre' ? 'selected' : ''}>Cadre</option>
</select>
<div class="error-details-message">${requestScope.errors.categorie}</div>
</div> </div>
<div> <div>
<label for="statut">Statut (CDD, CDI, CDD Tremplin, Stage)</label> <label for="genre">Genre</label>
<input type="text" id="statut" name="statut"> <select id="genre" name="genre">
<div class="error">${requestScope.errors.statut}</div> <option value="Madame" ${requestScope.collaborateur != null && requestScope.collaborateur.genre == 'Madame' ? 'selected' : ''}>Madame</option>
<option value="Monsieur" ${requestScope.collaborateur != null && requestScope.collaborateur.genre == 'Monsieur' ? 'selected' : ''}>Monsieur</option>
</select>
<div class="error-details-message">${requestScope.errors.genre}</div>
</div> </div>
<div> <div>
<label for="categorie">Catégorie (ETAM, Cadre)</label> <!--<label for="rqth">RQTH</label>
<input type="text" id="categorie" name="categorie"> <select id="rqth" name="rqth" onchange="toggleDateField()">
<div class="error">${requestScope.errors.categorie}</div> <option value="oui" ${isOuiSelected ? 'selected' : ''}>oui</option>
<option value="non" ${!isOuiSelected ? 'selected' : ''}>non</option>
</select>
<div class="error-details-message">${requestScope.errors.rqth}</div>
</div> </div>
<c:if test="${isOuiSelected}">
<div id="date-renouvellement">
<label for="date_de_renouvellement">Date de renouvellement</label>
<input type="date" id="date_de_renouvellement" name="date_de_renouvellement"placeholder="jj-mm-aaaa">
<div class="error-details-message">${requestScope.errors.date_de_renouvellement}</div>
</div>
</c:if>
<c:if test="${!isOuiSelected}">
<div id="date-renouvellement" style="display:none;">
<label for="date_de_renouvellement">Date de renouvellement</label>
<input type="date" id="date_de_renouvellement" name="date_de_renouvellement">
<div class="error-details-message">${requestScope.errors.date_de_renouvellement}</div>
</div>
</c:if>
<script>
function toggleDateField() {
var rqthSelect = document.getElementById('rqth');
var dateField = document.getElementById('date-renouvellement');
var dateInput = document.getElementById('date_de_renouvellement');
if (rqthSelect.value === 'oui') {
dateField.style.display = 'block';
dateInput.disabled = false;
} else {
dateField.style.display = 'non';
dateInput.disabled = true;
dateInput.value = ''; // Clear the value to avoid submission
}
}
document.addEventListener("DOMContentLoaded", function () {
toggleDateField(); // Ensure the initial state is correct based on the current selection
});
-->
<div> <div>
<label for="rqth">RQTH (oui, non, en cours)</label> <label for="rqth">RQTH</label>
<input type="text" id="rqth" name="rqth"> <select id="rqth" name="rqth" onchange="toggleDateField()">
<div class="error">${requestScope.errors.rqth}</div> <option value="oui" ${isOuiSelected ? 'selected' : ''}>oui</option>
<option value="non" ${!isOuiSelected ? 'selected' : ''}>non</option>
</select>
<div class="error-details-message">${requestScope.errors.rqth}</div>
</div> </div>
<c:if test="${isOuiSelected}">
<div id="date-renouvellement" style="display:none;">
<label for="date_de_renouvellement">Date de renouvellement</label>
<input type="date" id="date_de_renouvellement" name="date_de_renouvellement" *
placeholder="jj-mm-aaaa"
required
value="${requestScope.collaborateur != null ? requestScope.collaborateur.date_de_renouvellement : ''}"
>
<div class="error-details-message">${requestScope.errors.date_de_renouvellement}</div>
</div>
</c:if>
<c:if test="${!isOuiSelected}">
<div id="date-renouvellement" style="display:none;">
<label for="date_de_renouvellement">Date de renouvellement</label>
<input type="date" id="date_de_renouvellement" name="date_de_renouvellement"
placeholder="jj-mm-aaaa"
value="${requestScope.collaborateur != null ? requestScope.collaborateur.date_de_renouvellement : ''}">
<div class="error-details-message">${requestScope.errors.date_de_renouvellement}</div>
</div>
</c:if>
<script>
function toggleDateField() {
var rqthSelect = document.getElementById('rqth');
var dateField = document.getElementById('date-renouvellement');
var dateInput = document.getElementById('date_de_renouvellement');
if (rqthSelect.value === 'oui') {
dateField.style.display = 'block';
dateInput.disabled = false;
} else {
dateField.style.display = 'non';
dateInput.disabled = true;
dateInput.value = ''; // Clear the value to avoid submission
}
}
document.addEventListener("DOMContentLoaded", function () {
toggleDateField(); // Ensure the initial state is correct based on the current selection
});
</script>
<div> <div>
<label for="metier">Métier</label> <label for="metier">Métier</label>
<input type="text" id="metier" name="metier"> <input type="text" id="metier" name="metier"
pattern="[a-zA-Z]*"
required
title="Veuillez saisir uniquement des lettres (A-Z, a-z)"
value="${requestScope.collaborateur != null ? requestScope.collaborateur.metier : ''}"
class="${not empty requestScope.errors.matricule ? 'error-input' : ''}"
>
<div class="error">${requestScope.errors.metier}</div> <div class="error">${requestScope.errors.metier}</div>
</div> </div>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
...@@ -13,6 +14,8 @@ ...@@ -13,6 +14,8 @@
<title>Créer RA</title> <title>Créer RA</title>
</head> </head>
<body> <body>
<%@include file="/WEB-INF/jspf/header.jsp" %>
<form action="<c:url value="/creer_ra" />" method="post"> <form action="<c:url value="/creer_ra" />" method="post">
<div>${requestScope.message}</div> <div>${requestScope.message}</div>
<div>${requestScope.errMsg}</div> <div>${requestScope.errMsg}</div>
...@@ -34,7 +37,7 @@ ...@@ -34,7 +37,7 @@
<div class="error">${requestScope.errors.prenom}</div> <div class="error">${requestScope.errors.prenom}</div>
</div> </div>
<div> <div>
<label for="date_de_naissance">Date de Naissance</label> <label for="date_de_naissance">Date de Naissance (Format: yyyy-MM-dd):</label>
<input type="text" id="date_de_naissance" name="date_de_naissance" <input type="text" id="date_de_naissance" name="date_de_naissance"
<div class="error">${requestScope.errors.date_de_naissance}</div> <div class="error">${requestScope.errors.date_de_naissance}</div>
</div> </div>
......
...@@ -6,21 +6,24 @@ ...@@ -6,21 +6,24 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Accueil</title> <title>Accueil</title>
</head> </head>
<body> <body>
<img src="<c:url value="/assets/img/logoproDigiUp.png" />" width="200px" height="100px" alt="logoProDigiUp"> <%@include file="/WEB-INF/jspf/header.jsp" %>
<h1>Bienvenue sur l'application ProDigiUp</h1> <h1>Bienvenue </h1>
<h1>pour gérer vos collaborateurs</h1>
<nav> <nav>
<ul> <ul>
<li><a href="<c:url value="/creer_ra"/>">Créer un Responsable d'Activité</a></li> <li><a href="<c:url value="/creer_ra"/>">Créer un Responsable d'Activité</a></li>
<li><a href="<c:url value="/creer_collaborateur"/>">Créer un collaborateur</a></li> <li><a href="<c:url value="/creer_collaborateur"/>">Créer un Collaborateur</a></li>
<li><a href="<c:url value="/afficher_ra"/>">Afficher un Responsable d'Activité</a></li> <li><a href="<c:url value="/afficher_ra"/>">Afficher un Responsable d'Activité</a></li>
<li><a href="<c:url value="/collaborateur"/>">Afficher un collaborateur</a></li> <li><a href="<c:url value="/collaborateur"/>">Afficher un collaborateur</a></li>
......
<%--
Document : header
Created on : 13 juin 2024, 12:23:41
Author : asolanas
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<link rel="stylesheet" href="<c:url value="/assets/css/style.css"/>">
<link rel="stylesheet" href="<c:url value="/assets/css/form.css"/>">
<!DOCTYPE html>
<header>
<div>
<img src="<c:url value='/assets/img/logoproDigiUp.png' />" width="200px" height="100px" alt="logo">
<h1>ProDigiUp Gestion Collaborateurs</h1>
</div>
<nav>
<ul>
<li><a href="<c:url value="/accueil"/>">Accueil</a></li>
</ul>
</nav>
</header>
...@@ -15,4 +15,9 @@ ...@@ -15,4 +15,9 @@
<taglib-location>/WEB-INF/tld/c.tld</taglib-location> <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
</taglib> </taglib>
</jsp-config>--> </jsp-config>-->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/assets/*</url-pattern>
</servlet-mapping>
</web-app> </web-app>
/*
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 : 17 juin 2024, 10:25:54
Author : cberge
*/
h1 {
text-align: center;
}
form {
width: 50%;
margin: auto;
}
form label, form label+input {
display: inline-block;
}
form label {
width: 20%;
}
form label+input {
width: 75%;
}
.buttons {
display: flex;
justify-content: center;
}
.buttons > input {
margin:1em;
}
.error {
height: 1.5em;;
color: red;
font-size: 0.8em;
font-style: italic;
text-align: end;
}
.ok {
background-color: green;
color: whitesmoke;
font-size: 1.5em;
font-style: italic;
}
.error-message {
color: red;
font-weight: bold;
}
.error-details-message{
color: red;
font-style: italic;
}
.error-input {
border: 1px solid red; /* Bordure rouge */
}
:root {
background: linear-gradient(100deg, buttonface, paleturquoise);
}
body {
background-color: var(--primary-color);
}
.accueil{
display: flex;
justify-content: space-between;
text-align: center;
}
/*
form fieldset div {
margin-bottom: 10px;
}
form fieldset div label {
display: inline-block;
width: 150px;
margin-right: 10px;
vertical-align: top;
}
form fieldset div input[type="text"],
form fieldset div select {
width: 200px;
vertical-align: top;
padding: 5px;
box-sizing: border-box;
}
form fieldset div.error-details-message {
margin-top: 5px;
color: red;
}
form fieldset div.error-message {
margin-top: 10px;
color: red;
font-weight: bold;
}
*/