From a13368d2a1b06bee3e40c83b1d81d2d8f6d096e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20Borbo=C3=ABn?= <ponsfrilus@gmail.com>
Date: Mon, 11 Jan 2021 21:00:43 +0100
Subject: [PATCH] [fix] PHP Notice

---
 .../formParts/new/alreadyapplicant.php        |  4 +--
 .../templates/formParts/new/maturity.php      |  2 +-
 .../templates/formParts/new/personnal.php     | 32 +++++++++----------
 .../templates/formParts/new/proactivities.php | 10 +++---
 .../templates/formParts/new/responsibles.php  | 30 ++++++++---------
 .../templates/formParts/new/scolarity.php     | 22 ++++++-------
 .../templates/formParts/new/trainings.php     | 12 +++----
 7 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/canapEPFL/templates/formParts/new/alreadyapplicant.php b/canapEPFL/templates/formParts/new/alreadyapplicant.php
index 2adac39..0fc4101 100644
--- a/canapEPFL/templates/formParts/new/alreadyapplicant.php
+++ b/canapEPFL/templates/formParts/new/alreadyapplicant.php
@@ -5,12 +5,12 @@
     <label class="custom-control-label" for="dejaCand1">Non</label>
   </div>
   <div class="custom-control custom-radio">
-    <input type="radio" name="dejaCand" id="dejaCand2" class="custom-control-input" value="true" <?php echo ($_SESSION['postedForm']['dejaCand'] == "true") ? "checked=\"checked\"" : ''; ?>>
+    <input type="radio" name="dejaCand" id="dejaCand2" class="custom-control-input" value="true" <?php echo (isset($_SESSION['postedForm']['dejaCand']) && $_SESSION['postedForm']['dejaCand'] == "true") ? "checked=\"checked\"" : ''; ?>>
     <label class="custom-control-label" for="dejaCand2">Oui</label>
   </div>
 </div>
 <div class="form-group" id="dejaCandAnnee" style="display: none;">
   <label for="dejaCandAnneeInput">Année de candidature *</label>
-  <input type="text" name="dejaCandAnnee" id="dejaCandAnneeInput" class="form-control" placeholder="Année de candidature" value="<?php echo $_SESSION['postedForm']['dejaCandAnnee'] != '' ? $_SESSION['postedForm']['dejaCandAnnee'] : ''; ?>" maxlength="4"/>
+  <input type="text" name="dejaCandAnnee" id="dejaCandAnneeInput" class="form-control" placeholder="Année de candidature" value="<?php echo (isset($_SESSION['postedForm']['dejaCandAnnee']) && $_SESSION['postedForm']['dejaCandAnnee'] != '') ? $_SESSION['postedForm']['dejaCandAnnee'] : ''; ?>" maxlength="4"/>
   <small id="dejaCandError" class="form-text text-muted error"></small>
 </div>
\ No newline at end of file
diff --git a/canapEPFL/templates/formParts/new/maturity.php b/canapEPFL/templates/formParts/new/maturity.php
index c6f6db8..e544d60 100644
--- a/canapEPFL/templates/formParts/new/maturity.php
+++ b/canapEPFL/templates/formParts/new/maturity.php
@@ -4,7 +4,7 @@
   <label class="custom-control-label" for="mpt1">Non</label>
 </div>
 <div class="custom-control custom-radio">
-  <input type="radio" name="mpt" id="mpt2" class="custom-control-input" value="true" <?php echo ($_SESSION['postedForm']['mpt'] == "true") ? "checked=\"checked\"" : ''; ?>>
+  <input type="radio" name="mpt" id="mpt2" class="custom-control-input" value="true" <?php echo (isset($_SESSION['postedForm']['mpt']) && $_SESSION['postedForm']['mpt'] == "true") ? "checked=\"checked\"" : ''; ?>>
   <label class="custom-control-label" for="mpt2">Oui</label>
 </div>
 <button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="infoMpt">Infos sur la maturité professionnelle</button>
\ No newline at end of file
diff --git a/canapEPFL/templates/formParts/new/personnal.php b/canapEPFL/templates/formParts/new/personnal.php
index 1f7f263..1556e61 100644
--- a/canapEPFL/templates/formParts/new/personnal.php
+++ b/canapEPFL/templates/formParts/new/personnal.php
@@ -1,8 +1,8 @@
 <label for="genreApp">Genre *</label>
 <select name="genreApp" id="genreApp" class="custom-select" data-required>
   <option value="notSelected" <?php echo (!isset($_SESSION['postedForm']['genreApp'])) ? "selected" : ''; ?> disabled> Choisir un genre...</option>
-  <option value="Homme" <?php echo ($_SESSION['postedForm']['genreApp'] == "Homme") ? "selected" : ''; ?>>Homme</option>
-  <option value="Femme" <?php echo ($_SESSION['postedForm']['genreApp'] == "Femme") ? "selected" : ''; ?>>Femme</option>
+  <option value="Homme" <?php echo (isset($_SESSION['postedForm']['genreApp']) && $_SESSION['postedForm']['genreApp'] == "Homme") ? "selected" : ''; ?>>Homme</option>
+  <option value="Femme" <?php echo (isset($_SESSION['postedForm']['genreApp']) && $_SESSION['postedForm']['genreApp'] == "Femme") ? "selected" : ''; ?>>Femme</option>
 </select>
 
 <input type="text" name="guestSciper" class="form-control" value="<?php echo $guest_sciper;?>" readonly hidden />
@@ -14,60 +14,60 @@
 <input type="text" name="surnameApp" id="surnameApp" class="form-control" placeholder="Prénom" value="<?php echo $firstname;?>" readonly />
 
 <label for="adrApp">Rue *</label>
-<input type="text" name="adrApp" id="adrApp" placeholder="Rue" class="form-control" value="<?php echo $_SESSION['postedForm']['adrApp'] != '' ? $_SESSION['postedForm']['adrApp'] : ''; ?>" minlength="2" maxlength="40" data-required/>
+<input type="text" name="adrApp" id="adrApp" placeholder="Rue" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['adrApp']) && $_SESSION['postedForm']['adrApp'] != '') ? $_SESSION['postedForm']['adrApp'] : ''; ?>" minlength="2" maxlength="40" data-required/>
 
 <label for="nameApp">NPA, Domicile *</label>
-<input type="text" name="NPAApp" id="NPAApp" placeholder="NPA, Domicile" class="form-control" value="<?php echo $_SESSION['postedForm']['NPAApp'] != '' ? $_SESSION['postedForm']['NPAApp'] : ''; ?>"  minlength="2" maxlength="40" data-required/>
+<input type="text" name="NPAApp" id="NPAApp" placeholder="NPA, Domicile" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['NPAApp']) && $_SESSION['postedForm']['NPAApp'] != '') ? $_SESSION['postedForm']['NPAApp'] : ''; ?>"  minlength="2" maxlength="40" data-required/>
 
 <label for="telApp">Téléphone *</label>
-<input type="tel" name="telApp" id="telApp" placeholder="+41 21 123 45 67" class="form-control" value="<?php echo $_SESSION['postedForm']['telApp'] != '' ? $_SESSION['postedForm']['telApp'] : ''; ?>" minlength="2"  maxlength="20" data-required/>
+<input type="tel" name="telApp" id="telApp" placeholder="+41 21 123 45 67" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['telApp']) && $_SESSION['postedForm']['telApp'] != '') ? $_SESSION['postedForm']['telApp'] : ''; ?>" minlength="2"  maxlength="20" data-required/>
 
 <label for="telApp">Mobile *</label>
-<input type="tel" name="phoneApp" id="phoneApp" placeholder="+41 79 123 45 67" class="form-control" value="<?php echo $_SESSION['postedForm']['phoneApp'] != '' ? $_SESSION['postedForm']['phoneApp'] : ''; ?>" minlength="2" maxlength="20" data-required/>
+<input type="tel" name="phoneApp" id="phoneApp" placeholder="+41 79 123 45 67" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['phoneApp']) && $_SESSION['postedForm']['phoneApp'] != '') ? $_SESSION['postedForm']['phoneApp'] : ''; ?>" minlength="2" maxlength="20" data-required/>
 
 <label for="mailApp">Email *</label>
 <input type="email" name="mailApp" id="mailApp" value="<?php echo $user;?>" class="form-control" readonly />
 
 <label for="birthApp">Date de naissance *</label>
-<input type="text" autocomplete="none" placeholder="jj/mm/aaaa" name="birthApp" id="birthApp" class="form-control" value="<?php echo $_SESSION['postedForm']['birthApp'] != '' ? $_SESSION['postedForm']['birthApp'] : ''; ?>" data-required />
+<input type="text" autocomplete="none" placeholder="jj/mm/aaaa" name="birthApp" id="birthApp" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['birthApp']) && $_SESSION['postedForm']['birthApp'] != '') ? $_SESSION['postedForm']['birthApp'] : ''; ?>" data-required />
 <small id="errorBirthdate" class="error" class="form-text text-muted"></small>
 
 <label for="originApp">Lieu d'origine *</label>
-<input type="text" name="originApp" id="originApp" placeholder="Lieu d'origine" class="form-control" value="<?php echo $_SESSION['postedForm']['originApp'] != '' ? $_SESSION['postedForm']['originApp'] : ''; ?>" minlength="2" maxlength="35" data-required />
+<input type="text" name="originApp" id="originApp" placeholder="Lieu d'origine" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['originApp']) && $_SESSION['postedForm']['originApp'] != '') ? $_SESSION['postedForm']['originApp'] : ''; ?>" minlength="2" maxlength="35" data-required />
 
 <label for="nationApp">Nationalité *</label>
-<input type="text" name="nationApp" id="nationApp" placeholder="Nationalité" class="form-control" value="<?php echo $_SESSION['postedForm']['nationApp'] != '' ? $_SESSION['postedForm']['nationApp'] : ''; ?>" minlength="2" maxlength="30" data-required />
+<input type="text" name="nationApp" id="nationApp" placeholder="Nationalité" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['nationApp']) && $_SESSION['postedForm']['nationApp'] != '') ? $_SESSION['postedForm']['nationApp'] : ''; ?>" minlength="2" maxlength="30" data-required />
 
 <label for="permisEtrangerApp">Catégorie de permis pour étrangers</label>
-<input type="text" name="permisEtrangerApp" id="permisEtrangerApp" class="form-control" placeholder="Catégorie de permis pour étrangers" value="<?php echo $_SESSION['postedForm']['permisEtrangerApp'] != '' ? $_SESSION['postedForm']['permisEtrangerApp'] : ''; ?>" maxlength="1" />
+<input type="text" name="permisEtrangerApp" id="permisEtrangerApp" class="form-control" placeholder="Catégorie de permis pour étrangers" value="<?php echo (isset($_SESSION['postedForm']['permisEtrangerApp']) && $_SESSION['postedForm']['permisEtrangerApp'] != '') ? $_SESSION['postedForm']['permisEtrangerApp'] : ''; ?>" maxlength="1" />
 
 <label for="langApp">Langue maternelle *</label>
-<input type="text" name="langApp" id="langApp" placeholder="Langue maternelle" class="form-control" value="<?php echo $_SESSION['postedForm']['langApp'] != '' ? $_SESSION['postedForm']['langApp'] : ''; ?>" minlength="2" maxlength="20" data-required />
+<input type="text" name="langApp" id="langApp" placeholder="Langue maternelle" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['langApp']) && $_SESSION['postedForm']['langApp'] != '') ? $_SESSION['postedForm']['langApp'] : ''; ?>" minlength="2" maxlength="20" data-required />
 
 <label for="avsNumber">Numéro AVS*</label>
-<input type="text" name="avsNumber" id="avsNumber" placeholder="Numéro AVS" class="form-control" value="<?php echo $_SESSION['postedForm']['avsNumber'] != '' ? $_SESSION['postedForm']['avsNumber'] : ''; ?>" minlength="2" maxlength="20" data-required />
+<input type="text" name="avsNumber" id="avsNumber" placeholder="Numéro AVS" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['avsNumber']) && $_SESSION['postedForm']['avsNumber'] != '') ? $_SESSION['postedForm']['avsNumber'] : ''; ?>" minlength="2" maxlength="20" data-required />
 
 <div class="form-group">
   <label>Connaissances linguistiques *</label>
 
   <div class="custom-control custom-checkbox">
     <input hidden readonly value="0" name="applicant_speaks_french">
-    <input type="checkbox" class="custom-control-input" value="1" id="french" name="applicant_speaks_french" <?php echo $_SESSION['postedForm']['applicant_speaks_french'] == 1 ? 'checked="checked"' : ''; ?>>
+    <input type="checkbox" class="custom-control-input" value="1" id="french" name="applicant_speaks_french" <?php echo (isset($_SESSION['postedForm']['applicant_speaks_french']) && $_SESSION['postedForm']['applicant_speaks_french'] == 1) ? 'checked="checked"' : ''; ?>>
     <label class="custom-control-label" for="french">Français</label>
   </div>
   <div class="custom-control custom-checkbox">
     <input hidden readonly value="0" name="applicant_speaks_german">
-    <input type="checkbox" class="custom-control-input" value="1" id="german" name="applicant_speaks_german" <?php echo $_SESSION['postedForm']['applicant_speaks_german'] == 1 ? 'checked="checked"' : ''; ?>>
+    <input type="checkbox" class="custom-control-input" value="1" id="german" name="applicant_speaks_german" <?php echo (isset($_SESSION['postedForm']['applicant_speaks_german']) && $_SESSION['postedForm']['applicant_speaks_german'] == 1) ? 'checked="checked"' : ''; ?>>
     <label class="custom-control-label" for="german">Allemand</label>
   </div>
   <div class="custom-control custom-checkbox">
     <input hidden readonly value="0" name="applicant_speaks_english">
-    <input type="checkbox" class="custom-control-input" value="1" id="english" name="applicant_speaks_english" <?php echo $_SESSION['postedForm']['applicant_speaks_english'] == 1 ? 'checked="checked"' : ''; ?>>
+    <input type="checkbox" class="custom-control-input" value="1" id="english" name="applicant_speaks_english" <?php echo (isset($_SESSION['postedForm']['applicant_speaks_english']) && $_SESSION['postedForm']['applicant_speaks_english'] == 1) ? 'checked="checked"' : ''; ?>>
     <label class="custom-control-label" for="english">Anglais</label>
   </div>
   <div class="custom-control custom-checkbox">
     <input hidden readonly value="0" name="applicant_speaks_other">
-    <input type="checkbox" class="custom-control-input" value="1" id="other" name="applicant_speaks_other" <?php echo $_SESSION['postedForm']['applicant_speaks_other'] == 1 ? 'checked="checked"' : ''; ?>>
+    <input type="checkbox" class="custom-control-input" value="1" id="other" name="applicant_speaks_other" <?php echo (isset($_SESSION['postedForm']['applicant_speaks_other']) && $_SESSION['postedForm']['applicant_speaks_other'] == 1) ? 'checked="checked"' : ''; ?>>
     <label class="custom-control-label" for="other">Autres</label>
   </div>
 </div>
\ No newline at end of file
diff --git a/canapEPFL/templates/formParts/new/proactivities.php b/canapEPFL/templates/formParts/new/proactivities.php
index 7015e8c..65266ff 100644
--- a/canapEPFL/templates/formParts/new/proactivities.php
+++ b/canapEPFL/templates/formParts/new/proactivities.php
@@ -7,21 +7,21 @@
   </tr>
   <tr>
     <td>
-      <input type="text" class="form-control" name="employeurPro1" placeholder="Employeur" value="<?php echo $_SESSION['postedForm']['employeurPro1'] != '' ? $_SESSION['postedForm']['employeurPro1'] : ''; ?>"/>
+      <input type="text" class="form-control" name="employeurPro1" placeholder="Employeur" value="<?php echo (isset($_SESSION['postedForm']['employeurPro1']) && $_SESSION['postedForm']['employeurPro1'] != '') ? $_SESSION['postedForm']['employeurPro1'] : ''; ?>"/>
     </td>
     <td>
-      <input type="text" class="form-control" name="lieuPro1" placeholder="Lieu" value="<?php echo $_SESSION['postedForm']['lieuPro1'] != '' ? $_SESSION['postedForm']['lieuPro1'] : ''; ?>"/>
+      <input type="text" class="form-control" name="lieuPro1" placeholder="Lieu" value="<?php echo (isset($_SESSION['postedForm']['lieuPro1']) && $_SESSION['postedForm']['lieuPro1'] != '') ? $_SESSION['postedForm']['lieuPro1'] : ''; ?>"/>
     </td>
     <td>
-      <input type="text" class="form-control" name="activitePro1" placeholder="Activité" value="<?php echo $_SESSION['postedForm']['activitePro1'] != '' ? $_SESSION['postedForm']['activitePro1'] : ''; ?>"/>
+      <input type="text" class="form-control" name="activitePro1" placeholder="Activité" value="<?php echo (isset($_SESSION['postedForm']['activitePro1']) && $_SESSION['postedForm']['activitePro1'] != '') ? $_SESSION['postedForm']['activitePro1'] : ''; ?>"/>
     </td>
     <td>
-      <input type="text" class="form-control" name="anneesPro1" placeholder="de-à (années)" value="<?php echo $_SESSION['postedForm']['anneesPro1'] != '' ? $_SESSION['postedForm']['anneesPro1'] : ''; ?>"/>
+      <input type="text" class="form-control" name="anneesPro1" placeholder="de-à (années)" value="<?php echo (isset($_SESSION['postedForm']['anneesPro1']) && $_SESSION['postedForm']['anneesPro1'] != '') ? $_SESSION['postedForm']['anneesPro1'] : ''; ?>"/>
     </td>
   </tr>
   <?php
     for ($i = 2; $i < 4; $i++) {
-      if ($_SESSION['postedForm']['employeurPro'.$i]) {
+      if (isset($_SESSION['postedForm']['employeurPro'.$i]) && $_SESSION['postedForm']['employeurPro'.$i]) {
   ?>
   <tr>
     <td><input type="text" class="form-control" name="employeurPro<?php echo $i ?>" placeholder="Employeur" value="<?php echo $_SESSION['postedForm']['employeurPro'.$i] ?>"/></td>
diff --git a/canapEPFL/templates/formParts/new/responsibles.php b/canapEPFL/templates/formParts/new/responsibles.php
index aabeaf8..8c2f2ad 100644
--- a/canapEPFL/templates/formParts/new/responsibles.php
+++ b/canapEPFL/templates/formParts/new/responsibles.php
@@ -4,7 +4,7 @@
   <label class="custom-control-label" for="maj1">Non</label>
 </div>
 <div class="custom-control custom-radio">
-  <input type="radio" name="maj" id="maj2" class="custom-control-input" value="true"  <?php echo ($_SESSION['postedForm']['maj'] == "true") ? "checked=\"checked\"" : ''; ?>>
+  <input type="radio" name="maj" id="maj2" class="custom-control-input" value="true"  <?php echo (isset($_SESSION['postedForm']['maj']) && $_SESSION['postedForm']['maj'] == "true") ? "checked=\"checked\"" : ''; ?>>
   <label class="custom-control-label" for="maj2">Oui</label>
 </div>
 </div>
@@ -13,34 +13,34 @@
 <label for="genreRep1">Genre *</label>
 <select name="genreRep1" id="genreRep1" class="custom-select">
   <option <?php echo (!isset($_SESSION['postedForm']['genreRep1'])) ? "selected" : ''; ?> disabled> Choisissez un genre</option>
-  <option value="Homme" <?php echo ($_SESSION['postedForm']['genreRep1'] == "Homme") ? "selected" : ''; ?>>Homme</option>
-  <option value="Femme" <?php echo ($_SESSION['postedForm']['genreRep1'] == "Femme") ? "selected" : ''; ?>>Femme</option>
+  <option value="Homme" <?php echo (isset($_SESSION['postedForm']['genreReo1']) && $_SESSION['postedForm']['genreRep1'] == "Homme") ? "selected" : ''; ?>>Homme</option>
+  <option value="Femme" <?php echo (isset($_SESSION['postedForm']['genreReo1']) && $_SESSION['postedForm']['genreRep1'] == "Femme") ? "selected" : ''; ?>>Femme</option>
 </select>
 <label for="nameRep1">Nom *</label>
-<input type="text" name="nameRep1" id="nameRep1" class="form-control" placeholder="Nom" value="<?php echo $_SESSION['postedForm']['nameRep1'] != '' ? $_SESSION['postedForm']['nameRep1'] : ''; ?>"/>
+<input type="text" name="nameRep1" id="nameRep1" class="form-control" placeholder="Nom" value="<?php echo (isset($_SESSION['postedForm']['nameRep1']) && $_SESSION['postedForm']['nameRep1'] != '') ? $_SESSION['postedForm']['nameRep1'] : ''; ?>"/>
 <label for="surnameRep1">Prénom *</label>
-<input type="text" name="surnameRep1" id="surnameRep1" class="form-control" placeholder="Prénom" value="<?php echo $_SESSION['postedForm']['surnameRep1'] != '' ? $_SESSION['postedForm']['surnameRep1'] : ''; ?>"/>
+<input type="text" name="surnameRep1" id="surnameRep1" class="form-control" placeholder="Prénom" value="<?php echo (isset($_SESSION['postedForm']['surnameRep1']) && $_SESSION['postedForm']['surnameRep1'] != '') ? $_SESSION['postedForm']['surnameRep1'] : ''; ?>"/>
 <label for="adrRep1">Rue *</label>
-<input type="text" name="adrRep1" id="adrRep1" class="form-control" placeholder="Rue" value="<?php echo $_SESSION['postedForm']['adrRep1'] != '' ? $_SESSION['postedForm']['adrRep1'] : ''; ?>"/>
+<input type="text" name="adrRep1" id="adrRep1" class="form-control" placeholder="Rue" value="<?php echo (isset($_SESSION['postedForm']['adrRep1']) && $_SESSION['postedForm']['adrRep1'] != '') ? $_SESSION['postedForm']['adrRep1'] : ''; ?>"/>
 <label for="NPARep1">NPA, Domicile *</label>
-<input type="text" name="NPARep1" id="NPARep1" class="form-control" placeholder = "NPA, Domicile" value="<?php echo $_SESSION['postedForm']['NPARep1'] != '' ? $_SESSION['postedForm']['NPARep1'] : ''; ?>"/>
+<input type="text" name="NPARep1" id="NPARep1" class="form-control" placeholder = "NPA, Domicile" value="<?php echo (isset($_SESSION['postedForm']['NPARep1']) && $_SESSION['postedForm']['NPARep1'] != '') ? $_SESSION['postedForm']['NPARep1'] : ''; ?>"/>
 <label for="telRep1">Téléphone *</label>
-<input type="text" name="telRep1" id="telRep1" class="form-control" placeholder="+41 79 123 45 67" value="<?php echo $_SESSION['postedForm']['telRep1'] != '' ? $_SESSION['postedForm']['telRep1'] : ''; ?>"/>
+<input type="text" name="telRep1" id="telRep1" class="form-control" placeholder="+41 79 123 45 67" value="<?php echo (isset($_SESSION['postedForm']['telRep1']) && $_SESSION['postedForm']['telRep1'] != '') ? $_SESSION['postedForm']['telRep1'] : ''; ?>"/>
 
 <p class="pt-4">Représentant secondaire:</p>
 <label for="genreRep2">Genre</label>
 <select name="genreRep2" id="genreRep2" class="custom-select">
   <option <?php echo (!isset($_SESSION['postedForm']['genreRep2'])) ? "selected" : ''; ?> disabled> Choisissez un genre</option>
-  <option value="Homme" <?php echo ($_SESSION['postedForm']['genreRep2'] == "Homme") ? "selected" : ''; ?>>Homme</option>
-  <option value="Femme" <?php echo ($_SESSION['postedForm']['genreRep2'] == "Femme") ? "selected" : ''; ?>>Femme</option>
+  <option value="Homme" <?php echo (isset($_SESSION['postedForm']['genreRep2']) && $_SESSION['postedForm']['genreRep2'] == "Homme") ? "selected" : ''; ?>>Homme</option>
+  <option value="Femme" <?php echo (isset($_SESSION['postedForm']['genreRep2']) && $_SESSION['postedForm']['genreRep2'] == "Femme") ? "selected" : ''; ?>>Femme</option>
 </select>
 <label for="nameRep2">Nom</label>
-<input type="text" name="nameRep2" id="nameRep2" class="form-control" placeholder="Nom" value="<?php echo $_SESSION['postedForm']['nameRep2'] != '' ? $_SESSION['postedForm']['nameRep2'] : ''; ?>"/>
+<input type="text" name="nameRep2" id="nameRep2" class="form-control" placeholder="Nom" value="<?php echo (isset($_SESSION['postedForm']['nameRep2']) && $_SESSION['postedForm']['nameRep2'] != '') ? $_SESSION['postedForm']['nameRep2'] : ''; ?>"/>
 <label for="surnameRep2">Prénom</label>
-<input type="text" name="surnameRep2" id="surnameRep2" class="form-control" placeholder="Prénom" value="<?php echo $_SESSION['postedForm']['surnameRep2'] != '' ? $_SESSION['postedForm']['surnameRep2'] : ''; ?>"/>
+<input type="text" name="surnameRep2" id="surnameRep2" class="form-control" placeholder="Prénom" value="<?php echo (isset($_SESSION['postedForm']['surnameRep2']) && $_SESSION['postedForm']['surnameRep2'] != '') ? $_SESSION['postedForm']['surnameRep2'] : ''; ?>"/>
 <label for="adrRep2">Rue</label>
-<input type="text" name="adrRep2" id="adrRep2" class="form-control" placeholder="Rue" value="<?php echo $_SESSION['postedForm']['adrRep2'] != '' ? $_SESSION['postedForm']['adrRep2'] : ''; ?>"/>
+<input type="text" name="adrRep2" id="adrRep2" class="form-control" placeholder="Rue" value="<?php echo (isset($_SESSION['postedForm']['adrRep2']) && $_SESSION['postedForm']['adrRep2'] != '') ? $_SESSION['postedForm']['adrRep2'] : ''; ?>"/>
 <label for="NPARep2">NPA, Domicile</label>
-<input type="text" name="NPARep2" id="NPARep2" class="form-control" placeholder = "NPA, Domicile" value="<?php echo $_SESSION['postedForm']['NPARep2'] != '' ? $_SESSION['postedForm']['NPARep2'] : ''; ?>"/>
+<input type="text" name="NPARep2" id="NPARep2" class="form-control" placeholder = "NPA, Domicile" value="<?php echo (isset($_SESSION['postedForm']['NPARep2']) && $_SESSION['postedForm']['NPARep2'] != '') ? $_SESSION['postedForm']['NPARep2'] : ''; ?>"/>
 <label for="telRep2">Téléphone</label>
-<input type="text" name="telRep2" id="telRep2" class="form-control" placeholder="+41 79 123 45 67" value="<?php echo $_SESSION['postedForm']['telRep2'] != '' ? $_SESSION['postedForm']['telRep2'] : ''; ?>"/>
\ No newline at end of file
+<input type="text" name="telRep2" id="telRep2" class="form-control" placeholder="+41 79 123 45 67" value="<?php echo (isset($_SESSION['postedForm']['telRep2']) && $_SESSION['postedForm']['telRep2'] != '') ? $_SESSION['postedForm']['telRep2'] : ''; ?>"/>
\ No newline at end of file
diff --git a/canapEPFL/templates/formParts/new/scolarity.php b/canapEPFL/templates/formParts/new/scolarity.php
index abb251a..f61d458 100644
--- a/canapEPFL/templates/formParts/new/scolarity.php
+++ b/canapEPFL/templates/formParts/new/scolarity.php
@@ -7,27 +7,27 @@
   </tr>
   <tr>
     <td>
-      <input type="text" name="ecole1" placeholder="Ecole *" class="form-control" value="<?php echo $_SESSION['postedForm']['ecole1'] != '' ? $_SESSION['postedForm']['ecole1'] : ''; ?>" data-required/>
+      <input type="text" name="ecole1" placeholder="Ecole *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['ecole1']) && $_SESSION['postedForm']['ecole1'] != '') ? $_SESSION['postedForm']['ecole1'] : ''; ?>" data-required/>
     </td>
     <td>
-      <input type="text" name="lieuEcole1" placeholder="Lieu *" class="form-control" value="<?php echo $_SESSION['postedForm']['lieuEcole1'] != '' ? $_SESSION['postedForm']['lieuEcole1'] : ''; ?>" data-required/>
+      <input type="text" name="lieuEcole1" placeholder="Lieu *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['lieuEcole1']) && $_SESSION['postedForm']['lieuEcole1'] != '') ? $_SESSION['postedForm']['lieuEcole1'] : ''; ?>" data-required/>
     </td>
     <td>
-      <input type="text" name="niveauEcole1" placeholder="Niveau *" class="form-control" value="<?php echo $_SESSION['postedForm']['niveauEcole1'] != '' ? $_SESSION['postedForm']['niveauEcole1'] : ''; ?>" data-required/>
+      <input type="text" name="niveauEcole1" placeholder="Niveau *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['niveauEcole1']) && $_SESSION['postedForm']['niveauEcole1'] != '') ? $_SESSION['postedForm']['niveauEcole1'] : ''; ?>" data-required/>
     </td>
     <td>
-      <input type="text" name="anneesEcole1" placeholder="de-à (années) *" class="form-control" value="<?php echo $_SESSION['postedForm']['anneesEcole1'] != '' ? $_SESSION['postedForm']['anneesEcole1'] : ''; ?>" data-required/>
+      <input type="text" name="anneesEcole1" placeholder="de-à (années) *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['anneesEcole1']) && $_SESSION['postedForm']['anneesEcole1'] != '') ? $_SESSION['postedForm']['anneesEcole1'] : ''; ?>" data-required/>
     </td>
   </tr>
   <tr>
-    <td><input type="text" name="ecole2" placeholder="Ecole *" class="form-control" value="<?php echo $_SESSION['postedForm']['ecole2'] != '' ? $_SESSION['postedForm']['ecole2'] : ''; ?>" data-required/></td>
-    <td><input type="text" name="lieuEcole2" placeholder="Lieu *" class="form-control" value="<?php echo $_SESSION['postedForm']['lieuEcole2'] != '' ? $_SESSION['postedForm']['lieuEcole2'] : ''; ?>" data-required/></td>
-    <td><input type="text" name="niveauEcole2" placeholder="Niveau *" class="form-control" value="<?php echo $_SESSION['postedForm']['niveauEcole2'] != '' ? $_SESSION['postedForm']['niveauEcole2'] : ''; ?>" data-required/></td>
-    <td><input type="text" name="anneesEcole2" placeholder="de-à (années) *" class="form-control" value="<?php echo $_SESSION['postedForm']['anneesEcole2'] != '' ? $_SESSION['postedForm']['anneesEcole2'] : ''; ?>" data-required/></td>
+    <td><input type="text" name="ecole2" placeholder="Ecole *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['ecole2']) && $_SESSION['postedForm']['ecole2'] != '') ? $_SESSION['postedForm']['ecole2'] : ''; ?>" data-required/></td>
+    <td><input type="text" name="lieuEcole2" placeholder="Lieu *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['lieuEcole2']) && $_SESSION['postedForm']['lieuEcole2'] != '') ? $_SESSION['postedForm']['lieuEcole2'] : ''; ?>" data-required/></td>
+    <td><input type="text" name="niveauEcole2" placeholder="Niveau *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['niveauEcole2']) && $_SESSION['postedForm']['niveauEcole2'] != '') ? $_SESSION['postedForm']['niveauEcole2'] : ''; ?>" data-required/></td>
+    <td><input type="text" name="anneesEcole2" placeholder="de-à (années) *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['anneesEcole2']) && $_SESSION['postedForm']['anneesEcole2'] != '') ? $_SESSION['postedForm']['anneesEcole2'] : ''; ?>" data-required/></td>
   </tr>
   <?php
-    for($i = 3; $i < 6; $i++){
-      if($_SESSION['postedForm']['ecole'.$i]){
+    for ($i = 3; $i < 6; $i++){
+      if (isset($_SESSION['postedForm']['ecole'.$i]) && $_SESSION['postedForm']['ecole'.$i]) {
   ?>
   <tr>
     <td><input type="text" class="form-control" name="ecole<?php echo $i ?>" placeholder="Ecole" value="<?php echo $_SESSION['postedForm']['ecole'.$i] ?>"/></td>
@@ -41,6 +41,6 @@
 
 <div class="form-group mt-3">
   <label for="anneeFin">Année de fin de scolarité*</label>
-  <input type="text" name="anneeFin" id="anneeFin" class="form-control" placeholder="Année de fin de scolarité" value="<?php echo $_SESSION['postedForm']['anneeFin'] != '' ? $_SESSION['postedForm']['anneeFin'] : ''; ?>" maxlength="4" data-required/>
+  <input type="text" name="anneeFin" id="anneeFin" class="form-control" placeholder="Année de fin de scolarité" value="<?php echo (isset($_SESSION['postedForm']['anneeFin']) && $_SESSION['postedForm']['anneeFin'] != '') ? $_SESSION['postedForm']['anneeFin'] : ''; ?>" maxlength="4" data-required/>
   <small id="anneeFinError" class="error form-text text-muted"></small>
 </div>
\ No newline at end of file
diff --git a/canapEPFL/templates/formParts/new/trainings.php b/canapEPFL/templates/formParts/new/trainings.php
index 7841882..1ccaa19 100644
--- a/canapEPFL/templates/formParts/new/trainings.php
+++ b/canapEPFL/templates/formParts/new/trainings.php
@@ -5,19 +5,19 @@
   </tr>
   <tr>
     <td>
-      <input type="text" name="activiteStage1" class="form-control" placeholder="Métier" value="<?php echo $_SESSION['postedForm']['activiteStage1'] != '' ? $_SESSION['postedForm']['activiteStage1'] : ''; ?>">
+      <input type="text" name="activiteStage1" class="form-control" placeholder="Métier" value="<?php echo (isset($_SESSION['postedForm']['activiteStage1']) && $_SESSION['postedForm']['activiteStage1'] != '') ? $_SESSION['postedForm']['activiteStage1'] : ''; ?>">
     </td>
     <td>
-      <input type="text" name="entrepriseStage1" class="form-control" placeholder="Entreprise" value="<?php echo $_SESSION['postedForm']['entrepriseStage1'] != '' ? $_SESSION['postedForm']['entrepriseStage1'] : ''; ?>">
+      <input type="text" name="entrepriseStage1" class="form-control" placeholder="Entreprise" value="<?php echo (isset($_SESSION['postedForm']['entrepriseStage1']) && $_SESSION['postedForm']['entrepriseStage1'] != '') ? $_SESSION['postedForm']['entrepriseStage1'] : ''; ?>">
     </td>
   </tr>
   <tr>
-    <td><input type="text" name="activiteStage2" class="form-control" placeholder="Métier" value="<?php echo $_SESSION['postedForm']['activiteStage2'] != '' ? $_SESSION['postedForm']['activiteStage2'] : ''; ?>"></td>
-    <td><input type="text" name="entrepriseStage2" class="form-control" placeholder="Entreprise" value="<?php echo $_SESSION['postedForm']['entrepriseStage2'] != '' ? $_SESSION['postedForm']['entrepriseStage2'] : ''; ?>"></td>
+    <td><input type="text" name="activiteStage2" class="form-control" placeholder="Métier" value="<?php echo (isset($_SESSION['postedForm']['activiteStage2']) && $_SESSION['postedForm']['activiteStage2'] != '') ? $_SESSION['postedForm']['activiteStage2'] : ''; ?>"></td>
+    <td><input type="text" name="entrepriseStage2" class="form-control" placeholder="Entreprise" value="<?php echo (isset($_SESSION['postedForm']['entrepriseStage2']) && $_SESSION['postedForm']['entrepriseStage2'] != '') ? $_SESSION['postedForm']['entrepriseStage2'] : ''; ?>"></td>
   </tr>
   <?php
-  for($i = 2; $i < 4; $i++){
-    if($_SESSION['postedForm']['activiteStage'.$i]){
+  for ($i = 2; $i < 4; $i++) {
+    if (isset($_SESSION['postedForm']['activiteStage'.$i]) && $_SESSION['postedForm']['activiteStage'.$i]) {
   ?>
   <tr>
     <td><input type="text" class="form-control" name="activiteStage<?php echo $i ?>" placeholder="Métier" value="<?php echo $_SESSION['postedForm']['activiteStage'.$i] ?>"/></td>
-- 
GitLab