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

update scolarities working

parent 7301eb8e
No related branches found
No related tags found
No related merge requests found
......@@ -414,40 +414,33 @@ function updatePostulation ($pdo, $id, $posted_data, $main_resp_id, $sec_resp_id
$query->execute();
// update scolarities
// $sqlreq = "UPDATE scolarity
// SET
// scolarity_school=':scolarity_school',
// scolarity_location=':scolarity_location',
// scolarity_level=':scolarity_level',
// scolarity_years=':scolarity_years'
// WHERE fk_applicant_id=:applicant_id AND scolarity_id=:scolarity_id";
// if (isset($posted_data['scolarity_school1'])) {
// // at least one is set
// for ($i=1; $i <= 5; $i++) {
// if (isset($posted_data['scolarity_school'. $i])) {
// // update every existing item
// $id_school = $posted_data['scolarity_id'. $i];
// $school = $posted_data['scolarity_school'. $i];
// $location = $posted_data['scolarity_location' . $i];
// $level = $posted_data['scolarity_level' . $i];
// $years = $posted_data['scolarity_years' . $i];
// $query = $pdo->prepare($sqlreq);
// $query->bindParam(':applicant_id', $id, PDO::PARAM_INT);
// $query->bindParam(':scolarity_id', $id_school, PDO::PARAM_INT);
// $query->bindParam(':scolarity_school', $school, PDO::PARAM_STR);
// $query->bindParam(':scolarity_location', $location, PDO::PARAM_STR);
// $query->bindParam(':scolarity_level', $level, PDO::PARAM_STR);
// $query->bindParam(':scolarity_years', $years, PDO::PARAM_STR);
// $query->execute();
// } else {
// break;
// }
// }
// }
$sqlreq = "UPDATE scolarity SET scolarity_school=:scolarity_school, scolarity_location=:scolarity_location, scolarity_level=:scolarity_level, scolarity_years=:scolarity_years
WHERE fk_applicant_id=:applicant_id AND scolarity_id=:scolarity_id";
if (isset($posted_data['scolarity_id1'])) {
// at least one is set
for ($i=1; $i <= 5; $i++) {
if (isset($posted_data['scolarity_id'. $i])) {
// update every existing item
$id_school = $posted_data['scolarity_id'. $i];
$school = $posted_data['scolarity_school'. $i];
$location = $posted_data['scolarity_location' . $i];
$level = $posted_data['scolarity_level' . $i];
$years = $posted_data['scolarity_years' . $i];
$query = $pdo->prepare($sqlreq);
$query->bindParam(':applicant_id', $id, PDO::PARAM_INT);
$query->bindParam(':scolarity_id', $id_school, PDO::PARAM_INT);
$query->bindParam(':scolarity_school', $school, PDO::PARAM_STR);
$query->bindParam(':scolarity_location', $location, PDO::PARAM_STR);
$query->bindParam(':scolarity_level', $level, PDO::PARAM_STR);
$query->bindParam(':scolarity_years', $years, PDO::PARAM_STR);
$query->execute();
} else {
break;
}
}
}
// header('Location: viewpostulation.php');
}
#endregion
......
......@@ -23,8 +23,8 @@
<?php
ini_set("display_errors", 0);
error_reporting(0);
// ini_set("display_errors", 1);
// error_reporting(E_ALL);
ini_set("display_errors", 1);
error_reporting(E_ALL);
require_once('configs/config.php');
require('configs/db.php');
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