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

update responsibles, personnal data

parent 217df970
No related branches found
No related tags found
No related merge requests found
......@@ -22,8 +22,11 @@
<?php
include('templates/header.php');
if (isset($_GET['edit'])) {
// checker si y a pas de postulation selectionnée (session)
require_once("helpers.php");
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>";
......@@ -31,7 +34,7 @@
?>
<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>
<?php echo isset($_GET['edit']) ? "<small class='mb-3'>Les champs notés d'un * doivent être obligatoirement remplis.</small>" : "" ?>
<form method="post" action="cible.php" enctype="multipart/form-data">
<h3>1. Apprentissage</h3>
......
$(document).ready(function () {
initButtonsAction();
if (location.pathname.split("/").slice(-1)[0] == "form.php") {
if (location.search == "?edit") {
// showPolyAndInfoDivs();
$("#all").show();
}
else if (location.pathname.split("/").slice(-1)[0] == "form.php") {
initJobChange();
initButtonsAction();
initAddChildButtons();
......@@ -112,7 +116,6 @@ function initButtonsAction() {
});
$('#retourHome').click(function () {
document.location.href = "http://apprentis.epfl.ch/";
// TODO: logout Tequila
});
$('#retourFormulaire').click(function () {
history.go(-1);
......
<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>
<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 ($current_post['applicant_maturity'] == 0) ? "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 ($current_post['applicant_maturity'] == 1) ? "checked=\"checked\"" : ''; ?>>
<label class="custom-control-label" for="mpt2">Oui</label>
</div>
\ No newline at end of file
<label for="genreApp">Genre</label>
<select name="genreApp" id="genreApp" class="custom-select" data-required>
<option value="Homme" <?php echo ($current_post['applicant_gender'] == "Homme") ? "checked=\"checked\"" : ''; ?>>Homme</option>
<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 /> -->
<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 />
<label for="surnameApp">Prénom</label>
<input type="text" name="surnameApp" id="surnameApp" class="form-control" placeholder="Prénom" value="<?php echo $current_post['applicant_fsname'] ?>" readonly />
<label for="adrApp">Rue</label>
<input type="text" name="adrApp" id="adrApp" placeholder="Rue" class="form-control" value="<?php echo $current_post['applicant_address_street'] ?>" 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 $current_post['applicant_address_npa'] ?>" 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 $current_post['applicant_home_phone'] ?>" 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 $current_post['applicant_personal_phone'] ?>" minlength="2" maxlength="20" data-required/>
<label for="mailApp">Email</label>
<input type="email" name="mailApp" id="mailApp" value="<?php echo $current_post['applicant_mail'];?>" 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 $current_post['applicant_birthdate'] ?>" 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 $current_post['applicant_origin'] ?>" 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 $current_post['applicant_nationality'] ?>" 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 $current_post['applicant_foreign_authorization'] ?>" maxlength="1" />
<label for="langApp">Langue maternelle</label>
<input type="text" name="langApp" id="langApp" placeholder="Langue maternelle" class="form-control" value="<?php echo $current_post['applicant_main_language'] ?>" minlength="2" maxlength="20" data-required />
<label for="avsNumber">Numéro AV</label>
<input type="text" name="avsNumber" id="avsNumber" placeholder="Numéro AVS" class="form-control" value="<?php echo $current_post['applicant_avs'] ?>" 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="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 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 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 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>
</div>
\ No newline at end of file
<?php
$main_resp = getResponsibleById($pdo, $current_post['fk_applicant_main_responsible'])[0];
$sec_resp = getResponsibleById($pdo, $current_post['fk_applicant_sec_responsible'])[0];
?>
<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 $current_post['applicant_has_majority'] == 0 ? "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 $current_post['applicant_has_majority'] == 0 ? "checked=\"checked\"" : ''; ?>>
<label class="custom-control-label" for="maj2">Oui</label>
</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($main_resp['responsible_gender'])) ? "selected" : ''; ?> disabled> Choisissez un genre</option>
<option value="Homme" <?php echo $main_resp['responsible_gender'] == "Homme" ? "selected" : ''; ?>>Homme</option>
<option value="Femme" <?php echo $main_resp['responsible_gender'] == "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 $main_resp['responsible_name'] != '' ? $main_resp['responsible_name'] : ''; ?>"/>
<label for="surnameRep1">Prénom *</label>
<input type="text" name="surnameRep1" id="surnameRep1" class="form-control" placeholder="Prénom" value="<?php echo $main_resp['responsible_fsname'] != '' ? $main_resp['responsible_fsname'] : ''; ?>"/>
<label for="adrRep1">Rue *</label>
<input type="text" name="adrRep1" id="adrRep1" class="form-control" placeholder="Rue" value="<?php echo $main_resp['responsible_street'] != '' ? $main_resp['responsible_street'] : ''; ?>"/>
<label for="NPARep1">NPA, Domicile *</label>
<input type="text" name="NPARep1" id="NPARep1" class="form-control" placeholder = "NPA, Domicile" value="<?php echo $main_resp['responsible_npa'] != '' ? $main_resp['responsible_npa'] : ''; ?>"/>
<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 $main_resp['responsible_phone'] != '' ? $main_resp['responsible_phone'] : ''; ?>"/>
<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($sec_resp['responsible_gender'])) ? "selected" : ''; ?> disabled> Choisissez un genre</option>
<option value="Homme" <?php echo $sec_resp['responsible_gender'] == "Homme" ? "selected" : ''; ?>>Homme</option>
<option value="Femme" <?php echo $sec_resp['responsible_gender'] == "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 $sec_resp['responsible_name'] != '' ? $sec_resp['responsible_name'] : ''; ?>"/>
<label for="surnameRep2">Prénom</label>
<input type="text" name="surnameRep2" id="surnameRep2" class="form-control" placeholder="Prénom" value="<?php echo $sec_resp['responsible_fsname'] != '' ? $sec_resp['responsible_fsname'] : ''; ?>"/>
<label for="adrRep2">Rue</label>
<input type="text" name="adrRep2" id="adrRep2" class="form-control" placeholder="Rue" value="<?php echo $sec_resp['responsible_street'] != '' ? $sec_resp['responsible_street'] : ''; ?>"/>
<label for="NPARep2">NPA, Domicile</label>
<input type="text" name="NPARep2" id="NPARep2" class="form-control" placeholder = "NPA, Domicile" value="<?php echo $sec_resp['responsible_npa'] != '' ? $sec_resp['responsible_npa'] : ''; ?>"/>
<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 $sec_resp['responsible_phone'] != '' ? $sec_resp['responsible_phone'] : ''; ?>"/>
</div>
\ No newline at end of file
......@@ -25,12 +25,12 @@
<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>";
}
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
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