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

show heaeder only if content

parent 49d3717b
No related branches found
No related tags found
No related merge requests found
...@@ -424,7 +424,28 @@ function updatePostulation ($pdo, $posted_data) { ...@@ -424,7 +424,28 @@ function updatePostulation ($pdo, $posted_data) {
$query->bindParam(':responsible_phone', $sec_rep['telephone'], PDO::PARAM_STR); $query->bindParam(':responsible_phone', $sec_rep['telephone'], PDO::PARAM_STR);
$query->execute(); $query->execute();
} }
// TODO: si nouveau, insert
// Si majeur, delete les valeurs
// if ($posted_data->majeur == 1) {
// echo $main_rep['id'];
// if ($main_rep['id'] != '') {
// $sqlreq = "DELETE FROM responsible WHERE responsible_id=:id";
// $query = $pdo->prepare($sqlreq);
// $query->bindParam(':id1', $main_rep['id'], PDO::PARAM_STR);
// $query->execute();
// }
// if ($sec_rep['id'] != '') {
// $sqlreq = "DELETE FROM responsible WHERE responsible_id=:id";
// $query = $pdo->prepare($sqlreq);
// $query->bindParam(':id', $sec_rep['id'], PDO::PARAM_STR);
// $query->execute();
// }
// }
// Si nouveau, insert
if ($main_rep['id'] == '' || $sec_rep['id'] == '') {
insertResponsibles($pdo, [$main_rep, $sec_rep], $posted_data->id);
}
// update scolarities // update scolarities
$to_add = []; $to_add = [];
......
...@@ -8,6 +8,7 @@ $(document).ready(function () { ...@@ -8,6 +8,7 @@ $(document).ready(function () {
initDateChecker(); initDateChecker();
initDatepicker(); initDatepicker();
checkRequired(); checkRequired();
toggleTableHeaders();
} }
else if (location.pathname.split("/").slice(-1)[0] == "form.php") { else if (location.pathname.split("/").slice(-1)[0] == "form.php") {
initJobChange(); initJobChange();
...@@ -61,6 +62,9 @@ function addChildren(parentId, maxItems, childTemplate, addButtonId) { ...@@ -61,6 +62,9 @@ function addChildren(parentId, maxItems, childTemplate, addButtonId) {
$(addButtonId).hide(); $(addButtonId).hide();
} }
} }
if (location.search == "?edit") {
toggleTableHeaders();
}
} }
function changeTitleFile(objFile) { function changeTitleFile(objFile) {
...@@ -166,6 +170,19 @@ function initAddChildButtons() { ...@@ -166,6 +170,19 @@ function initAddChildButtons() {
}); });
} }
function toggleTableHeaders() {
if ($('#activites')[0].rows.length == 1) {
$($('#activites')[0].rows[0]).hide();
} else {
$($('#activites')[0].rows[0]).show();
}
if ($('#stages')[0].rows.length == 1) {
$($('#stages')[0].rows[0]).hide();
} else {
$($('#stages')[0].rows[0]).show();
}
}
function setMajState() { function setMajState() {
$('#maj1')[0].checked ? $("#representants").show() : $("#representants").hide(); $('#maj1')[0].checked ? $("#representants").show() : $("#representants").hide();
} }
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
<?php <?php
ini_set("display_errors", 0); ini_set("display_errors", 0);
error_reporting(0); error_reporting(0);
ini_set("display_errors", 1); // ini_set("display_errors", 1);
error_reporting(E_ALL); // error_reporting(E_ALL);
require_once('configs/config.php'); require_once('configs/config.php');
require('configs/db.php'); require('configs/db.php');
if (!isset($_SESSION)) { session_start(); } if (!isset($_SESSION)) { session_start(); }
......
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