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

fix errors -- working

parent 9a61a1a1
No related branches found
No related tags found
No related merge requests found
......@@ -29,12 +29,12 @@
insertFiles($pdo, $candidateData->fichiers, $candidateId, $candidateData->rootpath);
if ($SENDEMAILS) {
// mailToResp($candidateData->prenomApprenti, $candidateData->nomApprenti, $candidateData->formation);
mailToResp($candidateData->prenomApprenti, $candidateData->nomApprenti, $candidateData->formation);
mailToApprenti($candidateData->mailApprenti, $candidateData->formation);
}
// kill session
$_SESSION['formError'] = false;
// TODO: ENABLE THIS AFTER DEV unset($_SESSION);
unset($_SESSION);
include("templates/confirmationText.php");
} else {
$_SESSION['formError'] = true;
......
......@@ -287,14 +287,14 @@
</td>
</tr>
<?php
for($i = 2; $i < 4; $i++){
if($_SESSION['postedForm']['employeurPro'.$i]){
for ($i = 2; $i < 4; $i++) {
if ($_SESSION['postedForm']['employeurPro'.$i]) {
?>
<tr>
<td><input type="text" class="form-control" name="employeurPro<?php echo $i ?>" placeholder="Employeur" value="<?php echo $_SESSION['postedForm']['employeurPro'.$i] ?>"/></td>
<td><input type="text" class="form-control" name="lieuPro<?php echo $i ?>" placeholder="Lieu" value="<?php echo $_SESSION['postedForm']['lieuPro'.$i] ?>" ></td>
<td><input type="text" class="form-control" name="activitePro1<?php echo $i ?>" placeholder="Activité" value="<?php echo $_SESSION['postedForm']['activitePro'.$i] ?>"></td>
<td><input type="text" class="form-control" name="anneesPro1<?php echo $i ?>" placeholder="de-à (années)" value="<?php echo $_SESSION['postedForm']['anneesPro'.$i] ?>"></td>
<td><input type="text" class="form-control" name="activitePro<?php echo $i ?>" placeholder="Activité" value="<?php echo $_SESSION['postedForm']['activitePro'.$i] ?>"></td>
<td><input type="text" class="form-control" name="anneesPro<?php echo $i ?>" placeholder="de-à (années)" value="<?php echo $_SESSION['postedForm']['anneesPro'.$i] ?>"></td>
</tr>
<?php }} ?>
</table>
......@@ -457,7 +457,7 @@
</main>
<script> lieu='<?php echo $_SESSION['postedForm']['lieu'] ;?>';</script>
<?php
if ($_SESSION['formError']) {
if (isset($_SESSION['formError'])) {
echo "<script>showOnFormReturn(lieu);</script>";
}
// require_once('templates/footer.php'); // (debug du $_POST)
......
......@@ -64,9 +64,7 @@ class PersonnalData {
$this->langueMaternelleApprenti = $postedData['langApp'];
$this->setLanguages($postedData['languesApp']);
$this->majeur = $postedData['maj'] == "true" ? 1 : 0;
if($this->majeur){
$this->setRepresentants();
}
if (!$this->majeur) { $this->setRepresentants(); }
$this->setScolarite();
$this->setActivitesPro();
$this->setStages();
......@@ -98,7 +96,7 @@ class PersonnalData {
private function setActivitesPro () {
for ($i = 1; $i <= 3; $i++) {
if (array_key_exists('employeurPro'.$i, $this->postedData)) {
array_push($this->activitesProfessionnelles,array("employeur"=>$this->postedData['employeurPro'.$i],"lieu"=>$this->postedData['lieuPro'.$i],"activite"=>$this->postedData['activitePro'.$i],"annees"=>$this->postedData['anneesPro'.$i]));
array_push($this->activitesProfessionnelles, array("employeur"=>$this->postedData['employeurPro'.$i],"lieu"=>$this->postedData['lieuPro'.$i],"activite"=>$this->postedData['activitePro'.$i],"annees"=>$this->postedData['anneesPro'.$i]));
}
}
}
......
......@@ -21,8 +21,8 @@
gtag('config', 'UA-130041798-1', { 'anonymize_ip': true });
</script>
<?php
// ini_set("display_errors", 0);
// error_reporting(0);
ini_set("display_errors", 0);
error_reporting(0);
// ini_set("display_errors", 1);
// error_reporting(E_ALL);
require_once('configs/config.php');
......
......@@ -176,8 +176,7 @@
</head>
<body style="margin: 0; padding: 0;">
<!-- HEADER -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<!-- <table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#ffffff">
<div align="center" style="padding: 0px 15px 0px 15px;">
......@@ -186,7 +185,7 @@
<td style="padding: 20px 0px 30px 0px;" class="logo">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<!-- Mettre a jour les liens quand ils seront accessibles-->
Mettre a jour les liens quand ils seront accessibles
<td bgcolor="#ffffff" width="100" align="left"><img alt="Logo" src="https://canap.epfl.ch/assets/img/FA.png" width="200"
style="display: block; font-family: Helvetica, Arial, sans-serif; color: #666666; font-size: 16px;"
border="0"></a></td>
......@@ -201,7 +200,7 @@
</div>
</td>
</tr>
</table>
</table> -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
......
......@@ -5,7 +5,7 @@
Activités professionnelles
</button>
<div class="collapse collapse-item collapse-item-desktop" id="collapse-pro">
<?php if (count($proactivities) < 1) { ?>
<?php if (count($proactivities) < 1) { ?>
<p style="text-align: center;">Aucune donnée fournie</p>
<?php } ?>
<?php foreach ($proactivities as $key => $activity) { ?>
......
......@@ -7,29 +7,29 @@
<div class="collapse collapse-item collapse-item-desktop" id="collapse-scolarite">
<?php if (count($scolarites) < 1) { ?>
<p style="text-align: center;">Aucune donnée fournie</p>
<?php foreach ($scolarites as $key => $scolarity) { ?>
<table class="table table-boxed mb-5">
<thead>
<tr>
<th>Scolarité <?= $key + 1; ?></th>
<th>Données</th>
</tr>
</thead>
<tbody>
<tr>
<td>Ecole, lieu</td>
<td><?= $scolarity['scolarity_school'] . ", " . $scolarity['scolarity_location'] ?></td>
</tr>
<tr>
<td>Niveau</td>
<td><?= $scolarity['scolarity_level'] ?></td>
</tr>
<tr>
<td>Années</td>
<td><?= $scolarity['scolarity_years'] ?></td>
</tr>
</tbody>
</table>
<?php } ?>
<?php } ?>
<?php foreach ($scolarites as $key => $scolarity) { ?>
<table class="table table-boxed mb-5">
<thead>
<tr>
<th>Scolarité <?= $key + 1; ?></th>
<th>Données</th>
</tr>
</thead>
<tbody>
<tr>
<td>Ecole, lieu</td>
<td><?= $scolarity['scolarity_school'] . ", " . $scolarity['scolarity_location'] ?></td>
</tr>
<tr>
<td>Niveau</td>
<td><?= $scolarity['scolarity_level'] ?></td>
</tr>
<tr>
<td>Années</td>
<td><?= $scolarity['scolarity_years'] ?></td>
</tr>
</tbody>
</table>
<?php } ?>
</div>
\ 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