Compare commits
No commits in common. "master" and "3a1a57f348755e101c4134bc3a02535986daf0a5" have entirely different histories.
master
...
3a1a57f348
@ -43,7 +43,7 @@ j2ee.compile.on.save=true
|
||||
j2ee.copy.static.files.on.save=true
|
||||
j2ee.deploy.on.save=true
|
||||
j2ee.platform=1.7-web
|
||||
j2ee.platform.classpath=${j2ee.server.domain}/lib/annotations-api.jar:${j2ee.server.domain}/lib/catalina-ant.jar:${j2ee.server.domain}/lib/catalina-ha.jar:${j2ee.server.domain}/lib/catalina-ssi.jar:${j2ee.server.domain}/lib/catalina-storeconfig.jar:${j2ee.server.domain}/lib/catalina-tribes.jar:${j2ee.server.domain}/lib/catalina.jar:${j2ee.server.domain}/lib/ecj-4.20.jar:${j2ee.server.domain}/lib/el-api.jar:${j2ee.server.domain}/lib/jakartaee-migration-1.0.0-shaded.jar:${j2ee.server.domain}/lib/jasper-el.jar:${j2ee.server.domain}/lib/jasper.jar:${j2ee.server.domain}/lib/jaspic-api.jar:${j2ee.server.domain}/lib/jsp-api.jar:${j2ee.server.domain}/lib/servlet-api.jar:${j2ee.server.domain}/lib/tomcat-api.jar:${j2ee.server.domain}/lib/tomcat-coyote.jar:${j2ee.server.domain}/lib/tomcat-dbcp.jar:${j2ee.server.domain}/lib/tomcat-i18n-cs.jar:${j2ee.server.domain}/lib/tomcat-i18n-de.jar:${j2ee.server.domain}/lib/tomcat-i18n-es.jar:${j2ee.server.domain}/lib/tomcat-i18n-fr.jar:${j2ee.server.domain}/lib/tomcat-i18n-ja.jar:${j2ee.server.domain}/lib/tomcat-i18n-ko.jar:${j2ee.server.domain}/lib/tomcat-i18n-pt-BR.jar:${j2ee.server.domain}/lib/tomcat-i18n-ru.jar:${j2ee.server.domain}/lib/tomcat-i18n-zh-CN.jar:${j2ee.server.domain}/lib/tomcat-jdbc.jar:${j2ee.server.domain}/lib/tomcat-jni.jar:${j2ee.server.domain}/lib/tomcat-util-scan.jar:${j2ee.server.domain}/lib/tomcat-util.jar:${j2ee.server.domain}/lib/tomcat-websocket.jar:${j2ee.server.domain}/lib/websocket-api.jar
|
||||
j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar:${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/catalina-ssi.jar:${j2ee.server.home}/lib/catalina-storeconfig.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-4.20.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/jakartaee-migration-1.0.0-shaded.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/jaspic-api.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/tomcat-i18n-cs.jar:${j2ee.server.home}/lib/tomcat-i18n-de.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/tomcat-i18n-ko.jar:${j2ee.server.home}/lib/tomcat-i18n-pt-BR.jar:${j2ee.server.home}/lib/tomcat-i18n-ru.jar:${j2ee.server.home}/lib/tomcat-i18n-zh-CN.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/tomcat-jni.jar:${j2ee.server.home}/lib/tomcat-util-scan.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat-websocket.jar:${j2ee.server.home}/lib/websocket-api.jar
|
||||
j2ee.server.type=Tomcat
|
||||
jar.compress=false
|
||||
javac.classpath=\
|
||||
|
@ -50,24 +50,21 @@ public class PompierMySql {
|
||||
ResultSet resultQ = null;
|
||||
resultQ = stmt.executeQuery("SELECT * FROM pompier");
|
||||
while (resultQ.next()) {
|
||||
unPompier = new Pompier (resultQ.getInt("id"),
|
||||
unPompier = new Pompier(resultQ.getInt("id"),
|
||||
resultQ.getInt("idCaserne"),
|
||||
resultQ.getString("nom"),
|
||||
resultQ.getString("prenom"),
|
||||
resultQ.getInt("statut"),
|
||||
resultQ.getInt("typePers"),
|
||||
resultQ.getString("mail"),
|
||||
resultQ.getString("login"),
|
||||
resultQ.getString("mdp"),
|
||||
resultQ.getString("adresse"),
|
||||
resultQ.getString("cp"),
|
||||
resultQ.getString("ville"),
|
||||
resultQ.getInt("bip"),
|
||||
resultQ.getInt("nbGardes"),
|
||||
resultQ.getInt("adrNo"),
|
||||
resultQ.getString("adrRue"),
|
||||
resultQ.getString("adrCP"),
|
||||
resultQ.getString("adrVille"),
|
||||
resultQ.getInt("grade"),
|
||||
resultQ.getString("commentaire"),
|
||||
resultQ.getInt("idEmployeur")
|
||||
);
|
||||
resultQ.getString("commentaire")
|
||||
);
|
||||
lesPompiers.add(unPompier);
|
||||
}
|
||||
resultQ.close();
|
||||
@ -82,6 +79,47 @@ public class PompierMySql {
|
||||
return lesPompiers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation du pompier passé en paramètre dans la table pompier Requête non
|
||||
* préparée
|
||||
*
|
||||
* @param p objet de type Pompier (sans identifiant)
|
||||
* @return int : id du Pompier créé
|
||||
*/
|
||||
public int create(Pompier p) {
|
||||
int id = -1;
|
||||
try {
|
||||
Statement stmt = theConnection.createStatement();
|
||||
int status = stmt.executeUpdate(
|
||||
"INSERT INTO pompier (idCaserne, nom, prenom, statut, mail, login, mdp, adrNo, adrRue, adrCP, adrVille, grade) "
|
||||
+ "VALUES ('" + p.getIdCaserne() + "', '"
|
||||
+ p.getNom() + "', '"
|
||||
+ p.getPrenom() + "', '"
|
||||
+ p.getStatut() + "', "
|
||||
+ p.getMail() + ", '"
|
||||
+ p.getLogin() + ", '"
|
||||
+ p.getMdp() + ", '"
|
||||
+ p.getAdrNo() + ", '"
|
||||
+ p.getAdrRue() + "', '"
|
||||
+ p.getAdrCP() + "', '"
|
||||
+ p.getAdrVille() + "', '"
|
||||
+ p.getGrade() + "' );",
|
||||
Statement.RETURN_GENERATED_KEYS);
|
||||
|
||||
// Recherche de l'identifiant du pompier créé
|
||||
if (status > 0) {
|
||||
ResultSet result = stmt.getGeneratedKeys();
|
||||
if (result.first()) {
|
||||
id = result.getInt(1);
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
System.out.println("SQLException : " + ex.getMessage());
|
||||
System.out.println("SQLState : " + ex.getSQLState());
|
||||
System.out.println("Code erreur : " + ex.getErrorCode());
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation du pompier passé en paramètre dans la table pompier Requête
|
||||
@ -94,25 +132,21 @@ public class PompierMySql {
|
||||
int id = -1;
|
||||
try {
|
||||
PreparedStatement stmt = null;
|
||||
String sql = "INSERT INTO pompier(idCaserne, nom, prenom, statut, typePers, mail, login, mdp, adresse, cp, ville, bip, nbGardes, grade, commentaire, idEmployeur) "
|
||||
String sql = "INSERT INTO pompier(idCaserne, nom, prenom, statut, mail, login, mdp, adrNo, adrRue, adrCP, adrVille, grade) "
|
||||
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?);";
|
||||
stmt = theConnection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
|
||||
stmt.setInt(1, p.getIdCaserne());
|
||||
stmt.setString(2, p.getNom());
|
||||
stmt.setString(3, p.getPrenom());
|
||||
stmt.setInt(4, p.getStatut());
|
||||
stmt.setInt(5, p.getTypePers());
|
||||
stmt.setString(6, p.getMail());
|
||||
stmt.setString(7, p.getLogin());
|
||||
stmt.setString(8, p.getMdp());
|
||||
stmt.setString(9, p.getAdresse());
|
||||
stmt.setString(10, p.getCp());
|
||||
stmt.setString(11, p.getVille());
|
||||
stmt.setInt(12, p.getBip());
|
||||
stmt.setInt(13, p.getNbGardes());
|
||||
stmt.setInt(14, p.getGrade());
|
||||
stmt.setString(15, p.getCommentaire());
|
||||
stmt.setInt(16, p.getIdEmployeur());
|
||||
stmt.setString(5, p.getMail());
|
||||
stmt.setString(6, p.getLogin());
|
||||
stmt.setString(7, p.getMdp());
|
||||
stmt.setInt(8, p.getAdrNo());
|
||||
stmt.setString(9, p.getAdrRue());
|
||||
stmt.setString(10, p.getAdrCP());
|
||||
stmt.setString(11, p.getAdrVille());
|
||||
stmt.setInt(12, p.getGrade());
|
||||
|
||||
System.out.println("Requête : " + stmt.toString());
|
||||
int status = stmt.executeUpdate();
|
||||
@ -138,39 +172,21 @@ public class PompierMySql {
|
||||
String login = request.getParameter("ztPseudo");
|
||||
String mdp = request.getParameter("ztMDP");
|
||||
String mdpChiffre = MD5.encode(request.getParameter("ztMDP"));
|
||||
String sql = "SELECT * FROM pompier WHERE login='" + login + "' AND mdp='" + mdpChiffre + "' AND typePers='1';";
|
||||
System.out.println("sql:" + sql);
|
||||
String sql = "SELECT * FROM pompier WHERE login='" + login + "' AND mdp='" + mdpChiffre + "';";
|
||||
System.out.println("sql:"+sql);
|
||||
try {
|
||||
Statement stmt = theConnection.createStatement();
|
||||
ResultSet resultQ = null;
|
||||
resultQ = stmt.executeQuery(sql);
|
||||
resultat = (resultQ.next());
|
||||
if (resultat) {
|
||||
if(resultat){
|
||||
Pompier lePompier = new Pompier(
|
||||
resultQ.getInt("id"),
|
||||
resultQ.getInt("idCaserne"),
|
||||
resultQ.getString("nom"),
|
||||
resultQ.getString("prenom"),
|
||||
resultQ.getInt("statut"),
|
||||
resultQ.getInt("typePers"),
|
||||
resultQ.getString("mail"),
|
||||
resultQ.getString("login"),
|
||||
resultQ.getString("mdp"),
|
||||
resultQ.getString("adresse"),
|
||||
resultQ.getString("cp"),
|
||||
resultQ.getString("ville"),
|
||||
resultQ.getInt("bip"),
|
||||
resultQ.getInt("nbGardes"),
|
||||
resultQ.getInt("grade"),
|
||||
resultQ.getString("commentaire")
|
||||
|
||||
resultQ.getInt("id"),
|
||||
resultQ.getInt("idCAserne"),
|
||||
|
||||
);
|
||||
|
||||
|
||||
HttpSession maSession = request.getSession();
|
||||
maSession.setAttribute("unPompier", lePompier);
|
||||
System.out.println("lePompier :"+ lePompier);
|
||||
maSession.setAttribute("lePompier", lePompier);
|
||||
}
|
||||
|
||||
} catch (SQLException ex) {
|
||||
@ -178,28 +194,5 @@ public class PompierMySql {
|
||||
}
|
||||
return resultat;
|
||||
}
|
||||
|
||||
public int update(HttpServletRequest request){
|
||||
|
||||
Statement stmt = theConnection.createStatement();
|
||||
ResultSet resultQ = null;
|
||||
resultQ = stmt.executeQuery(sql);
|
||||
resultat = (resultQ.next());
|
||||
if (resultat) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void setResultat(String pompier) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,77 +17,36 @@ public class Pompier {
|
||||
private String nom;
|
||||
private String prenom;
|
||||
private int statut;
|
||||
private int typePers;
|
||||
private String mail;
|
||||
private String login;
|
||||
private String mdp;
|
||||
private String adresse;
|
||||
private String cp;
|
||||
private String ville;
|
||||
private int bip;
|
||||
private int nbGardes;
|
||||
private int adrNo;
|
||||
private String adrRue;
|
||||
private String adrCP;
|
||||
private String adrVille;
|
||||
private int grade;
|
||||
private String commentaire;
|
||||
private int idEmployeur;
|
||||
|
||||
public Pompier(int id, int idCaserne, String nom, String prenom, int statut, int typePers, String mail, String login, String mdp, String adresse, String cp, String ville, int bip, int nbGardes, int grade, String commentaire, int idEmployeur) {
|
||||
public Pompier(int id, int idCaserne, String nom, String prenom, int statut, String mail, String login, String mdp, int adrNo, String adrRue, String adrCP, String adrVille, int grade, String commentaire) {
|
||||
this(idCaserne, nom, prenom, statut, mail, login, mdp, adrNo, adrRue, adrCP, adrVille, grade, commentaire);
|
||||
this.id = id;
|
||||
this.idCaserne = idCaserne;
|
||||
this.nom = nom;
|
||||
this.prenom = prenom;
|
||||
this.statut = statut;
|
||||
this.typePers = typePers;
|
||||
this.mail = mail;
|
||||
this.login = login;
|
||||
this.mdp = mdp;
|
||||
this.adresse = adresse;
|
||||
this.cp = cp;
|
||||
this.ville = ville;
|
||||
this.bip = bip;
|
||||
this.nbGardes = nbGardes;
|
||||
this.grade = grade;
|
||||
this.commentaire = commentaire;
|
||||
this.idEmployeur = idEmployeur;
|
||||
}
|
||||
|
||||
public Pompier(int idCaserne, String nom, String prenom, int statut, int typePers, String mail, String login, String mdp, String adresse, String cp, String ville, int bip, int nbGardes, int grade, String commentaire, int idEmployeur) {
|
||||
public Pompier(int idCaserne, String nom, String prenom, int statut, String mail, String login, String mdp, int adrNo, String adrRue, String adrCP, String adrVille, int grade, String commentaire) {
|
||||
this.idCaserne = idCaserne;
|
||||
this.nom = nom;
|
||||
this.prenom = prenom;
|
||||
this.statut = statut;
|
||||
this.typePers = typePers;
|
||||
this.mail = mail;
|
||||
this.login = login;
|
||||
this.mdp = mdp;
|
||||
this.adresse = adresse;
|
||||
this.cp = cp;
|
||||
this.ville = ville;
|
||||
this.bip = bip;
|
||||
this.nbGardes = nbGardes;
|
||||
this.grade = grade;
|
||||
this.commentaire = commentaire;
|
||||
this.idEmployeur = idEmployeur;
|
||||
}
|
||||
|
||||
public Pompier(int id, int idCaserne, String nom, String prenom, int statut, int typePers, String mail, String login, String mdp, String adresse, String cp, String ville, int bip, int nbGardes, int grade, String commentaire) {
|
||||
this.id = id;
|
||||
this.idCaserne = idCaserne;
|
||||
this.nom = nom;
|
||||
this.prenom = prenom;
|
||||
this.statut = statut;
|
||||
this.typePers = typePers;
|
||||
this.mail = mail;
|
||||
this.login = login;
|
||||
this.mdp = mdp;
|
||||
this.adresse = adresse;
|
||||
this.cp = cp;
|
||||
this.ville = ville;
|
||||
this.bip = bip;
|
||||
this.nbGardes = nbGardes;
|
||||
this.adrNo = adrNo;
|
||||
this.adrRue = adrRue;
|
||||
this.adrCP = adrCP;
|
||||
this.adrVille = adrVille;
|
||||
this.grade = grade;
|
||||
this.commentaire = commentaire;
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
@ -129,14 +88,6 @@ public class Pompier {
|
||||
this.statut = statut;
|
||||
}
|
||||
|
||||
public int getTypePers() {
|
||||
return typePers;
|
||||
}
|
||||
|
||||
public void setTypePers(int typePers) {
|
||||
this.typePers = typePers;
|
||||
}
|
||||
|
||||
public String getMail() {
|
||||
return mail;
|
||||
}
|
||||
@ -161,44 +112,36 @@ public class Pompier {
|
||||
this.mdp = mdp;
|
||||
}
|
||||
|
||||
public String getAdresse() {
|
||||
return adresse;
|
||||
public int getAdrNo() {
|
||||
return adrNo;
|
||||
}
|
||||
|
||||
public void setAdresse(String adresse) {
|
||||
this.adresse = adresse;
|
||||
public void setAdrNo(int adrNo) {
|
||||
this.adrNo = adrNo;
|
||||
}
|
||||
|
||||
public String getCp() {
|
||||
return cp;
|
||||
public String getAdrRue() {
|
||||
return adrRue;
|
||||
}
|
||||
|
||||
public void setCp(String cp) {
|
||||
this.cp = cp;
|
||||
public void setAdrRue(String adrRue) {
|
||||
this.adrRue = adrRue;
|
||||
}
|
||||
|
||||
public String getVille() {
|
||||
return ville;
|
||||
public String getAdrCP() {
|
||||
return adrCP;
|
||||
}
|
||||
|
||||
public void setVille(String ville) {
|
||||
this.ville = ville;
|
||||
public void setAdrCP(String adrCP) {
|
||||
this.adrCP = adrCP;
|
||||
}
|
||||
|
||||
public int getBip() {
|
||||
return bip;
|
||||
public String getAdrVille() {
|
||||
return adrVille;
|
||||
}
|
||||
|
||||
public void setBip(int bip) {
|
||||
this.bip = bip;
|
||||
}
|
||||
|
||||
public int getNbGardes() {
|
||||
return nbGardes;
|
||||
}
|
||||
|
||||
public void setNbGardes(int nbGardes) {
|
||||
this.nbGardes = nbGardes;
|
||||
public void setAdrVille(String adrVille) {
|
||||
this.adrVille = adrVille;
|
||||
}
|
||||
|
||||
public int getGrade() {
|
||||
@ -217,34 +160,23 @@ public class Pompier {
|
||||
this.commentaire = commentaire;
|
||||
}
|
||||
|
||||
public int getIdEmployeur() {
|
||||
return idEmployeur;
|
||||
}
|
||||
|
||||
public void setIdEmployeur(int idEmployeur) {
|
||||
this.idEmployeur = idEmployeur;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 47 * hash + this.id;
|
||||
hash = 47 * hash + this.idCaserne;
|
||||
hash = 47 * hash + Objects.hashCode(this.nom);
|
||||
hash = 47 * hash + Objects.hashCode(this.prenom);
|
||||
hash = 47 * hash + this.statut;
|
||||
hash = 47 * hash + this.typePers;
|
||||
hash = 47 * hash + Objects.hashCode(this.mail);
|
||||
hash = 47 * hash + Objects.hashCode(this.login);
|
||||
hash = 47 * hash + Objects.hashCode(this.mdp);
|
||||
hash = 47 * hash + Objects.hashCode(this.adresse);
|
||||
hash = 47 * hash + Objects.hashCode(this.cp);
|
||||
hash = 47 * hash + Objects.hashCode(this.ville);
|
||||
hash = 47 * hash + this.bip;
|
||||
hash = 47 * hash + this.nbGardes;
|
||||
hash = 47 * hash + this.grade;
|
||||
hash = 47 * hash + Objects.hashCode(this.commentaire);
|
||||
hash = 47 * hash + this.idEmployeur;
|
||||
int hash = 3;
|
||||
hash = 29 * hash + this.id;
|
||||
hash = 29 * hash + this.idCaserne;
|
||||
hash = 29 * hash + Objects.hashCode(this.nom);
|
||||
hash = 29 * hash + Objects.hashCode(this.prenom);
|
||||
hash = 29 * hash + this.statut;
|
||||
hash = 29 * hash + Objects.hashCode(this.mail);
|
||||
hash = 29 * hash + Objects.hashCode(this.login);
|
||||
hash = 29 * hash + Objects.hashCode(this.mdp);
|
||||
hash = 29 * hash + this.adrNo;
|
||||
hash = 29 * hash + Objects.hashCode(this.adrRue);
|
||||
hash = 29 * hash + Objects.hashCode(this.adrCP);
|
||||
hash = 29 * hash + Objects.hashCode(this.adrVille);
|
||||
hash = 29 * hash + this.grade;
|
||||
hash = 29 * hash + Objects.hashCode(this.commentaire);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@ -269,21 +201,12 @@ public class Pompier {
|
||||
if (this.statut != other.statut) {
|
||||
return false;
|
||||
}
|
||||
if (this.typePers != other.typePers) {
|
||||
return false;
|
||||
}
|
||||
if (this.bip != other.bip) {
|
||||
return false;
|
||||
}
|
||||
if (this.nbGardes != other.nbGardes) {
|
||||
if (this.adrNo != other.adrNo) {
|
||||
return false;
|
||||
}
|
||||
if (this.grade != other.grade) {
|
||||
return false;
|
||||
}
|
||||
if (this.idEmployeur != other.idEmployeur) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.nom, other.nom)) {
|
||||
return false;
|
||||
}
|
||||
@ -299,13 +222,13 @@ public class Pompier {
|
||||
if (!Objects.equals(this.mdp, other.mdp)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.adresse, other.adresse)) {
|
||||
if (!Objects.equals(this.adrRue, other.adrRue)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.cp, other.cp)) {
|
||||
if (!Objects.equals(this.adrCP, other.adrCP)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.ville, other.ville)) {
|
||||
if (!Objects.equals(this.adrVille, other.adrVille)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.commentaire, other.commentaire)) {
|
||||
@ -316,9 +239,9 @@ public class Pompier {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Pompier{" + "id=" + id + ", idCaserne=" + idCaserne + ", nom=" + nom + ", prenom=" + prenom + ", statut=" + statut + ", typePers=" + typePers + ", mail=" + mail + ", login=" + login + ", mdp=" + mdp + ", adresse=" + adresse + ", cp=" + cp + ", ville=" + ville + ", bip=" + bip + ", nbGardes=" + nbGardes + ", grade=" + grade + ", commentaire=" + commentaire + ", idEmployeur=" + idEmployeur + '}';
|
||||
return "Pompier{" + "id=" + id + ", idCaserne=" + idCaserne + ", nom=" + nom + ", prenom=" + prenom + ", statut=" + statut + ", mail=" + mail + ", login=" + login + ", mdp=" + mdp + ", adrNo=" + adrNo + ", adrRue=" + adrRue + ", adrCP=" + adrCP + ", adrVille=" + adrVille + ", grade=" + grade + ", commentaire=" + commentaire + '}';
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -48,7 +48,8 @@ public class AuthentifForm {
|
||||
resultat = resul?"":"Pseudo ou mdp incorrect";
|
||||
return resul;
|
||||
// Mise à jour de l'attribut resultat
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.test.forms;
|
||||
|
||||
import bdd.PompierMySql;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author funcha.ahamadi
|
||||
*/
|
||||
public class ModifPompierForm {
|
||||
private String resultat;
|
||||
|
||||
public String getResultat() {
|
||||
return resultat;
|
||||
}
|
||||
|
||||
public void setResultat(String resultat) {
|
||||
this.resultat = resultat;
|
||||
}
|
||||
|
||||
|
||||
public int Modif(HttpServletRequest request) {
|
||||
|
||||
PompierMySql p = new PompierMySql();
|
||||
boolean resul = p.Update(request);
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -22,13 +22,13 @@ public class NouveauPompForm {
|
||||
public int verifNouveauPompier(HttpServletRequest request) {
|
||||
|
||||
// Contrôle du no de rue qui doit être numérique
|
||||
// String noRueString = request.getParameter("nAdrNo");
|
||||
// boolean isNumeric = StringUtils.isStrictlyNumeric(noRueString);
|
||||
// if (!isNumeric) {
|
||||
// message = "Le no de rue doit être numérique";
|
||||
// return -1;
|
||||
// }
|
||||
// int noRue = Integer.parseInt(noRueString);
|
||||
String noRueString = request.getParameter("nAdrNo");
|
||||
boolean isNumeric = StringUtils.isStrictlyNumeric(noRueString);
|
||||
if (!isNumeric) {
|
||||
message = "Le no de rue doit être numérique";
|
||||
return -1;
|
||||
}
|
||||
int noRue = Integer.parseInt(noRueString);
|
||||
|
||||
// Contrôle car "<" dans les zones de texte
|
||||
//String [] lesSaisies = request.getParameterValues(noRueString); // Valeurs saisies
|
||||
@ -45,22 +45,21 @@ public class NouveauPompForm {
|
||||
}
|
||||
if (erreur > 0) return -1;
|
||||
|
||||
// Creation d'un objet de type Pompier avec les données transmises
|
||||
// Creation d'un objet de type Client avec les données transmises
|
||||
|
||||
Pompier unPompier = new Pompier(
|
||||
|
||||
Integer.parseInt(request.getParameter("nIdCaserne")),
|
||||
Pompier unPompier = new Pompier(request.getParameter("id"),
|
||||
request.getParameter("idCaserne"),
|
||||
request.getParameter("ztNom"),
|
||||
request.getParameter("ztPrenom"),
|
||||
Integer.parseInt(request.getParameter("nStatut")),
|
||||
request.getParameter("nStatut"),
|
||||
request.getParameter("eMail"),
|
||||
request.getParameter("ztPseudo"),
|
||||
request.getParameter("ztLogin"),
|
||||
request.getParameter("ztMDP"),
|
||||
Integer.parseInt(request.getParameter("nAdrNo")),
|
||||
noRue,
|
||||
request.getParameter("ztAdrRue"),
|
||||
request.getParameter("ztAdrCP"),
|
||||
request.getParameter("ztAdrVille"),
|
||||
Integer.parseInt(request.getParameter("nGrade")),
|
||||
request.getParameter("nGrade"),
|
||||
request.getParameter("commentaire")
|
||||
);
|
||||
PompierMySql cm = new PompierMySql();
|
||||
|
@ -5,7 +5,6 @@
|
||||
*/
|
||||
package com.test.servlets;
|
||||
|
||||
import bdd.PompierMySql;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServlet;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
@ -58,15 +57,6 @@ public class ModifPompierServlet extends HttpServlet {
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
PompierMySql PompierMs = new PompierMySql();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
processRequest(request, response);
|
||||
}
|
||||
|
||||
|
@ -79,24 +79,19 @@ public class authentifServlet extends HttpServlet {
|
||||
AuthentifForm leControle = new AuthentifForm();
|
||||
// Appel de la méthode controlerRole
|
||||
boolean isAuthentified = leControle.controlerRole(request);
|
||||
// Création de 2 attributs de requête (isAuthentified et leControle)
|
||||
// Création de 2 attributs de requête (isChef et leControle)
|
||||
request.setAttribute("isAuthentified", isAuthentified);
|
||||
request.setAttribute("controlForm", leControle);
|
||||
HttpSession maSession = request.getSession();
|
||||
maSession.setAttribute("isAuthentified", true);
|
||||
|
||||
// Affichage de la JSP
|
||||
if(isAuthentified==true){
|
||||
System.out.println("Ma session : "+maSession.getAttribute("unPompier"));
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/ModifPompier.jsp")
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/PompierJSP.jsp")
|
||||
.forward(request, response);
|
||||
}else{
|
||||
getServletContext().getRequestDispatcher("/WEB-INF/accueilJSP.jsp")
|
||||
.forward(request, response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -24,34 +24,24 @@
|
||||
<input type="text" name="ztPrenom" placeholder="Prénom"/><br /><br/>
|
||||
<label for="nStatut">Numéro de statut : </label>
|
||||
<input type="number" name="nStatut"/><br /><br/>
|
||||
<label for="nTypePers">Type de personne : </label>
|
||||
<input type="number" name="nTypePers"/><br /><br/>
|
||||
<label for="eMail">Mail : </label>
|
||||
<input type="email" name="eMail"/><br /><br/>
|
||||
<label for="ztLogin">Login : </label>
|
||||
<input type="text" name="ztPseudo" placeholder="Login"/><br /><br/>
|
||||
<input type="text" name="ztLogin" placeholder="Login"/><br /><br/>
|
||||
<label for="ztMDP">Mot de passe : </label>
|
||||
<input type="password" name="ztMDP" placeholder="Mot de passe" /><br /><br />
|
||||
<label for="ztAdresse">Adresse : </label>
|
||||
<input type="text" name="ztAdresse"/><br /><br/>
|
||||
|
||||
<label for="nAdrNo">Numéro de rue : </label>
|
||||
<input type="number" name="nAdrNo"/><br /><br/>
|
||||
<label for="ztAdrRue">Nom de la rue : </label>
|
||||
<input type="text" name="ztAdrRue" placeholder="Rue" /><br /><br/>
|
||||
<label for="ztAdrCP">Code postal : </label>
|
||||
<input type="text" name="ztAdrCP" placeholder="Code postal" /><br /><br/>
|
||||
<label for="ztAdrVille">Ville : </label>
|
||||
<input type="text" name="ztAdrVille" placeholder="Ville" /><br /><br/>
|
||||
<label for="nBip">Numéro de bip : </label>
|
||||
<input type="number" name="nBip"/><br /><br/>
|
||||
<label for="nbGardes">Nombre de gardes : </label>
|
||||
<input type="number" name="nbGardes"/><br /><br/>
|
||||
<label for="nGrade">Numéro de grade : </label>
|
||||
<input type="number" name="nGrade"/><br /><br/>
|
||||
<label for="commentaire">Commentaire : </label>
|
||||
<input type="text" name="commentaire" placeholder="Commentaire" /><br /><br/>
|
||||
<label for="nEmpl">Numéro d'employeur : </label>
|
||||
<input type="number" name="nEmpl"/><br /><br/>
|
||||
<input type="submit" value="Valider" />
|
||||
</form>
|
||||
</fieldset>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -5,7 +5,6 @@
|
||||
--%>
|
||||
<%@include file = "jspf/enteteJSPF.jspf" %>
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@ -14,42 +13,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<h1>Modification des informations :</h1>
|
||||
<fieldset>
|
||||
<legend>Fiche Pompier</legend>
|
||||
<form name="fPompier" method="POST" action="ModifPompier">
|
||||
<label for="nIdCaserne">Id Caserne : </label>
|
||||
<input type="number" name="nIdCaserne" value="${sessionScope.unPompier.getIdCaserne()}"/><br /><br/>
|
||||
<label for="ztNom">Nom : </label>
|
||||
<input type="text" name="ztNom" placeholder="Nom" value="${unPompier.getNom()}"/><br /><br/>
|
||||
<label for="ztPrenom">Prénom : </label>
|
||||
<input type="text" name="ztPrenom" placeholder="Prénom" value="${unPompier.getPrenom()}"/><br /><br/>
|
||||
<label for="nStatut">Numéro de statut : </label>
|
||||
<input type="number" name="nStatut" value="${unPompier.getStatut()}"/><br /><br/>
|
||||
<label for="eMail">Mail : </label>
|
||||
<input type="email" name="eMail" value="${unPompier.getMail()}"/> <br /><br/>
|
||||
<label for="ztLogin">Login : </label>
|
||||
<input type="text" name="ztLogin" placeholder="Login" value="${unPompier.getLogin()}"/><br /><br/>
|
||||
<label for="ztMDP">Mot de passe : </label>
|
||||
<input type="password" name="ztMDP" placeholder="Mot de passe" value="${unPompier.getMdp()}"/><br /><br />
|
||||
<label for="ztAdresse">Adresse : </label>
|
||||
<input type="text" name="ztAdresse" value="${unPompier.getAdresse()}"/><br /><br/>
|
||||
<label for="ztAdrCP">Code postal : </label>
|
||||
<input type="text" name="ztAdrCP" placeholder="Code postal" value="${unPompier.getCp()}"/><br /><br/>
|
||||
<label for="ztAdrVille">Ville : </label>
|
||||
<input type="text" name="ztAdrVille" placeholder="Ville" value="${unPompier.getVille()}"/><br /><br/>
|
||||
<label for="nBip">Numéro de bip : </label>
|
||||
<input type="number" name="nBip" value="${unPompier.getBip()}"/><br /><br/>
|
||||
<label for="nbGardes">Nombre de gardes : </label>
|
||||
<input type="number" name="nbGardes" value="${unPompier.getNbGardes()}"/><br /><br/>
|
||||
<label for="nGrade">Numéro de grade : </label>
|
||||
<input type="number" name="nGrade" value="${unPompier.getGrade()}"/><br /><br/>
|
||||
<label for="commentaire">Commentaire : </label>
|
||||
<input type="text" name="commentaire" placeholder="Commentaire" value="${unPompier.getCommentaire()}"/><br /><br/>
|
||||
<input type="submit" value="Valider" />
|
||||
|
||||
</form>
|
||||
</fieldset>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<title>Pompier</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Bienvenue</h1>
|
||||
<h1>Hello World!</h1>
|
||||
<a href="ModifPompier"><input type="button" name="btModifP" value="Modifier la fiche pompier"/></a>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -9,19 +9,19 @@
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
|
||||
|
||||
<fieldset>
|
||||
<legend>Authentification</legend>
|
||||
<form method="POST" action="Authentification">
|
||||
<input type="text" name="ztPseudo" placeholder="Pseudo" /><br /><!-- comment -->
|
||||
<input type="password" name="ztMDP" placeholder="Mot de passe" /><br /><br />
|
||||
<input type="submit" value="Valider" />
|
||||
</form>
|
||||
</fieldset>
|
||||
|
||||
<!-- Si l'utilisateur s'est authentifié,
|
||||
Affichage du message contenu dans l'objet controlForm de type AuthentifForm -->
|
||||
|
||||
<p>${controlForm.getResultat()}</p>
|
||||
|
||||
|
||||
</body>
|
||||
<fieldset>
|
||||
<legend>Authentification</legend>
|
||||
<form method="POST" action="Authentification">
|
||||
<input type="text" name="ztPseudo" placeholder="Pseudo" /><br /><!-- comment -->
|
||||
<input type="password" name="ztMDP" placeholder="Mot de passe" /><br /><br />
|
||||
<input type="submit" value="Valider" />
|
||||
</form>
|
||||
</fieldset>
|
||||
|
||||
<!-- Si l'utilisateur s'est authentifié,
|
||||
Affichage du message contenu dans l'objet controlForm de type AuthentifForm -->
|
||||
<p>${controlForm.getResultat()}</p>
|
||||
<br />
|
||||
|
||||
<br />
|
@ -1,4 +1,4 @@
|
||||
<%-- any content can be specified here e.g.: --%>
|
||||
<%@ page pageEncoding="UTF-8" %>
|
||||
<h2></h2>
|
||||
<p align="center"><img src="image/SDIS-29(1).png" alt="SDIS 29" width="100" height="100"/></p>
|
||||
<p align="center"><img src="image/SDIS-29.png" alt="SDIS 29" /></p>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 145 KiB |
BIN
web/image/SDIS-29.png
Normal file
BIN
web/image/SDIS-29.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 148 KiB |
Loading…
x
Reference in New Issue
Block a user