diff --git a/canapEPFL/form.php b/canapEPFL/form.php index f4ca3f18d2900156c17b5ebc1805ace06881917a..04e05ef8242c196d89ddc79d589894892c63fc26 100644 --- a/canapEPFL/form.php +++ b/canapEPFL/form.php @@ -27,9 +27,6 @@ echo "editing applicant" . $_SESSION['current_post']['applicant_id']; $current_post = $_SESSION['current_post']; echo $current_post['applicant_guest_sciper']; - echo "<pre>"; - print_r($current_post); - echo "</pre>"; } ?> <main id="main" role="main" class="content container-grid"> diff --git a/canapEPFL/script.js b/canapEPFL/script.js index 3cf0c944fda0f6cc42ef4dc777e25a3db545eb3e..598ffaadadaaed05ec007edf2359e5f65b16ca65 100644 --- a/canapEPFL/script.js +++ b/canapEPFL/script.js @@ -3,6 +3,9 @@ $(document).ready(function () { if (location.search == "?edit") { // showPolyAndInfoDivs(); $("#all").show(); + initButtonsAction(); + initAddChildButtons(); + checkRequired(); } else if (location.pathname.split("/").slice(-1)[0] == "form.php") { initJobChange(); diff --git a/canapEPFL/templates/formParts/edit/proactivities.php b/canapEPFL/templates/formParts/edit/proactivities.php index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..5d22c4bb99f53994b872c926ad3edd8bb8a38704 100644 --- a/canapEPFL/templates/formParts/edit/proactivities.php +++ b/canapEPFL/templates/formParts/edit/proactivities.php @@ -0,0 +1,28 @@ +<?php + $proactivities = getProActivitiesById($pdo, $current_post['applicant_id']); +?> +<table id="activites"> + <tr> + <th>Employeur</th> + <th>Lieu</th> + <th>Activité</th> + <th>Années</th> + </tr> + <?php foreach ($proactivities as $key => $activity) { $i = $key + 1; ?> + <tr> + <td> + <input type="text" name="employeurPro<?= $i ?>" placeholder="Employeur" class="form-control" value="<?php echo $activity['professional_activity_company'] != '' ? $activity['professional_activity_company'] : ''; ?>" data-required/> + </td> + <td> + <input type="text" name="lieuPro<?= $i ?>" placeholder="Lieu" class="form-control" value="<?php echo $activity['professional_activity_location'] != '' ? $activity['professional_activity_location'] : ''; ?>" data-required/> + </td> + <td> + <input type="text" name="activitePro<?= $i ?>" placeholder="Activité" class="form-control" value="<?php echo $activity['professional_activity_activity'] != '' ? $activity['professional_activity_activity'] : ''; ?>" data-required/> + </td> + <td> + <input type="text" name="anneesPro<?= $i ?>" placeholder="de-à (années)" class="form-control" value="<?php echo $activity['professional_activity_years'] != '' ? $activity['professional_activity_years'] : ''; ?>" data-required/> + </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/edit/scolarity.php b/canapEPFL/templates/formParts/edit/scolarity.php index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0f26afce4e8dee2962c1c8f9287c4ea24afd0e7f 100644 --- a/canapEPFL/templates/formParts/edit/scolarity.php +++ b/canapEPFL/templates/formParts/edit/scolarity.php @@ -0,0 +1,35 @@ +<?php + $scolarites = getScolaritiesById($pdo, $current_post['applicant_id']); +?> +<table id="scolaire"> + <tr> + <th>Ecole</th> + <th>Lieu</th> + <th>Niveau</th> + <th>Années</th> + </tr> +<?php foreach ($scolarites as $key => $scolarity) { $i = $key + 1; ?> + <tr> + <td> + <input type="text" name="ecole<?= $i ?>" placeholder="Ecole *" class="form-control" value="<?php echo $scolarity['scolarity_school'] != '' ? $scolarity['scolarity_school'] : ''; ?>" data-required/> + </td> + <td> + <input type="text" name="lieuEcole<?= $i ?>" placeholder="Lieu *" class="form-control" value="<?php echo $scolarity['scolarity_location'] != '' ? $scolarity['scolarity_location'] : ''; ?>" data-required/> + </td> + <td> + <input type="text" name="niveauEcole<?= $i ?>" placeholder="Niveau *" class="form-control" value="<?php echo $scolarity['scolarity_level'] != '' ? $scolarity['scolarity_level'] : ''; ?>" data-required/> + </td> + <td> + <input type="text" name="anneesEcole<?= $i ?>" placeholder="de-à (années) *" class="form-control" value="<?php echo $scolarity['scolarity_years'] != '' ? $scolarity['scolarity_years'] : ''; ?>" data-required/> + </td> + </tr> + <?php } ?> +</table> +<!-- TODO: check ça passe de 3 a 5 --> +<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 $current_post['applicant_scolarity_end'] != '' ? $current_post['applicant_scolarity_end'] : ''; ?>" maxlength="4" data-required/> + <small id="anneeFinError" class="error form-text text-muted"></small> +</div> \ No newline at end of file