Compare commits

..

3 Commits

Author SHA1 Message Date
clementine.desrucques
92854fc1f9 2021-10-21 16:43:59 +02:00
clementine.desrucques
cd2d0e634f 2021-10-21 16:35:09 +02:00
clementine.desrucques
a9dec9bae4 2021-10-21 16:23:58 +02:00
4 changed files with 141 additions and 72 deletions

View File

@ -186,16 +186,19 @@ public class PompierMySql {
resultQ.getString("nom"), resultQ.getString("nom"),
resultQ.getString("prenom"), resultQ.getString("prenom"),
resultQ.getInt("statut"), resultQ.getInt("statut"),
resultQ.getInt("typePers"),
resultQ.getString("mail"), resultQ.getString("mail"),
resultQ.getString("login"), resultQ.getString("login"),
resultQ.getString("mdp"), resultQ.getString("mdp"),
resultQ.getInt("adrNo"), resultQ.getInt("adrNo"),
resultQ.getString("adrRue"), resultQ.getString("adrRue"),
resultQ.getString("adrCP"), resultQ.getString("cp"),
resultQ.getString("adrVille"), resultQ.getString("ville"),
resultQ.getInt("grade"), resultQ.getInt("grade"),
resultQ.getString("commentaire") resultQ.getString("commentaire")
); );
HttpSession maSession = request.getSession(); HttpSession maSession = request.getSession();
maSession.setAttribute("lePompier", lePompier); maSession.setAttribute("lePompier", lePompier);
} }
@ -206,4 +209,8 @@ public class PompierMySql {
return resultat; return resultat;
} }
private void setResultat(String pompier) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
} }

View File

@ -17,35 +17,56 @@ public class Pompier {
private String nom; private String nom;
private String prenom; private String prenom;
private int statut; private int statut;
private int typePers;
private String mail; private String mail;
private String login; private String login;
private String mdp; private String mdp;
private int adrNo; private String adresse;
private String adrRue; private String cp;
private String adrCP; private String ville;
private String adrVille; private int bip;
private int nbGardes;
private int grade; private int grade;
private String commentaire; private String commentaire;
private 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) { 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) {
this(idCaserne, nom, prenom, statut, mail, login, mdp, adrNo, adrRue, adrCP, adrVille, grade, commentaire);
this.id = id; this.id = id;
}
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.idCaserne = idCaserne;
this.nom = nom; this.nom = nom;
this.prenom = prenom; this.prenom = prenom;
this.statut = statut; this.statut = statut;
this.typePers = typePers;
this.mail = mail; this.mail = mail;
this.login = login; this.login = login;
this.mdp = mdp; this.mdp = mdp;
this.adrNo = adrNo; this.adresse = adresse;
this.adrRue = adrRue; this.cp = cp;
this.adrCP = adrCP; this.ville = ville;
this.adrVille = adrVille; this.bip = bip;
this.nbGardes = nbGardes;
this.grade = grade; this.grade = grade;
this.commentaire = commentaire; 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) {
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 int getId() { public int getId() {
@ -88,6 +109,14 @@ public class Pompier {
this.statut = statut; this.statut = statut;
} }
public int getTypePers() {
return typePers;
}
public void setTypePers(int typePers) {
this.typePers = typePers;
}
public String getMail() { public String getMail() {
return mail; return mail;
} }
@ -112,36 +141,44 @@ public class Pompier {
this.mdp = mdp; this.mdp = mdp;
} }
public int getAdrNo() { public String getAdresse() {
return adrNo; return adresse;
} }
public void setAdrNo(int adrNo) { public void setAdresse(String adresse) {
this.adrNo = adrNo; this.adresse = adresse;
} }
public String getAdrRue() { public String getCp() {
return adrRue; return cp;
} }
public void setAdrRue(String adrRue) { public void setCp(String cp) {
this.adrRue = adrRue; this.cp = cp;
} }
public String getAdrCP() { public String getVille() {
return adrCP; return ville;
} }
public void setAdrCP(String adrCP) { public void setVille(String ville) {
this.adrCP = adrCP; this.ville = ville;
} }
public String getAdrVille() { public int getBip() {
return adrVille; return bip;
} }
public void setAdrVille(String adrVille) { public void setBip(int bip) {
this.adrVille = adrVille; this.bip = bip;
}
public int getNbGardes() {
return nbGardes;
}
public void setNbGardes(int nbGardes) {
this.nbGardes = nbGardes;
} }
public int getGrade() { public int getGrade() {
@ -160,23 +197,34 @@ public class Pompier {
this.commentaire = commentaire; this.commentaire = commentaire;
} }
public int getIdEmployeur() {
return idEmployeur;
}
public void setIdEmployeur(int idEmployeur) {
this.idEmployeur = idEmployeur;
}
@Override @Override
public int hashCode() { public int hashCode() {
int hash = 3; int hash = 7;
hash = 29 * hash + this.id; hash = 47 * hash + this.id;
hash = 29 * hash + this.idCaserne; hash = 47 * hash + this.idCaserne;
hash = 29 * hash + Objects.hashCode(this.nom); hash = 47 * hash + Objects.hashCode(this.nom);
hash = 29 * hash + Objects.hashCode(this.prenom); hash = 47 * hash + Objects.hashCode(this.prenom);
hash = 29 * hash + this.statut; hash = 47 * hash + this.statut;
hash = 29 * hash + Objects.hashCode(this.mail); hash = 47 * hash + this.typePers;
hash = 29 * hash + Objects.hashCode(this.login); hash = 47 * hash + Objects.hashCode(this.mail);
hash = 29 * hash + Objects.hashCode(this.mdp); hash = 47 * hash + Objects.hashCode(this.login);
hash = 29 * hash + this.adrNo; hash = 47 * hash + Objects.hashCode(this.mdp);
hash = 29 * hash + Objects.hashCode(this.adrRue); hash = 47 * hash + Objects.hashCode(this.adresse);
hash = 29 * hash + Objects.hashCode(this.adrCP); hash = 47 * hash + Objects.hashCode(this.cp);
hash = 29 * hash + Objects.hashCode(this.adrVille); hash = 47 * hash + Objects.hashCode(this.ville);
hash = 29 * hash + this.grade; hash = 47 * hash + this.bip;
hash = 29 * hash + Objects.hashCode(this.commentaire); hash = 47 * hash + this.nbGardes;
hash = 47 * hash + this.grade;
hash = 47 * hash + Objects.hashCode(this.commentaire);
hash = 47 * hash + this.idEmployeur;
return hash; return hash;
} }
@ -201,12 +249,21 @@ public class Pompier {
if (this.statut != other.statut) { if (this.statut != other.statut) {
return false; return false;
} }
if (this.adrNo != other.adrNo) { if (this.typePers != other.typePers) {
return false;
}
if (this.bip != other.bip) {
return false;
}
if (this.nbGardes != other.nbGardes) {
return false; return false;
} }
if (this.grade != other.grade) { if (this.grade != other.grade) {
return false; return false;
} }
if (this.idEmployeur != other.idEmployeur) {
return false;
}
if (!Objects.equals(this.nom, other.nom)) { if (!Objects.equals(this.nom, other.nom)) {
return false; return false;
} }
@ -222,13 +279,13 @@ public class Pompier {
if (!Objects.equals(this.mdp, other.mdp)) { if (!Objects.equals(this.mdp, other.mdp)) {
return false; return false;
} }
if (!Objects.equals(this.adrRue, other.adrRue)) { if (!Objects.equals(this.adresse, other.adresse)) {
return false; return false;
} }
if (!Objects.equals(this.adrCP, other.adrCP)) { if (!Objects.equals(this.cp, other.cp)) {
return false; return false;
} }
if (!Objects.equals(this.adrVille, other.adrVille)) { if (!Objects.equals(this.ville, other.ville)) {
return false; return false;
} }
if (!Objects.equals(this.commentaire, other.commentaire)) { if (!Objects.equals(this.commentaire, other.commentaire)) {
@ -239,7 +296,7 @@ public class Pompier {
@Override @Override
public String toString() { public String toString() {
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 + '}'; 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 + '}';
} }

View File

@ -24,24 +24,31 @@
<input type="text" name="ztPrenom" placeholder="Prénom"/><br /><br/> <input type="text" name="ztPrenom" placeholder="Prénom"/><br /><br/>
<label for="nStatut">Numéro de statut : </label> <label for="nStatut">Numéro de statut : </label>
<input type="number" name="nStatut"/><br /><br/> <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> <label for="eMail">Mail : </label>
<input type="email" name="eMail"/><br /><br/> <input type="email" name="eMail"/><br /><br/>
<label for="ztLogin">Login : </label> <label for="ztLogin">Login : </label>
<input type="text" name="ztPseudo" placeholder="Login"/><br /><br/> <input type="text" name="ztPseudo" placeholder="Login"/><br /><br/>
<label for="ztMDP">Mot de passe : </label> <label for="ztMDP">Mot de passe : </label>
<input type="password" name="ztMDP" placeholder="Mot de passe" /><br /><br /> <input type="password" name="ztMDP" placeholder="Mot de passe" /><br /><br />
<label for="nAdrNo">Numéro de rue : </label> <label for="ztAdresse">Adresse : </label>
<input type="number" name="nAdrNo"/><br /><br/> <input type="text" name="ztAdresse"/><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> <label for="ztAdrCP">Code postal : </label>
<input type="text" name="ztAdrCP" placeholder="Code postal" /><br /><br/> <input type="text" name="ztAdrCP" placeholder="Code postal" /><br /><br/>
<label for="ztAdrVille">Ville : </label> <label for="ztAdrVille">Ville : </label>
<input type="text" name="ztAdrVille" placeholder="Ville" /><br /><br/> <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> <label for="nGrade">Numéro de grade : </label>
<input type="number" name="nGrade"/><br /><br/> <input type="number" name="nGrade"/><br /><br/>
<label for="commentaire">Commentaire : </label> <label for="commentaire">Commentaire : </label>
<input type="text" name="commentaire" placeholder="Commentaire" /><br /><br/> <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" /> <input type="submit" value="Valider" />
</form> </form>
</fieldset> </fieldset>

View File

@ -9,19 +9,17 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
<fieldset> <fieldset>
<legend>Authentification</legend> <legend>Authentification</legend>
<form method="POST" action="Authentification"> <form method="POST" action="Authentification">
<input type="text" name="ztPseudo" placeholder="Pseudo" /><br /><!-- comment --> <input type="text" name="ztPseudo" placeholder="Pseudo" /><br /><!-- comment -->
<input type="password" name="ztMDP" placeholder="Mot de passe" /><br /><br /> <input type="password" name="ztMDP" placeholder="Mot de passe" /><br /><br />
<input type="submit" value="Valider" /> <input type="submit" value="Valider" />
</form> </form>
</fieldset> </fieldset>
<!-- Si l'utilisateur s'est authentifié,
Affichage du message contenu dans l'objet controlForm de type AuthentifForm -->
<p>${controlForm.getResultat()}</p>
<!-- Si l'utilisateur s'est authentifié,
Affichage du message contenu dans l'objet controlForm de type AuthentifForm -->
<p>${controlForm.getResultat()}</p>
<br /> <br />