diff --git a/canapEPFL/cible.php b/canapEPFL/cible.php index 66c6fd4f2671519aab2f7015a333ef7d9a84fc9e..807313cdc9547b6751ba8ba3189d6bc1854ee448 100644 --- a/canapEPFL/cible.php +++ b/canapEPFL/cible.php @@ -21,6 +21,7 @@ if ($validator->isValid()) { if (isset($_GET['edit'])) { // update data + updatePostulation($pdo, $candidateData); } else { // write infos in DB $candidateId = insertDataIntoDB($pdo, $candidateData); diff --git a/canapEPFL/helpers.php b/canapEPFL/helpers.php index 9d02273c7e33b7c5c098e7c5239e7a45e0a13c77..f85095fd270ad1671699dde67f9db27d8eeb2169 100644 --- a/canapEPFL/helpers.php +++ b/canapEPFL/helpers.php @@ -316,12 +316,15 @@ function deletePostulation ($pdo, $id, $sciper, $rep1, $rep2) { header('Location: viewpostulation.php'); } -function updatePostulation ($pdo, $id, $posted_data, $main_resp_id, $sec_resp_id) { +function updatePostulation ($pdo, $posted_data) { + // $id, $posted_data, $main_resp_id, $sec_resp_id // echo "editing: $id"; // echo "<pre>"; // print_r($posted_data); // update applicant infos + print_r($posted_data); + die; $sqlreq = "UPDATE applicant SET applicant_maturity= :applicant_maturity, diff --git a/canapEPFL/script.js b/canapEPFL/script.js index f31e8c015f2ebb9f024df52c5f84dbaf48204b7a..ff0019618acd4e047fc14b80cdcef25a8292a092 100644 --- a/canapEPFL/script.js +++ b/canapEPFL/script.js @@ -5,6 +5,9 @@ $(document).ready(function () { $("#all").show(); initButtonsAction(); initAddChildButtons(); + initAddRadioButtonEvent(); + initDateChecker(); + initDatepicker(); checkRequired(); } else if (location.pathname.split("/").slice(-1)[0] == "form.php") { diff --git a/canapEPFL/templates/formParts/edit/alreadyapplicant.php b/canapEPFL/templates/formParts/edit/alreadyapplicant.php index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..dd37978ae432240baee51d13e17cb7cfe05a72eb 100644 --- a/canapEPFL/templates/formParts/edit/alreadyapplicant.php +++ b/canapEPFL/templates/formParts/edit/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 $current_post['applicant_already_applicant'] == 0 ? "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 $current_post['applicant_already_applicant'] == 1 ? "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 $current_post['applicant_already_applicant_year']?>" 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/edit/jobselection.php b/canapEPFL/templates/formParts/edit/jobselection.php index d28f68a71e9faa952740f7097c16504c2173532c..a617737559c47dabda6643196a7c08f01caec269 100644 --- a/canapEPFL/templates/formParts/edit/jobselection.php +++ b/canapEPFL/templates/formParts/edit/jobselection.php @@ -1,2 +1,4 @@ <p>Formation: <b><?= $LISTJOB[$current_post['applicant_formation_location']][$current_post['applicant_formation']]?></b></p> <p>Lieu: <b><?= $current_post['applicant_formation_location'] ?></b></p> +<input type="text" hidden readonly name="job" value="<?= $current_post['applicant_formation']?>"> +<input type="text" hidden readonly name="lieu" value="<?= $current_post['applicant_formation_location'] ?>"> diff --git a/canapEPFL/templates/formParts/edit/personnal.php b/canapEPFL/templates/formParts/edit/personnal.php index 3a8f1cd3c1c4d2a1c3be51fda88b674f747a0546..d1a4f70ece54e6d5fb025a6b48bdaaa68d92c5fc 100644 --- a/canapEPFL/templates/formParts/edit/personnal.php +++ b/canapEPFL/templates/formParts/edit/personnal.php @@ -4,7 +4,7 @@ <option value="Femme" <?php echo ($current_post['applicant_gender'] == "Femme") ? "checked=\"checked\"" : ''; ?>>Femme</option> </select> -<!-- <input type="text" name="guestSciper" class="form-control" placeholder="Prénom" value="<?php echo $guest_sciper;?>" readonly hidden /> --> +<input type="text" name="guestSciper" class="form-control" 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 $current_post['applicant_name'] ?>" readonly /> @@ -50,22 +50,22 @@ <label>Connaissances linguistiques</label> <div class="custom-control custom-checkbox"> - <input hidden value="0" name="applicant_speaks_french"> + <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 $current_post['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 value="0" name="applicant_speaks_german"> + <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 $current_post['applicant_speaks_german'] == 1 ? 'checked="checked"' : ''; ?>> <label class="custom-control-label" for="german">Allemand</label> </div> <div class="custom-control custom-checkbox"> - <input hidden value="0" name="applicant_speaks_english"> + <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 $current_post['applicant_speaks_english'] == 1 ? 'checked="checked"' : ''; ?>> <label class="custom-control-label" for="english">Anglais</label> </div> <div class="custom-control custom-checkbox"> - <input hidden value="0" name="applicant_speaks_other"> + <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 $current_post['applicant_speaks_other'] == 1 ? 'checked="checked"' : ''; ?>> <label class="custom-control-label" for="other">Autres</label> </div> diff --git a/canapEPFL/templates/formParts/new/personnal.php b/canapEPFL/templates/formParts/new/personnal.php index 046485b6e4b8890958465f36db8d48020ba88880..1f7f263cd9a686a5569bd51e80d176941eb659f3 100644 --- a/canapEPFL/templates/formParts/new/personnal.php +++ b/canapEPFL/templates/formParts/new/personnal.php @@ -5,7 +5,7 @@ <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 /> +<input type="text" name="guestSciper" class="form-control" 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 /> @@ -51,22 +51,22 @@ <label>Connaissances linguistiques *</label> <div class="custom-control custom-checkbox"> - <input hidden value="0" name="applicant_speaks_french"> + <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"' : ''; ?>> <label class="custom-control-label" for="french">Français</label> </div> - <div class="custom-control custom-checkbox"> - <input hidden value="0" name="applicant_speaks_german"> + <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"' : ''; ?>> <label class="custom-control-label" for="german">Allemand</label> </div> <div class="custom-control custom-checkbox"> - <input hidden value="0" name="applicant_speaks_english"> + <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"' : ''; ?>> <label class="custom-control-label" for="english">Anglais</label> </div> <div class="custom-control custom-checkbox"> - <input hidden value="0" name="applicant_speaks_other"> + <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"' : ''; ?>> <label class="custom-control-label" for="other">Autres</label> </div>