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("prenom"),
resultQ.getInt("statut"),
resultQ.getInt("typePers"),
resultQ.getString("mail"),
resultQ.getString("login"),
resultQ.getString("mdp"),
resultQ.getInt("adrNo"),
resultQ.getString("adrRue"),
resultQ.getString("adrCP"),
resultQ.getString("adrVille"),
resultQ.getString("cp"),
resultQ.getString("ville"),
resultQ.getInt("grade"),
resultQ.getString("commentaire")
);
HttpSession maSession = request.getSession();
maSession.setAttribute("lePompier", lePompier);
}
@ -206,4 +209,8 @@ public class PompierMySql {
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 prenom;
private int statut;
private int typePers;
private String mail;
private String login;
private String mdp;
private int adrNo;
private String adrRue;
private String adrCP;
private String adrVille;
private String adresse;
private String cp;
private String ville;
private int bip;
private int nbGardes;
private int grade;
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) {
this(idCaserne, nom, prenom, statut, mail, login, mdp, adrNo, adrRue, adrCP, adrVille, grade, 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.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.nom = nom;
this.prenom = prenom;
this.statut = statut;
this.typePers = typePers;
this.mail = mail;
this.login = login;
this.mdp = mdp;
this.adrNo = adrNo;
this.adrRue = adrRue;
this.adrCP = adrCP;
this.adrVille = adrVille;
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) {
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() {
@ -88,6 +109,14 @@ public class Pompier {
this.statut = statut;
}
public int getTypePers() {
return typePers;
}
public void setTypePers(int typePers) {
this.typePers = typePers;
}
public String getMail() {
return mail;
}
@ -112,36 +141,44 @@ public class Pompier {
this.mdp = mdp;
}
public int getAdrNo() {
return adrNo;
public String getAdresse() {
return adresse;
}
public void setAdrNo(int adrNo) {
this.adrNo = adrNo;
public void setAdresse(String adresse) {
this.adresse = adresse;
}
public String getAdrRue() {
return adrRue;
public String getCp() {
return cp;
}
public void setAdrRue(String adrRue) {
this.adrRue = adrRue;
public void setCp(String cp) {
this.cp = cp;
}
public String getAdrCP() {
return adrCP;
public String getVille() {
return ville;
}
public void setAdrCP(String adrCP) {
this.adrCP = adrCP;
public void setVille(String ville) {
this.ville = ville;
}
public String getAdrVille() {
return adrVille;
public int getBip() {
return bip;
}
public void setAdrVille(String adrVille) {
this.adrVille = adrVille;
public void setBip(int bip) {
this.bip = bip;
}
public int getNbGardes() {
return nbGardes;
}
public void setNbGardes(int nbGardes) {
this.nbGardes = nbGardes;
}
public int getGrade() {
@ -160,23 +197,34 @@ 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 = 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);
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;
return hash;
}
@ -201,12 +249,21 @@ public class Pompier {
if (this.statut != other.statut) {
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;
}
if (this.grade != other.grade) {
return false;
}
if (this.idEmployeur != other.idEmployeur) {
return false;
}
if (!Objects.equals(this.nom, other.nom)) {
return false;
}
@ -222,13 +279,13 @@ public class Pompier {
if (!Objects.equals(this.mdp, other.mdp)) {
return false;
}
if (!Objects.equals(this.adrRue, other.adrRue)) {
if (!Objects.equals(this.adresse, other.adresse)) {
return false;
}
if (!Objects.equals(this.adrCP, other.adrCP)) {
if (!Objects.equals(this.cp, other.cp)) {
return false;
}
if (!Objects.equals(this.adrVille, other.adrVille)) {
if (!Objects.equals(this.ville, other.ville)) {
return false;
}
if (!Objects.equals(this.commentaire, other.commentaire)) {
@ -239,9 +296,9 @@ public class Pompier {
@Override
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/>
<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/>
<label for="ztMDP">Mot de passe : </label>
<input type="password" name="ztMDP" placeholder="Mot de passe" /><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="ztAdresse">Adresse : </label>
<input type="text" name="ztAdresse"/><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>

View File

@ -9,19 +9,17 @@
<%@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>
<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 />