Skip to content
Commits on Source (3)
......@@ -48,7 +48,7 @@ public class BootstrapData implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
Pilote pilote1 = new Pilote();
pilote1.setNom("GONÇALVES");
pilote1.setNom("GONCALVES");
pilote1.setPrenom("Yoda");
pilote1.setAge(100);
pilote1.setRace(RacePilote.CHALACTEENS);
......
......@@ -83,29 +83,29 @@ public class Calculs {
// Major 1500-3999 + 3 TOTAL Mission
// Commandant >=4000 + 10 TOTAL Mission
public GradePilote checkGradePilote(int nbHeures, int totalNbMission, int totalNbMissionCombat) {
// Officier: Less than 500 hours
if (nbHeures < 500) {
return GradePilote.OFFICIER;
// Commandant: 4000 hours or more with at least 3 TOTAL Missions and 1 Mission COMBAT
if (nbHeures >= 4000 && totalNbMission >= 10 && totalNbMissionCombat >= 1) {
return GradePilote.COMMANDANT;
}
// Lieutenant: 500 hours or more
if (nbHeures >= 500) {
return GradePilote.LIEUTENANT;
// Major: Between 1500 with at least 3 TOTAL Missions and 1 Mission COMBAT
if (nbHeures >= 1500 && totalNbMission >= 3 && totalNbMissionCombat >= 1) {
return GradePilote.MAJOR;
}
// Capitaine: Between 501 and 1500 hours with at least 1 Mission COMBAT
if (nbHeures > 500 && nbHeures <= 1500 && totalNbMissionCombat >= 1) {
// Capitaine: 1500 hours with at least 1 Mission COMBAT
if (nbHeures >= 1500 && totalNbMissionCombat >= 1) {
return GradePilote.CAPITAINE;
}
// Major: Between 1500 and 3999 hours with at least 3 TOTAL Missions and 1 Mission COMBAT
if (nbHeures >= 1500 && nbHeures <= 3999 && totalNbMission >= 3 && totalNbMissionCombat >= 1) {
return GradePilote.MAJOR;
// Lieutenant: 500 hours or less than 1500
if (nbHeures >= 500 && nbHeures <= 1499) {
return GradePilote.LIEUTENANT;
}
// Commandant: 4000 hours or more with at least 3 TOTAL Missions and 1 Mission COMBAT
if (nbHeures >= 4000 && totalNbMission >= 3 && totalNbMissionCombat >= 1) {
return GradePilote.COMMANDANT;
// Officier: Less than 500 hours
if (nbHeures < 500) {
return GradePilote.OFFICIER;
}
// No matching conditions, return null to indicate no grade assigned
......
......@@ -98,7 +98,7 @@ button{
margin-left : auto;
margin-right : auto;
}
main::before {
body::before {
content: "";
position: absolute;
top: 0;
......@@ -165,6 +165,11 @@ select{
color: yellow;
}
.affectation{
display: flex;
flex-direction: column;
}
.radio {
padding: 0.3rem 0.5rem;
......
......@@ -32,18 +32,6 @@ Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this temp
<option th:each="resultat : ${resultatMission}" th:value="${resultat}" th:text="${resultat}"></option>
</select>
</div>
<!--
<div>
<p> List pilote(s) dans la mission: </p>
<div th:each="pilote : ${pilotes}">
<p th:text="${pilote.nom}"></p>
</div>
<p> List chasseur(s) dans la mission: </p>
<div th:each="chasseur : ${chasseurs}">
<p th:text="${chasseur.type}"></p>
</div>
</div>
-->
</br>
<div>
<input type="submit" value="Submit"/>
......
......@@ -28,6 +28,10 @@
</td>
<td th:text="${chasseur.type}"></td>
<td th:text="${chasseur.etat}"></td>
<td>
<a th:href="'/ficheChasseur?id_chasseur=' + ${chasseur.idChasseur}" th:text="Fiche_Chasseur">
</a>
</td>
</tr>
</table>
</main>
......
......@@ -16,10 +16,17 @@ Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this temp
</head>
<body>
<header>
<h1><span class='faulty-letter'>{</span> Liste Missions Terminées</h1>
<h1><span class='faulty-letter'>{</span> Liste Missions</h1>
</header>
<main>
<table>
<tr>
<th>Nom</th>
<th>Pilote</th>
<th>Chasseur</th>
<th>Etat Mission</th>
<th>Nb heures de vol</th>
</tr>
<tr th:each="mission : ${missions}">
<td th:text="${mission.titre}"></td>
<td>
......
......@@ -48,6 +48,10 @@ Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this temp
<td th:text="${pilote.grade}"></td>
<td th:text="${pilote.type}"></td>
<td th:text="${pilote.etat}"></td>
<td>
<a th:href="'/fichePilote?id_pilote=' + ${pilote.idPilote}" th:text="Fiche_Pilote">
</a>
</td>
</tr>
</table>
</main>
......
......@@ -8,9 +8,10 @@ Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this temp
<title>TODO supply a title</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/style.css"/>
</head>
<body>
<h1>Liste des Pilotes disponible (sans apprenti)</h1>
<h1>Liste des Pilotes disponible</h1>
<table>
<tr>
......
......@@ -21,19 +21,19 @@ Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this temp
<h2>Pilote</h2>
<ul>
<li><a href="/inscriptionPilote" class="menu">Inscription d'un nouveau pilote</a></li>
<li><a href="/listePilote" class="menu">Liste des pilotes actifs</a></li>
<li><a href="/listePilote" class="menu">Liste des pilotes</a></li>
<li><a href="/cherchePilote" class="menu">Cherche pilote par nom</a></li>
</ul>
<h2>Chasseur</h2>
<ul>
<li><a href="/nouveauChasseur" class="menu">Ajouter un chasseur à la flotte</a></li>
<li><a href="/nouveauChasseur" class="menu">Ajouter un chasseur a la flotte</a></li>
<li><a href="/listeChasseur" class="menu">Liste des chasseurs</a></li>
</ul>
<h2>Mission</h2>
<ul>
<li><a href="/nouvelleMission" class="menu">Nouvelle mission</a></li>
<li><a href="/listeMission" class="menu">Liste des missions terminées</a></li>
<li><a href="/listeMission" class="menu">Liste des missions</a></li>
<li><a href="/clotureMission" class="menu">Cloturer une mission</a></li>
</ul>
</main>
......
......@@ -37,7 +37,7 @@ Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this temp
</form>
<form class='mission' th:object="${affectation}" th:action="@{/affectation/{idMission}}" method="post">
<form id="affectation" class='mission' th:object="${affectation}" th:action="@{/affectation/{idMission}}" method="post">
<h2>Affectation</h2>
<div class="box">
<label for="piloteSelect">Choisir Pilote:</label>
......