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

update script to edit usage, form changes

parent 0dffa29f
No related branches found
No related tags found
No related merge requests found
......@@ -107,13 +107,18 @@
</div>
</div>
<!-- / Conditions -->
<button type="submit" class="btn btn-primary btn-block" type="submit">Terminer</button>
<button class="btn btn-primary btn-block" type="submit">Terminer</button>
<button class="btn btn-secondary btn-block" id="cancelEditBtn" type="button">Annuler</button>
</div>
<!-- / div all -->
</form>
</main>
<script> lieu='<?php echo $_SESSION['postedForm']['lieu'] ;?>';</script>
<?php if (isset($_GET['edit'])) { ?>
<script> lieu='<?php echo $_SESSION['postedForm']['lieu'] ;?>';</script>
<?php } else { ?>
<script> lieu='<?php echo $_SESSION['current_post']['applicant_formation_location'] ;?>';</script>
<?php
}
if (isset($_SESSION['formError'])) {
echo "<script>showOnFormReturn(lieu);</script>";
}
......
$(document).ready(function () {
initButtonsAction();
if (location.search == "?edit") {
// showPolyAndInfoDivs();
$("#all").show();
initButtonsAction();
initAddChildButtons();
......@@ -114,6 +113,9 @@ function initButtonsAction() {
$('#editPost').click(function () {
document.location.href = "form.php?edit";
});
$('#cancelEditBtn').click(function () {
document.location.href = "viewpostulation.php";
})
$('#infoFilieres').click(function () {
window.open("https://www.ict-berufsbildung.ch/fr/formation-professionnelle/formation-initiale-ict/", '_blank');
});
......@@ -236,14 +238,20 @@ function initJobChange() {
}
function showOnFormReturn(lieu) {
if (lieu == 'Lausanne') {
var selectedFormation = $("#jbLausanne option:selected")[0].value;
}
else if (lieu == 'Sion') {
var selectedFormation = $("#jbSion option:selected")[0].value;
if (location.search != "?edit") {
if (lieu == 'Lausanne') {
var selectedFormation = $("#jbLausanne option:selected")[0].value;
}
else if (lieu == 'Sion') {
var selectedFormation = $("#jbSion option:selected")[0].value;
}
showListJob(lieu);
showPolyAndInfoDivs(selectedFormation);
} else {
var selectedFormation = $('#job').val();
showPolyAndInfoDivs(selectedFormation);
}
showListJob(lieu)
showPolyAndInfoDivs(selectedFormation);
}
function showListJob(lieu) {
if (lieu == 'Lausanne') {
......
......@@ -5,6 +5,7 @@
if (!$_POST && !$_FILES) {
echo "<li>Fichiers fournis trop volumineux ! <small>(Taille recommandée env. 2Mo)</small></li>";
} else {
echo isset($_SESSION['edit_error']['files']) ? $_SESSION['edit_error']['files'] : '';
foreach($validator->errors() as $error => $errorVal) {
echo "<li>$errorVal</li>";
}
......
<?php
$files = getFilesById($pdo, $current_post['applicant_id']);
echo "<pre>";
print_r($files);
echo "</pre>";
?>
<small>Remplacez ou ajouter des annexes (le fichier actuel est conservé si il n'est pas remplacé)</small>
<br>
......@@ -36,9 +33,9 @@
</label>
<br>
<small class="error" class="form-text text-muted"></small>
</div>
</div> -->
<div class="form-group" id="griTest">
<!-- <div class="form-group" id="griTest">
<label for="griTestInput">Attestation de tests d'aptitudes GRI (informaticien):</label>
<input type="file" name="griTestInput" class="upload-input" id="griTestInput" onchange="changeTitleFile(this)"/>
<br>
......
<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'] ?>">
<input type="text" hidden readonly name="job" id="job" value="<?= $current_post['applicant_formation']?>">
<input type="text" hidden readonly name="lieu" id="lieu" value="<?= $current_post['applicant_formation_location'] ?>">
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