Newer
Older
<head>
<?php
include("templates/head.php");
require_once("helpers.php");
require_once("models/PersonnalData.php");
require_once("models/PersonnalDataValidator.php");
?>
<title>Postulation Apprentis | Confirmation</title>
</head>
<body>
<?php
include('templates/header.php');
// Init personnalData with postedData
$candidateData = new PersonnalData($_POST, $_FILES);
// Init dataValidator
$validator = new PersonnalDataValidator($candidateData);
$candidateId = insertDataIntoDB($pdo, $candidateData);
$filesPath = createFilesFolder($candidateData->rootpath, $candidateId);
$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);
} else {
$_SESSION['formError'] = true;
$_SESSION['postedForm'] = $_POST;
$_SESSION['files'] = $_FILES;
include("templates/errorText.php");
}
?>