diff --git a/canapEPFL/script.js b/canapEPFL/script.js index 598ffaadadaaed05ec007edf2359e5f65b16ca65..f31e8c015f2ebb9f024df52c5f84dbaf48204b7a 100644 --- a/canapEPFL/script.js +++ b/canapEPFL/script.js @@ -51,7 +51,7 @@ function initDateChecker() { } function addChildren(parentId, maxItems, childTemplate, addButtonId) { - var i = $(parentId + ' > tbody').children().length + 1; + var i = $(parentId + ' > tbody').children().length; if (i < maxItems) { var fullTemplate = childTemplate.replace(/\{(.*?)\}/g, i); $(parentId).append(fullTemplate); diff --git a/canapEPFL/templates/formParts/edit/trainings.php b/canapEPFL/templates/formParts/edit/trainings.php index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..bb9d8ecf69a3c98f86b4571741990c1ac0d7c071 100644 --- a/canapEPFL/templates/formParts/edit/trainings.php +++ b/canapEPFL/templates/formParts/edit/trainings.php @@ -0,0 +1,20 @@ +<?php + $trainings = getTrainingById($pdo, $current_post['applicant_id']); +?> +<table id="stages"> + <tr> + <th>Métier</th> + <th>Entreprise</th> + </tr> + <?php foreach ($trainings as $key => $training) { $i = $key + 1; ?> + <tr> + <td> + <input type="text" class="form-control" name="activiteStage<?php echo $i ?>" placeholder="Métier" value="<?= $training['training_job'] ?>" > + </td> + <td> + <input type="text" class="form-control" name="entrepriseStage<?php echo $i ?>" placeholder="Entreprise" value="<?= $training['training_company'] ?>" > + </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 diff --git a/canapEPFL/templates/formParts/new/proactivities.php b/canapEPFL/templates/formParts/new/proactivities.php index ce917354596a69b9b09dcb1e1277c03e21129f46..7015e8c66466622041508cc549572ecd8261faa5 100644 --- a/canapEPFL/templates/formParts/new/proactivities.php +++ b/canapEPFL/templates/formParts/new/proactivities.php @@ -1,19 +1,21 @@ <table id="activites"> + <tr> + <th>Employeur</th> + <th>Lieu</th> + <th>Activité</th> + <th>Années</th> + </tr> <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> diff --git a/canapEPFL/templates/formParts/new/scolarity.php b/canapEPFL/templates/formParts/new/scolarity.php index edad6075a02ec90344affb28e5094bd46d8a1663..abb251a3f2c4126f4fab72047982231e13e155b7 100644 --- a/canapEPFL/templates/formParts/new/scolarity.php +++ b/canapEPFL/templates/formParts/new/scolarity.php @@ -1,19 +1,21 @@ <table id="scolaire"> + <tr> + <th>Ecole</th> + <th>Lieu</th> + <th>Niveau</th> + <th>Années</th> + </tr> <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> diff --git a/canapEPFL/templates/formParts/new/trainings.php b/canapEPFL/templates/formParts/new/trainings.php index 3430f8eab4504e687ea61c2826cafe49a46636f0..78418820a7cf1312336dd8f04e8851e9fbc5d657 100644 --- a/canapEPFL/templates/formParts/new/trainings.php +++ b/canapEPFL/templates/formParts/new/trainings.php @@ -1,11 +1,13 @@ <table id="stages"> + <tr> + <th>Métier</th> + <th>Entreprise</th> + </tr> <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>