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

config file improove

parent 93ef727b
No related branches found
No related tags found
No related merge requests found
# Améliorations en cours
- [x] Utiliser la nouvelle charte 2018
- [ ] Adapter pour ajouter les postulations dans une DB
- [x] Ajouter une page pour voir / supprimer sa / ses postulation(s)
- [ ] Commentaires et section du code
# Améliorations possibles du formulaire canap.epfl.ch
......
......@@ -13,7 +13,7 @@
<?php
include('templates/header.php');
// Init personnalData with postedData
$candidateData = new PersonnalData($_POST, $_FILES);
$candidateData = new PersonnalData($_POST, $_FILES, $FILESERVERPATH);
// Init dataValidator
$validator = new PersonnalDataValidator($candidateData);
......@@ -25,9 +25,10 @@
$candidateData = uploadAllFiles($filesPath, $candidateData->fichiers, $candidateData);
insertFiles($pdo, $candidateData->fichiers, $candidateId, $candidateData->rootpath);
// mailToResp($candidateData->prenomApprenti, $candidateData->nomApprenti, $candidateData->formation);
// mailToApprenti($candidateData->mailApprenti, $candidateData->formation);
if ($SENDEMAILS) {
mailToResp($candidateData->prenomApprenti, $candidateData->nomApprenti, $candidateData->formation);
mailToApprenti($candidateData->mailApprenti, $candidateData->formation);
}
// kill session
$_SESSION['formError'] = false;
// unset($_SESSION);
......
<?php
if(count(get_included_files()) == 1) exit("Direct access not permitted.");
// by default, labo can't apply by this formular, in case, add some of these these values in the array:
/*
-- DO NOT DELETE --
......@@ -45,8 +43,11 @@
"neSaisPas" => "Pas de filière préférée"
];
// ajouter le chemin des fichiers
// ajouter envois de mail actif / inactif
// default: \\\\scxdata\\apprentis$\\candidatures\\
$FILESERVERPATH = 'D:/formdata/';
// Mettre a false pour pas spammer pendant le dev
$SENDEMAILS = false;
$POSTULATION_OPEN = true; // close/open postulation
......
<?php
/* template pour la connection DB, renommer en db.php */
$db_user = '';
$db_pass = '';
$pdo = new PDO('mysql:host=localhost;dbname=canap_dev', $db_user, $db_pass);
......
......@@ -17,7 +17,7 @@ class PersonnalData {
"interactiveMediaDesigner" => "InteractiveMediaDesigners"
);
private $dateNow;
public $rootpath = 'D:/formdata/'; // \\\\scxdata\\apprentis$\\candidatures\\nouvelles\\
public $rootpath = '';
public $guest_sciper = "";
public $formation = "";
public $lieu = "";
......@@ -48,7 +48,8 @@ class PersonnalData {
public $datePostulation = "";
public $fichiers = [];
public function __construct($postedData, $postedFiles) {
public function __construct($postedData, $postedFiles, $FILESERVERPATH) {
$this->rootpath = $FILESERVERPATH;
$this->dateNow = date('Y-m-d_H-i-s');
// Rempli les infos
$this->postedData = $postedData;
......
<?php
$files = getFilesById($pdo, $postulation['applicant_id']);
?>
<button class="collapse-title collapse-title-desktop collapsed" type="button" data-toggle="collapse" data-target="#collapse-files" aria-expanded="true" aria-controls="collapse-files">
Annexes
</button>
<div class="collapse collapse-item collapse-item-desktop" id="collapse-files">
<?php foreach ($files as $file) { ?>
<table class="table table-boxed mb-5">
<thead>
<tr>
<th>Fichier</th>
<th>Données</th>
</tr>
</thead>
<tbody>
<tr>
<td>Nom</td>
<td>Nom</td>
</tr>
<tr>
<td>Entreprise</td>
<td><a href="/getFile?id=<?= $file['file_id']?>"><?= $file['file_name'] ?></a></td>
</tr>
</tbody>
</table>
<?php } ?>
<table class="table table-boxed mb-5">
<thead>
<tr>
<th>Fichier</th>
<th>Données</th>
</tr>
</thead>
<tbody>
<?php foreach ($files as $file) { ?>
<tr>
<td>Nom</td>
<td><a href="/getFile?id=<?= $file['file_id']?>"><?= $file['file_name'] ?></a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
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