From dcc84361759e64a0da25ae5ad5db3afa1f1d3178 Mon Sep 17 00:00:00 2001
From: nicrausaz <n.crausaz99@gmail.com>
Date: Thu, 28 Feb 2019 09:28:08 +0100
Subject: [PATCH] templatize the form

---
 canapEPFL/form.php                            | 455 +++---------------
 canapEPFL/script.js                           |  87 ++--
 .../formParts/edit/alreadyapplicant.php       |   0
 .../templates/formParts/edit/annexes.php      |   0
 .../templates/formParts/edit/jobselection.php |   0
 .../templates/formParts/edit/maturity.php     |   0
 .../templates/formParts/edit/personnal.php    |   0
 .../formParts/edit/proactivities.php          |   0
 .../templates/formParts/edit/responsibles.php |   0
 .../templates/formParts/edit/scolarity.php    |   0
 .../templates/formParts/edit/trainings.php    |   0
 .../formParts/new/alreadyapplicant.php        |  16 +
 canapEPFL/templates/formParts/new/annexes.php |  89 ++++
 .../templates/formParts/new/jobselection.php  |  36 ++
 .../templates/formParts/new/maturity.php      |  14 +
 .../templates/formParts/new/personnal.php     |  69 +++
 .../templates/formParts/new/proactivities.php |  32 ++
 .../templates/formParts/new/responsibles.php  |  46 ++
 .../templates/formParts/new/scolarity.php     |  44 ++
 .../templates/formParts/new/trainings.php     |  26 +
 20 files changed, 471 insertions(+), 443 deletions(-)
 create mode 100644 canapEPFL/templates/formParts/edit/alreadyapplicant.php
 create mode 100644 canapEPFL/templates/formParts/edit/annexes.php
 create mode 100644 canapEPFL/templates/formParts/edit/jobselection.php
 create mode 100644 canapEPFL/templates/formParts/edit/maturity.php
 create mode 100644 canapEPFL/templates/formParts/edit/personnal.php
 create mode 100644 canapEPFL/templates/formParts/edit/proactivities.php
 create mode 100644 canapEPFL/templates/formParts/edit/responsibles.php
 create mode 100644 canapEPFL/templates/formParts/edit/scolarity.php
 create mode 100644 canapEPFL/templates/formParts/edit/trainings.php
 create mode 100644 canapEPFL/templates/formParts/new/alreadyapplicant.php
 create mode 100644 canapEPFL/templates/formParts/new/annexes.php
 create mode 100644 canapEPFL/templates/formParts/new/jobselection.php
 create mode 100644 canapEPFL/templates/formParts/new/maturity.php
 create mode 100644 canapEPFL/templates/formParts/new/personnal.php
 create mode 100644 canapEPFL/templates/formParts/new/proactivities.php
 create mode 100644 canapEPFL/templates/formParts/new/responsibles.php
 create mode 100644 canapEPFL/templates/formParts/new/scolarity.php
 create mode 100644 canapEPFL/templates/formParts/new/trainings.php

diff --git a/canapEPFL/form.php b/canapEPFL/form.php
index 45bf7da..a9b9c9f 100644
--- a/canapEPFL/form.php
+++ b/canapEPFL/form.php
@@ -19,7 +19,16 @@
         <?php include('templates/head.php'); ?>
       </head>
     <body>
-    <?php include('templates/header.php') ?>
+    <?php
+      include('templates/header.php');
+      if (isset($_GET['edit'])) {
+        echo "editing applicant" . $_SESSION['current_post']['applicant_id'];
+        $current_post = $_SESSION['current_post'];
+        echo "<pre>";
+        print_r($current_post);
+        echo "</pre>";
+      }
+    ?>
     <main id="main" role="main" class="content container-grid">
       <h3 class="mb-5">Candidature pour un apprentissage</h3>
       <small class="mb-3">Les champs notés d'un * doivent être obligatoirement remplis.</small>
@@ -28,428 +37,74 @@
         <h3>1. Apprentissage</h3>
         <!-- Choix formation -->
         <div class="form-group">
-         <label>Je désire effectuer ma formation à:</label>
-          <div class="custom-control custom-radio">
-            <input type="radio" name="lieu" id="lieuLausanne" class="custom-control-input" value="Lausanne" <?php echo (!isset($_SESSION['postedForm']['lieu']) || $_SESSION['postedForm']['lieu'] == "Lausanne") ? "checked=\"checked\"" : ''; ?>>
-            <label class="custom-control-label" for="lieuLausanne">EPFL Lausanne</label>
-          </div>
-          <div class="custom-control custom-radio">
-            <input type="radio" name="lieu" id="lieuSion" class="custom-control-input" value="Sion" <?php echo ($_SESSION['postedForm']['lieu'] == "Sion") ? "checked=\"checked\"" : ''; ?>>
-            <label class="custom-control-label" for="lieuSion">EPFL Valais Sion</label>
-          </div>
+          <?php isset($_GET['edit']) ? include('templates/formParts/edit/jobselection.php') : include('templates/formParts/new/jobselection.php'); ?>
         </div>
-        <div class="form-group">
-         <label>Je suis intéressé par la formation de:</label>
-         <select name="job" id="jbLausanne" class="custom-select jobSelectors" data-required>
-            <option value="menu" selected disabled>Choisir une formation...</option>
-            <?php
-              foreach ($LISTJOB['Lausanne'] as $jobKey => $jobVal) {
-                if ($_SESSION['postedForm']['job'] == $jobKey) {
-                  echo "<option value='$jobKey' selected='selected'>$jobVal</option>";
-                } else {
-                  echo "<option value='$jobKey'>$jobVal</option>";
-                }
-              }
-            ?>
-          </select>
-          <select name="job" id="jbSion" class="custom-select jobSelectors" style="display: none;" data-required>
-            <option value="menu" selected disabled>Choisir une formation...</option>
-            <?php
-                foreach ($LISTJOB['Sion'] as $jobKey => $jobVal) {
-                  if ($_SESSION['postedForm']['job'] == $jobKey) {
-                    echo "<option value='$jobKey' selected='selected'>$jobVal</option>";
-                  } else {
-                    echo "<option value='$jobKey'>$jobVal</option>";
-                  }
-                }
-                ?>
-          </select>
-          </div>
-          <!-- / Choix formation -->
-          <div id="all" style="display: none;">
+        <!-- / Choix formation -->
+
+        <!-- div all -->
+        <div id="all" style="display: none;">
+
+          <!-- Infos filières informaticien & Maturité -->
             <div class="form-group">
-              <!-- Infos filières informaticien -->
-              <div id="infoOnly">
-                <?php include('templates/filieresinfos.php') ?>
-              </div>
-              <!-- / Infos filières informaticien -->
-              <!-- Maturité -->
-              <label>Je désire m'inscire en maturité professionnelle intégrée*:</label>
-              <div class="custom-control custom-radio">
-                <input type="radio" name="mpt" id="mpt1" class="custom-control-input" value="false" <?php echo (!isset($_SESSION['postedForm']['mpt']) || $_SESSION['postedForm']['mpt'] == "false") ? "checked=\"checked\"" : ''; ?>>
-                <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\"" : ''; ?>>
-                <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>
-              <!-- / Maturité -->
+              <?php isset($_GET['edit']) ? include('templates/formParts/edit/maturity.php') : include('templates/formParts/new/maturity.php'); ?>
             </div>
-            <hr>
+          <!-- / Infos filières informaticien & Maturité -->
+          <hr>
+
+          <!-- Infos perso -->
             <h3>2. Données</h3>
-            <!-- Info perso -->
             <h5>2.1 Données personnelles</h5>
             <div class="form-group">
-              <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>
-              </select>
-
-              <input type="text" name="guestSciper" class="form-control" placeholder="Prénom" value="<?php echo $guest_sciper;?>" readonly hidden />
-
-              <label for="nameApp">Nom *</label>
-              <input type="text" name="nameApp" id="nameApp" class="form-control" placeholder="Nom" value="<?php echo $name;?>" readonly />
-
-              <label for="surnameApp">Prénom *</label>
-              <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/>
-
-              <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/>
-
-              <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/>
-
-              <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/>
-
-              <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 />
-              <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 />
-
-              <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 />
-
-              <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" />
-
-              <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 />
-
-              <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 />
-
-              <div class="form-group">
-                <label>Connaissances linguistiques *</label>
-
-                <div class="custom-control custom-checkbox">
-                  <input type="checkbox" class="custom-control-input" value="fr" id="french" name="languesApp[]" <?php echo (is_int(array_search('fr', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>>
-                  <label class="custom-control-label" for="french">Français</label>
-                </div>
-                    <div class="custom-control custom-checkbox">
-                  <input type="checkbox" class="custom-control-input" value="de" id="german" name="languesApp[]" <?php echo (is_int(array_search('de', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>>
-                  <label class="custom-control-label" for="german">Allemand</label>
-                </div>
-                <div class="custom-control custom-checkbox">
-                  <input type="checkbox" class="custom-control-input" value="en" id="english" name="languesApp[]" <?php echo (is_int(array_search('en', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>>
-                  <label class="custom-control-label" for="english">Anglais</label>
-                </div>
-                <div class="custom-control custom-checkbox">
-                  <input type="checkbox" class="custom-control-input" value="others" id="other" name="languesApp[]" <?php echo (is_int(array_search('others', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>>
-                  <label class="custom-control-label" for="other">Autres</label>
-                </div>
-              </div>
-            </div>
-            <!-- / Infos perso -->
-          <!-- Représentants -->
-          <h5>2.2 Représentants légaux</h5>
-          <div class="form-group">
-            <label>Avez vous plus de 18 ans ?*:</label>
-            <div class="custom-control custom-radio">
-              <input type="radio" name="maj" id="maj1" class="custom-control-input" value="false" <?php echo (!isset($_SESSION['postedForm']['maj']) || $_SESSION['postedForm']['maj'] == "false") ? "checked=\"checked\"" : ''; ?>>
-              <label class="custom-control-label" for="maj1">Non</label>
+              <?php isset($_GET['edit']) ? include('templates/formParts/edit/personnal.php') : include('templates/formParts/new/personnal.php'); ?>
             </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\"" : ''; ?>>
-              <label class="custom-control-label" for="maj2">Oui</label>
-            </div>
-          </div>
-          <div class="form-group" id="representants">
-            <p>Représentant principal:*</p>
-            <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>
-            </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'] : ''; ?>"/>
-            <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'] : ''; ?>"/>
-            <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'] : ''; ?>"/>
-            <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'] : ''; ?>"/>
-            <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'] : ''; ?>"/>
+          <!-- / Infos perso -->
 
-            <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>
-            </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'] : ''; ?>"/>
-            <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'] : ''; ?>"/>
-            <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'] : ''; ?>"/>
-            <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'] : ''; ?>"/>
-            <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'] : ''; ?>"/>
-          </div>
           <!-- Représentants -->
+            <h5>2.2 Représentants légaux</h5>
+            <div class="form-group">
+              <?php isset($_GET['edit']) ? include('templates/formParts/edit/responsibles.php') : include('templates/formParts/new/responsibles.php'); ?>
+            </div>
+          <!-- / Représentants -->
           <hr>
-          <!-- Activités pro -->
-          <h3>3. Activités</h3>
-          <!-- Scolarité -->
-          <h5>3.1 Scolarité</h5>
-          <table id="scolaire">
-            <tr>
-              <td>
-                <label for="ecole1">Ecole</label>
-                <input type="text" name="ecole1" placeholder="Ecole *" class="form-control" value="<?php echo $_SESSION['postedForm']['ecole1'] != '' ? $_SESSION['postedForm']['ecole1'] : ''; ?>" data-required/>
-              </td>
-              <td>
-                <label for="lieuEcole1">Lieu</label>
-                <input type="text" name="lieuEcole1" placeholder="Lieu *" class="form-control" value="<?php echo $_SESSION['postedForm']['lieuEcole1'] != '' ? $_SESSION['postedForm']['lieuEcole1'] : ''; ?>" data-required/>
-              </td>
-              <td>
-                <label for="niveauEcole1">Niveau</label>
-                <input type="text" name="niveauEcole1" placeholder="Niveau *" class="form-control" value="<?php echo $_SESSION['postedForm']['niveauEcole1'] != '' ? $_SESSION['postedForm']['niveauEcole1'] : ''; ?>" data-required/>
-              </td>
-              <td>
-                <label for="anneesEcole1">Années</label>
-                <input type="text" name="anneesEcole1" placeholder="de-à (années) *" class="form-control" value="<?php echo $_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>
-            </tr>
-            <?php
-            for($i = 3; $i < 6; $i++){
-                if($_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>
-                <td><input type="text" class="form-control" name="lieuEcole<?php echo $i ?>" placeholder="Lieu" value="<?php echo $_SESSION['postedForm']['lieuEcole'.$i] ?>" ></td>
-                <td><input type="text" class="form-control" name="niveauEcole<?php echo $i ?>" placeholder="Niveau" value="<?php echo $_SESSION['postedForm']['niveauEcole'.$i] ?>"></td>
-                <td><input type="text" class="form-control" name="anneesEcole<?php echo $i ?>" placeholder="de-à (années)" value="<?php echo $_SESSION['postedForm']['anneesEcole'.$i] ?>"></td>
-            </tr>
-            <?php }} ?>
-          </table>
-          <button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addSch">Ajouter une ligne</button>
-
-          <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/>
-            <small id="anneeFinError" class="error form-text text-muted"></small>
-          </div>
-          <!-- / Scolarité -->
-          <!-- Formations -->
-          <h5>3.2 Activités professionnelles</h5>
-          <small>Formations / apprentissages après la scolarité.</small>
 
-          <table id="activites">
-            <tr>
-                <td>
-                  <label for="employeurPro1">Employeur</label>
-                  <input type="text" class="form-control" name="employeurPro1" placeholder="Employeur" value="<?php echo $_SESSION['postedForm']['employeurPro1'] != '' ? $_SESSION['postedForm']['employeurPro1'] : ''; ?>"/>
-                </td>
-                <td>
-                  <label for="lieuPro1">Lieu</label>
-                  <input type="text" class="form-control" name="lieuPro1" placeholder="Lieu" value="<?php echo $_SESSION['postedForm']['lieuPro1'] != '' ? $_SESSION['postedForm']['lieuPro1'] : ''; ?>"/>
-                </td>
-                <td>
-                  <label for="activitePro1">Activité</label>
-                  <input type="text" class="form-control" name="activitePro1" placeholder="Activité" value="<?php echo $_SESSION['postedForm']['activitePro1'] != '' ? $_SESSION['postedForm']['activitePro1'] : ''; ?>"/>
-                </td>
-                <td>
-                  <label for="anneesPro1">Années</label>
-                  <input type="text" class="form-control" name="anneesPro1" placeholder="de-à (années)" value="<?php echo $_SESSION['postedForm']['anneesPro1'] != '' ? $_SESSION['postedForm']['anneesPro1'] : ''; ?>"/>
-                </td>
-            </tr>
-            <?php
-            for ($i = 2; $i < 4; $i++) {
-              if ($_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>
-                <td><input type="text" class="form-control" name="lieuPro<?php echo $i ?>" placeholder="Lieu" value="<?php echo $_SESSION['postedForm']['lieuPro'.$i] ?>" ></td>
-                <td><input type="text" class="form-control" name="activitePro<?php echo $i ?>" placeholder="Activité" value="<?php echo $_SESSION['postedForm']['activitePro'.$i] ?>"></td>
-                <td><input type="text" class="form-control" name="anneesPro<?php echo $i ?>" placeholder="de-à (années)" value="<?php echo $_SESSION['postedForm']['anneesPro'.$i] ?>"></td>
-            </tr>
-            <?php }} ?>
-            </table>
-            <button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addPro">Ajouter une ligne</button>
+          <!-- Activités -->
+            <h3>3. Activités</h3>
+            <!-- Scolarité -->
+              <h5>3.1 Scolarité</h5>
+              <?php isset($_GET['edit']) ? include('templates/formParts/edit/scolarity.php') : include('templates/formParts/new/scolarity.php'); ?>
+            <!-- / Scolarité -->
+            <!-- Formations -->
+              <h5>3.2 Activités professionnelles</h5>
+              <small>Formations / apprentissages après la scolarité.</small>
+              <?php isset($_GET['edit']) ? include('templates/formParts/edit/proactivities.php') : include('templates/formParts/new/proactivities.php'); ?>
             <!-- / Formations -->
             <!-- Stages -->
-            <h5 class="mt-3">3.3 Stages</h5>
-            <table id="stages">
-              <tr>
-                <td>
-                  <label for="activiteStage1">Métier</label>
-                  <input type="text" name="activiteStage1" class="form-control" placeholder="Métier" value="<?php echo $_SESSION['postedForm']['activiteStage1'] != '' ? $_SESSION['postedForm']['activiteStage1'] : ''; ?>">
-                </td>
-                <td>
-                  <label for="entrepriseStage1">Entreprise</label>
-                  <input type="text" name="entrepriseStage1" class="form-control" placeholder="Entreprise" value="<?php echo $_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>
-              </tr>
-              <?php
-              for($i = 2; $i < 4; $i++){
-                if($_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>
-                <td><input type="text" class="form-control" name="entrepriseStage<?php echo $i ?>" placeholder="Entreprise" value="<?php echo $_SESSION['postedForm']['entrepriseStage'.$i] ?>" ></td>
-              </tr>
-              <?php }} ?>
-          </table>
-          <button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addStage">Ajouter une ligne</button>
-
-          <div class="form-group mt-3">
-            <label>Avez-vous déjà été candidat à l'EPFL ?</label>
-            <div class="custom-control custom-radio">
-              <input type="radio" name="dejaCand" id="dejaCand1" class="custom-control-input" value="false" <?php echo (!isset($_SESSION['postedForm']['dejaCand']) || $_SESSION['postedForm']['dejaCand'] == "false") ? "checked=\"checked\"" : ''; ?>>
-              <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\"" : ''; ?>>
-              <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"/>
-            <small id="dejaCandError" class="form-text text-muted error"></small>
-          </div>
-          <!-- / Stages -->
-          <!-- / Activités pro -->
+              <h5 class="mt-3">3.3 Stages</h5>
+              <?php isset($_GET['edit']) ? include('templates/formParts/edit/trainings.php') : include('templates/formParts/new/trainings.php'); ?>
+            <!-- / Stages -->
+          <!-- / Activités -->
+          <!-- Déjà candidat -->
+            <?php isset($_GET['edit']) ? include('templates/formParts/edit/alreadyapplicant.php') : include('templates/formParts/new/alreadyapplicant.php'); ?>
+          <!-- / Déjà candidat -->
           <hr>
+
           <!-- Annexes -->
           <h3>4. Annexes</h3>
           <small>Merci de joindre tous les fichiers demandés, en respectant les formats (si les formats ne sont pas respectés, les fichiers ne seront pas pris en compte).</small>
           <br>
           <small>Formats autorisés: <b>PDF, JPG, JPEG, PNG</b></small>
-          <!-- Annexes obligatoires -->
-          <div class="form-group mt-3" id="files">
-            <div class="form-group">
-              <label for="photo">Photo passeport <strong>couleur: *</strong></label>
-              <input type="file" name="photo" class="upload-input" id="photo" onchange="changeTitleFile(this)" data-required/>
-              <br>
-              <label for="photo" class="btn btn-secondary btn-sm icon-right">
-                Choisir...
-              </label>
-              <br>
-              <small class="error" class="form-text text-muted"></small>
-            </div>
-
-            <div class="form-group">
-              <label for="idCard">Copie carte d'indentité / passeport: *</label>
-              <input type="file" name="idCard" class="upload-input" id="idCard" onchange="changeTitleFile(this)" data-required/>
-              <br>
-              <label for="idCard" class="btn btn-secondary btn-sm icon-right">
-                Choisir...
-              </label>
-              <br>
-              <small class="error" class="form-text text-muted"></small>
-            </div>
-
-            <div class="form-group">
-              <label for="cv">Curriculum Vitae: *</label>
-              <input type="file" name="cv" class="upload-input" id="cv" onchange="changeTitleFile(this)" data-required/>
-              <br>
-              <label for="cv" class="btn btn-secondary btn-sm icon-right">
-                Choisir...
-              </label>
-              <br>
-              <small class="error" class="form-text text-muted"></small>
-            </div>
-
-            <div class="form-group">
-              <label for="lettre">Lettre de motivation: *</label>
-              <input type="file" name="lettre" class="upload-input" id="lettre" onchange="changeTitleFile(this)" data-required/>
-              <br>
-              <label for="lettre" class="btn btn-secondary btn-sm icon-right">
-                Choisir...
-              </label>
-              <br>
-              <small class="error" class="form-text text-muted"></small>
-            </div>
-            <!-- / Annexes obligatoires -->
-            <!-- Annexes spécifiques -->
-            <div class="form-group" id="polyOnly">
-              <label for="gimch">Attestation de tests d'aptitudes GIM-CH (polymécanicien):</label>
-              <input type="file" name="gimch" class="upload-input" id="gimch" onchange="changeTitleFile(this)"/>
-              <br>
-              <label for="gimch" class="btn btn-secondary btn-sm icon-right">
-                Choisir...
-              </label>
-              <br>
-              <small class="error" class="form-text text-muted"></small>
-            </div>
-
-            <div class="form-group" id="griTest">
-              <label for="griTestInput">Attestation de tests d'aptitudes GRI (informaticien):</label>
-              <input type="file" name="griTestInput" class="upload-input" id="griTestInput" onchange="changeTitleFile(this)"/>
-              <br>
-              <label for="griTestInput" class="btn btn-secondary btn-sm icon-right">
-                Choisir...
-              </label>
-              <br>
-              <small class="error" class="form-text text-muted"></small>
-            </div>
-            <!-- / Annexes spécifiques -->
-            <!-- Annexes supplémentaires -->
-            <div class="form-group">
-              <table id="newCertifZone">
-                <tr>
-                  <td>
-                    <label for="certifs1">Certificats, diplômes et bulletins de notes des derniers 3-4 semestres:</label>
-                    <input type="file" name="certifs1" class="upload-input" id="certifs1" onchange="changeTitleFile(this)"/>
-                    <br>
-                    <label for="certifs1" class="btn btn-secondary btn-sm icon-right">
-                      Choisir...
-                    </label>
-                    <br>
-                    <small class="error" class="form-text text-muted"></small>
-                  </td>
-                </tr>
-              </table>
-            </div>
-            <button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addInputFile">Ajouter une annexe</button>
-            <!-- / Annexes supplémentaires -->
-          </div>
+          <?php isset($_GET['edit']) ? include('templates/formParts/edit/annexes.php') : include('templates/formParts/new/annexes.php'); ?>
           <!-- / Annexes -->
+
+          <!-- Conditions -->
           <div class="form-group">
-          <div class="custom-control custom-checkbox" id="condDiv">
-            <input type="checkbox" class="custom-control-input" value="conditionsAcc" id="conditions" data-required/>
-            <label class="custom-control-label" for="conditions">Accepter les <a href="conditions.php" target="_blank"> conditions*</a></label>
+            <div class="custom-control custom-checkbox" id="condDiv">
+              <input type="checkbox" class="custom-control-input" value="conditionsAcc" id="conditions" data-required/>
+              <label class="custom-control-label" for="conditions">Accepter les <a href="conditions.php" target="_blank"> conditions*</a></label>
+            </div>
           </div>
+          <!-- / Conditions -->
 
-          </div>
           <button type="submit" class="btn btn-primary btn-block" type="submit">Terminer</button>
         </div>
         <!-- / div all -->
diff --git a/canapEPFL/script.js b/canapEPFL/script.js
index 8ccfcba..c05d6f5 100644
--- a/canapEPFL/script.js
+++ b/canapEPFL/script.js
@@ -262,58 +262,59 @@ function initEdits() {
         }
     });
 
-    $.datepicker.setDefaults($.datepicker.regional["fr"]);
-    $("#applicant_birthdate").datepicker({ minDate: '-60y', maxDate: '-13y', dateFormat: "dd/mm/yy" });
+    // $.datepicker.setDefaults($.datepicker.regional["fr"]);
+    // $("#applicant_birthdate").datepicker({ minDate: '-60y', maxDate: '-13y', dateFormat: "dd/mm/yy" });
 
     $('#editPost').click(function () {
-        $('#editPost').prop('disabled', true);
-        $('#confirmEditPost').show();
-        $('#cancelEditPost').show();
-
-        // set inputs
-        $('.postulationDataSpans').each(function () {
-            $(this).hide();
-        })
-        $('.editPostInputs').each(function () {
-            $(this).show();
-        })
-
-        if ($("#applicant_already_applicant_year").val() == '') {
-            $("#applicant_already_applicant_year").hide();
-        }
+        document.location.href = "form.php?edit";
+        // $('#editPost').prop('disabled', true);
+        // $('#confirmEditPost').show();
+        // $('#cancelEditPost').show();
+
+        // // set inputs
+        // $('.postulationDataSpans').each(function () {
+        //     $(this).hide();
+        // })
+        // $('.editPostInputs').each(function () {
+        //     $(this).show();
+        // })
+
+        // if ($("#applicant_already_applicant_year").val() == '') {
+        //     $("#applicant_already_applicant_year").hide();
+        // }
     });
     // $('#confirmEditPost').click(function () {
 
     // });
-    $('#cancelEditPost').click(function () {
-        $('#editPost').prop('disabled', false);
-        $('#confirmEditPost').hide();
-        $('#cancelEditPost').hide();
-
-        $('.postulationDataSpans').each(function () {
-            $(this).show();
-        })
-
-        $('.editPostInputs').each(function () {
-            $(this).hide();
-        })
-    });
+    // $('#cancelEditPost').click(function () {
+    //     $('#editPost').prop('disabled', false);
+    //     $('#confirmEditPost').hide();
+    //     $('#cancelEditPost').hide();
+
+    //     $('.postulationDataSpans').each(function () {
+    //         $(this).show();
+    //     })
+
+    //     $('.editPostInputs').each(function () {
+    //         $(this).hide();
+    //     })
+    // });
 
-    // deja cand switch
-    $("#applicant_already_applicant1").click(function () {
-        $("#applicant_already_applicant_year").val(null);
-        $("#applicant_already_applicant_year").hide();
-    })
-    $("#applicant_already_applicant2").click(function () {
-        $("#applicant_already_applicant_year").show();
-    })
+    // // deja cand switch
+    // $("#applicant_already_applicant1").click(function () {
+    //     $("#applicant_already_applicant_year").val(null);
+    //     $("#applicant_already_applicant_year").hide();
+    // })
+    // $("#applicant_already_applicant2").click(function () {
+    //     $("#applicant_already_applicant_year").show();
+    // })
 
     // hide default
-    $('#confirmEditPost').hide();
-    $('#cancelEditPost').hide();
-    $('.editPostInputs').each(function () {
-        $(this).hide();
-    })
+    // $('#confirmEditPost').hide();
+    // $('#cancelEditPost').hide();
+    // $('.editPostInputs').each(function () {
+    //     $(this).hide();
+    // })
 }
 
 function checkRequired() {
diff --git a/canapEPFL/templates/formParts/edit/alreadyapplicant.php b/canapEPFL/templates/formParts/edit/alreadyapplicant.php
new file mode 100644
index 0000000..e69de29
diff --git a/canapEPFL/templates/formParts/edit/annexes.php b/canapEPFL/templates/formParts/edit/annexes.php
new file mode 100644
index 0000000..e69de29
diff --git a/canapEPFL/templates/formParts/edit/jobselection.php b/canapEPFL/templates/formParts/edit/jobselection.php
new file mode 100644
index 0000000..e69de29
diff --git a/canapEPFL/templates/formParts/edit/maturity.php b/canapEPFL/templates/formParts/edit/maturity.php
new file mode 100644
index 0000000..e69de29
diff --git a/canapEPFL/templates/formParts/edit/personnal.php b/canapEPFL/templates/formParts/edit/personnal.php
new file mode 100644
index 0000000..e69de29
diff --git a/canapEPFL/templates/formParts/edit/proactivities.php b/canapEPFL/templates/formParts/edit/proactivities.php
new file mode 100644
index 0000000..e69de29
diff --git a/canapEPFL/templates/formParts/edit/responsibles.php b/canapEPFL/templates/formParts/edit/responsibles.php
new file mode 100644
index 0000000..e69de29
diff --git a/canapEPFL/templates/formParts/edit/scolarity.php b/canapEPFL/templates/formParts/edit/scolarity.php
new file mode 100644
index 0000000..e69de29
diff --git a/canapEPFL/templates/formParts/edit/trainings.php b/canapEPFL/templates/formParts/edit/trainings.php
new file mode 100644
index 0000000..e69de29
diff --git a/canapEPFL/templates/formParts/new/alreadyapplicant.php b/canapEPFL/templates/formParts/new/alreadyapplicant.php
new file mode 100644
index 0000000..2adac39
--- /dev/null
+++ b/canapEPFL/templates/formParts/new/alreadyapplicant.php
@@ -0,0 +1,16 @@
+<div class="form-group mt-3">
+  <label>Avez-vous déjà été candidat à l'EPFL ?</label>
+  <div class="custom-control custom-radio">
+    <input type="radio" name="dejaCand" id="dejaCand1" class="custom-control-input" value="false" <?php echo (!isset($_SESSION['postedForm']['dejaCand']) || $_SESSION['postedForm']['dejaCand'] == "false") ? "checked=\"checked\"" : ''; ?>>
+    <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\"" : ''; ?>>
+    <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"/>
+  <small id="dejaCandError" class="form-text text-muted error"></small>
+</div>
\ No newline at end of file
diff --git a/canapEPFL/templates/formParts/new/annexes.php b/canapEPFL/templates/formParts/new/annexes.php
new file mode 100644
index 0000000..6d15b4a
--- /dev/null
+++ b/canapEPFL/templates/formParts/new/annexes.php
@@ -0,0 +1,89 @@
+<!-- Annexes obligatoires -->
+<div class="form-group mt-3" id="files">
+  <div class="form-group">
+    <label for="photo">Photo passeport <strong>couleur: *</strong></label>
+    <input type="file" name="photo" class="upload-input" id="photo" onchange="changeTitleFile(this)" data-required/>
+    <br>
+    <label for="photo" class="btn btn-secondary btn-sm icon-right">
+      Choisir...
+    </label>
+    <br>
+    <small class="error" class="form-text text-muted"></small>
+  </div>
+
+  <div class="form-group">
+    <label for="idCard">Copie carte d'indentité / passeport: *</label>
+    <input type="file" name="idCard" class="upload-input" id="idCard" onchange="changeTitleFile(this)" data-required/>
+    <br>
+    <label for="idCard" class="btn btn-secondary btn-sm icon-right">
+      Choisir...
+    </label>
+    <br>
+    <small class="error" class="form-text text-muted"></small>
+  </div>
+
+  <div class="form-group">
+    <label for="cv">Curriculum Vitae: *</label>
+    <input type="file" name="cv" class="upload-input" id="cv" onchange="changeTitleFile(this)" data-required/>
+    <br>
+    <label for="cv" class="btn btn-secondary btn-sm icon-right">
+      Choisir...
+    </label>
+    <br>
+    <small class="error" class="form-text text-muted"></small>
+  </div>
+
+  <div class="form-group">
+    <label for="lettre">Lettre de motivation: *</label>
+    <input type="file" name="lettre" class="upload-input" id="lettre" onchange="changeTitleFile(this)" data-required/>
+    <br>
+    <label for="lettre" class="btn btn-secondary btn-sm icon-right">
+      Choisir...
+    </label>
+    <br>
+    <small class="error" class="form-text text-muted"></small>
+  </div>
+  <!-- / Annexes obligatoires -->
+  <!-- Annexes spécifiques -->
+  <div class="form-group" id="polyOnly">
+    <label for="gimch">Attestation de tests d'aptitudes GIM-CH (polymécanicien):</label>
+    <input type="file" name="gimch" class="upload-input" id="gimch" onchange="changeTitleFile(this)"/>
+    <br>
+    <label for="gimch" class="btn btn-secondary btn-sm icon-right">
+      Choisir...
+    </label>
+    <br>
+    <small class="error" class="form-text text-muted"></small>
+  </div>
+
+  <div class="form-group" id="griTest">
+    <label for="griTestInput">Attestation de tests d'aptitudes GRI (informaticien):</label>
+    <input type="file" name="griTestInput" class="upload-input" id="griTestInput" onchange="changeTitleFile(this)"/>
+    <br>
+    <label for="griTestInput" class="btn btn-secondary btn-sm icon-right">
+      Choisir...
+    </label>
+    <br>
+    <small class="error" class="form-text text-muted"></small>
+  </div>
+  <!-- / Annexes spécifiques -->
+  <!-- Annexes supplémentaires -->
+  <div class="form-group">
+    <table id="newCertifZone">
+      <tr>
+        <td>
+          <label for="certifs1">Certificats, diplômes et bulletins de notes des derniers 3-4 semestres:</label>
+          <input type="file" name="certifs1" class="upload-input" id="certifs1" onchange="changeTitleFile(this)"/>
+          <br>
+          <label for="certifs1" class="btn btn-secondary btn-sm icon-right">
+            Choisir...
+          </label>
+          <br>
+          <small class="error" class="form-text text-muted"></small>
+        </td>
+      </tr>
+    </table>
+  </div>
+  <button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addInputFile">Ajouter une annexe</button>
+  <!-- region/ Annexes supplémentaires -->
+</div>
\ No newline at end of file
diff --git a/canapEPFL/templates/formParts/new/jobselection.php b/canapEPFL/templates/formParts/new/jobselection.php
new file mode 100644
index 0000000..cc43ff2
--- /dev/null
+++ b/canapEPFL/templates/formParts/new/jobselection.php
@@ -0,0 +1,36 @@
+<label>Je désire effectuer ma formation à:</label>
+<div class="custom-control custom-radio">
+  <input type="radio" name="lieu" id="lieuLausanne" class="custom-control-input" value="Lausanne" <?php echo (!isset($_SESSION['postedForm']['lieu']) || $_SESSION['postedForm']['lieu'] == "Lausanne") ? "checked=\"checked\"" : ''; ?>>
+  <label class="custom-control-label" for="lieuLausanne">EPFL Lausanne</label>
+</div>
+<div class="custom-control custom-radio">
+  <input type="radio" name="lieu" id="lieuSion" class="custom-control-input" value="Sion" <?php echo ($_SESSION['postedForm']['lieu'] == "Sion") ? "checked=\"checked\"" : ''; ?>>
+  <label class="custom-control-label" for="lieuSion">EPFL Valais Sion</label>
+</div>
+</div>
+<div class="form-group">
+<label>Je suis intéressé par la formation de:</label>
+<select name="job" id="jbLausanne" class="custom-select jobSelectors" data-required>
+  <option value="menu" selected disabled>Choisir une formation...</option>
+  <?php
+    foreach ($LISTJOB['Lausanne'] as $jobKey => $jobVal) {
+      if ($_SESSION['postedForm']['job'] == $jobKey) {
+        echo "<option value='$jobKey' selected='selected'>$jobVal</option>";
+      } else {
+        echo "<option value='$jobKey'>$jobVal</option>";
+      }
+    }
+  ?>
+</select>
+<select name="job" id="jbSion" class="custom-select jobSelectors" style="display: none;" data-required>
+  <option value="menu" selected disabled>Choisir une formation...</option>
+  <?php
+      foreach ($LISTJOB['Sion'] as $jobKey => $jobVal) {
+        if ($_SESSION['postedForm']['job'] == $jobKey) {
+          echo "<option value='$jobKey' selected='selected'>$jobVal</option>";
+        } else {
+          echo "<option value='$jobKey'>$jobVal</option>";
+        }
+      }
+      ?>
+</select>
\ No newline at end of file
diff --git a/canapEPFL/templates/formParts/new/maturity.php b/canapEPFL/templates/formParts/new/maturity.php
new file mode 100644
index 0000000..2c4d86c
--- /dev/null
+++ b/canapEPFL/templates/formParts/new/maturity.php
@@ -0,0 +1,14 @@
+<div id="infoOnly">
+  <?php include('templates/filieresinfos.php') ?>
+</div>
+
+<label>Je désire m'inscire en maturité professionnelle intégrée*:</label>
+<div class="custom-control custom-radio">
+  <input type="radio" name="mpt" id="mpt1" class="custom-control-input" value="false" <?php echo (!isset($_SESSION['postedForm']['mpt']) || $_SESSION['postedForm']['mpt'] == "false") ? "checked=\"checked\"" : ''; ?>>
+  <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\"" : ''; ?>>
+  <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
new file mode 100644
index 0000000..82fa053
--- /dev/null
+++ b/canapEPFL/templates/formParts/new/personnal.php
@@ -0,0 +1,69 @@
+<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>
+</select>
+
+<input type="text" name="guestSciper" class="form-control" placeholder="Prénom" value="<?php echo $guest_sciper;?>" readonly hidden />
+
+<label for="nameApp">Nom *</label>
+<input type="text" name="nameApp" id="nameApp" class="form-control" placeholder="Nom" value="<?php echo $name;?>" readonly />
+
+<label for="surnameApp">Prénom *</label>
+<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/>
+
+<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/>
+
+<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/>
+
+<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/>
+
+<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 />
+<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 />
+
+<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 />
+
+<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" />
+
+<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 />
+
+<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 />
+
+<div class="form-group">
+  <label>Connaissances linguistiques *</label>
+
+  <div class="custom-control custom-checkbox">
+    <input type="checkbox" class="custom-control-input" value="fr" id="french" name="languesApp[]" <?php echo (is_int(array_search('fr', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>>
+    <label class="custom-control-label" for="french">Français</label>
+  </div>
+      <div class="custom-control custom-checkbox">
+    <input type="checkbox" class="custom-control-input" value="de" id="german" name="languesApp[]" <?php echo (is_int(array_search('de', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>>
+    <label class="custom-control-label" for="german">Allemand</label>
+  </div>
+  <div class="custom-control custom-checkbox">
+    <input type="checkbox" class="custom-control-input" value="en" id="english" name="languesApp[]" <?php echo (is_int(array_search('en', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>>
+    <label class="custom-control-label" for="english">Anglais</label>
+  </div>
+  <div class="custom-control custom-checkbox">
+    <input type="checkbox" class="custom-control-input" value="others" id="other" name="languesApp[]" <?php echo (is_int(array_search('others', $_SESSION['postedForm']['languesApp']))) ? '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
new file mode 100644
index 0000000..ce91735
--- /dev/null
+++ b/canapEPFL/templates/formParts/new/proactivities.php
@@ -0,0 +1,32 @@
+<table id="activites">
+  <tr>
+    <td>
+      <label for="employeurPro1">Employeur</label>
+      <input type="text" class="form-control" name="employeurPro1" placeholder="Employeur" value="<?php echo $_SESSION['postedForm']['employeurPro1'] != '' ? $_SESSION['postedForm']['employeurPro1'] : ''; ?>"/>
+    </td>
+    <td>
+      <label for="lieuPro1">Lieu</label>
+      <input type="text" class="form-control" name="lieuPro1" placeholder="Lieu" value="<?php echo $_SESSION['postedForm']['lieuPro1'] != '' ? $_SESSION['postedForm']['lieuPro1'] : ''; ?>"/>
+    </td>
+    <td>
+      <label for="activitePro1">Activité</label>
+      <input type="text" class="form-control" name="activitePro1" placeholder="Activité" value="<?php echo $_SESSION['postedForm']['activitePro1'] != '' ? $_SESSION['postedForm']['activitePro1'] : ''; ?>"/>
+    </td>
+    <td>
+      <label for="anneesPro1">Années</label>
+      <input type="text" class="form-control" name="anneesPro1" placeholder="de-à (années)" value="<?php echo $_SESSION['postedForm']['anneesPro1'] != '' ? $_SESSION['postedForm']['anneesPro1'] : ''; ?>"/>
+    </td>
+  </tr>
+  <?php
+    for ($i = 2; $i < 4; $i++) {
+      if ($_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>
+    <td><input type="text" class="form-control" name="lieuPro<?php echo $i ?>" placeholder="Lieu" value="<?php echo $_SESSION['postedForm']['lieuPro'.$i] ?>" ></td>
+    <td><input type="text" class="form-control" name="activitePro<?php echo $i ?>" placeholder="Activité" value="<?php echo $_SESSION['postedForm']['activitePro'.$i] ?>"></td>
+    <td><input type="text" class="form-control" name="anneesPro<?php echo $i ?>" placeholder="de-à (années)" value="<?php echo $_SESSION['postedForm']['anneesPro'.$i] ?>"></td>
+  </tr>
+  <?php }} ?>
+</table>
+<button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addPro">Ajouter une ligne</button>
\ No newline at end of file
diff --git a/canapEPFL/templates/formParts/new/responsibles.php b/canapEPFL/templates/formParts/new/responsibles.php
new file mode 100644
index 0000000..aabeaf8
--- /dev/null
+++ b/canapEPFL/templates/formParts/new/responsibles.php
@@ -0,0 +1,46 @@
+<label>Avez vous plus de 18 ans ?*:</label>
+<div class="custom-control custom-radio">
+  <input type="radio" name="maj" id="maj1" class="custom-control-input" value="false" <?php echo (!isset($_SESSION['postedForm']['maj']) || $_SESSION['postedForm']['maj'] == "false") ? "checked=\"checked\"" : ''; ?>>
+  <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\"" : ''; ?>>
+  <label class="custom-control-label" for="maj2">Oui</label>
+</div>
+</div>
+<div class="form-group" id="representants">
+<p>Représentant principal:*</p>
+<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>
+</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'] : ''; ?>"/>
+<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'] : ''; ?>"/>
+<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'] : ''; ?>"/>
+<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'] : ''; ?>"/>
+<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'] : ''; ?>"/>
+
+<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>
+</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'] : ''; ?>"/>
+<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'] : ''; ?>"/>
+<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'] : ''; ?>"/>
+<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'] : ''; ?>"/>
+<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
diff --git a/canapEPFL/templates/formParts/new/scolarity.php b/canapEPFL/templates/formParts/new/scolarity.php
new file mode 100644
index 0000000..edad607
--- /dev/null
+++ b/canapEPFL/templates/formParts/new/scolarity.php
@@ -0,0 +1,44 @@
+<table id="scolaire">
+  <tr>
+    <td>
+      <label for="ecole1">Ecole</label>
+      <input type="text" name="ecole1" placeholder="Ecole *" class="form-control" value="<?php echo $_SESSION['postedForm']['ecole1'] != '' ? $_SESSION['postedForm']['ecole1'] : ''; ?>" data-required/>
+    </td>
+    <td>
+      <label for="lieuEcole1">Lieu</label>
+      <input type="text" name="lieuEcole1" placeholder="Lieu *" class="form-control" value="<?php echo $_SESSION['postedForm']['lieuEcole1'] != '' ? $_SESSION['postedForm']['lieuEcole1'] : ''; ?>" data-required/>
+    </td>
+    <td>
+      <label for="niveauEcole1">Niveau</label>
+      <input type="text" name="niveauEcole1" placeholder="Niveau *" class="form-control" value="<?php echo $_SESSION['postedForm']['niveauEcole1'] != '' ? $_SESSION['postedForm']['niveauEcole1'] : ''; ?>" data-required/>
+    </td>
+    <td>
+      <label for="anneesEcole1">Années</label>
+      <input type="text" name="anneesEcole1" placeholder="de-à (années) *" class="form-control" value="<?php echo $_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>
+  </tr>
+  <?php
+    for($i = 3; $i < 6; $i++){
+      if($_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>
+    <td><input type="text" class="form-control" name="lieuEcole<?php echo $i ?>" placeholder="Lieu" value="<?php echo $_SESSION['postedForm']['lieuEcole'.$i] ?>" ></td>
+    <td><input type="text" class="form-control" name="niveauEcole<?php echo $i ?>" placeholder="Niveau" value="<?php echo $_SESSION['postedForm']['niveauEcole'.$i] ?>"></td>
+    <td><input type="text" class="form-control" name="anneesEcole<?php echo $i ?>" placeholder="de-à (années)" value="<?php echo $_SESSION['postedForm']['anneesEcole'.$i] ?>"></td>
+  </tr>
+  <?php }} ?>
+</table>
+<button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addSch">Ajouter une ligne</button>
+
+<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/>
+  <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
new file mode 100644
index 0000000..3430f8e
--- /dev/null
+++ b/canapEPFL/templates/formParts/new/trainings.php
@@ -0,0 +1,26 @@
+<table id="stages">
+  <tr>
+    <td>
+      <label for="activiteStage1">Métier</label>
+      <input type="text" name="activiteStage1" class="form-control" placeholder="Métier" value="<?php echo $_SESSION['postedForm']['activiteStage1'] != '' ? $_SESSION['postedForm']['activiteStage1'] : ''; ?>">
+    </td>
+    <td>
+      <label for="entrepriseStage1">Entreprise</label>
+      <input type="text" name="entrepriseStage1" class="form-control" placeholder="Entreprise" value="<?php echo $_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>
+  </tr>
+  <?php
+  for($i = 2; $i < 4; $i++){
+    if($_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>
+    <td><input type="text" class="form-control" name="entrepriseStage<?php echo $i ?>" placeholder="Entreprise" value="<?php echo $_SESSION['postedForm']['entrepriseStage'.$i] ?>" ></td>
+  </tr>
+  <?php }} ?>
+</table>
+<button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addStage">Ajouter une ligne</button>
\ No newline at end of file
-- 
GitLab