Skip to content
Snippets Groups Projects
Commit ae0956fa authored by nicrausaz's avatar nicrausaz
Browse files

todo: update helper update

parent 734404c2
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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,
......
......@@ -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") {
......
<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
<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'] ?>">
......@@ -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>
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment