|
|
@ -108,20 +108,6 @@ class UtilisateurControleur
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$nouvelUtilisateur = $userModel->inscription($prenom,$nom,$email, $hash);
|
|
|
|
$nouvelUtilisateur = $userModel->inscription($prenom,$nom,$email, $hash);
|
|
|
|
|
|
|
|
|
|
|
|
// <<<<<<< HEAD
|
|
|
|
|
|
|
|
// // Validez les données d'inscription, par exemple, vérifiez si l'email est unique
|
|
|
|
|
|
|
|
// // Vous pouvez également effectuer d'autres validations nécessaires
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $userModel = new \App\modele\UtilisateurModele();
|
|
|
|
|
|
|
|
// $nouvelUtilisateur = $userModel->inscription($email, $motDePasse);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // Si l'inscription a réussi, redirigez l'utilisateur vers une page de confirmation
|
|
|
|
|
|
|
|
// // Vous pouvez également gérer les erreurs ici en cas d'échec de l'inscription
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if ($nouvelUtilisateur instanceof \App\metier\Alumni) {
|
|
|
|
|
|
|
|
// // L'inscription a réussi, redirigez l'utilisateur vers une page de confirmation
|
|
|
|
|
|
|
|
// // par exemple :
|
|
|
|
|
|
|
|
// =======
|
|
|
|
|
|
|
|
if ($nouvelUtilisateur instanceof \App\metier\Alumni) {
|
|
|
|
if ($nouvelUtilisateur instanceof \App\metier\Alumni) {
|
|
|
|
header('Location: index.php?action=inscription_success');
|
|
|
|
header('Location: index.php?action=inscription_success');
|
|
|
|
exit();
|
|
|
|
exit();
|
|
|
@ -158,6 +144,11 @@ class UtilisateurControleur
|
|
|
|
//TODO
|
|
|
|
//TODO
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @return void
|
|
|
|
|
|
|
|
* @brief Affiche la liste des offres d'emploi
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
protected function consultOffers()
|
|
|
|
protected function consultOffers()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
@ -168,8 +159,10 @@ class UtilisateurControleur
|
|
|
|
$typeContrat=null;
|
|
|
|
$typeContrat=null;
|
|
|
|
$exp = null;
|
|
|
|
$exp = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// number of offers by pages
|
|
|
|
$nbOffers = 5 ;
|
|
|
|
$nbOffers = 5 ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** validation of entry's : */
|
|
|
|
if(isset($_GET["niveauEtudes"]) && Validation::validateTypeStudies($_GET["niveauEtudes"])) {
|
|
|
|
if(isset($_GET["niveauEtudes"]) && Validation::validateTypeStudies($_GET["niveauEtudes"])) {
|
|
|
|
$niveauEtudes = $_GET["niveauEtudes"];
|
|
|
|
$niveauEtudes = $_GET["niveauEtudes"];
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -194,15 +187,19 @@ class UtilisateurControleur
|
|
|
|
$totalOffers = count($offers);
|
|
|
|
$totalOffers = count($offers);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// get the current pages to display
|
|
|
|
$numberPages = ceil($totalOffers / 5);
|
|
|
|
$numberPages = ceil($totalOffers / 5);
|
|
|
|
|
|
|
|
|
|
|
|
if($numberPages == 0 )
|
|
|
|
if($numberPages == 0 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
echo $twig->render("erreur.html",['dVueErreur' => ['Aucune Offre Trouvée']]);
|
|
|
|
echo $twig->render("OffersList.html",['dVueErreur' => ['Aucune Offre Trouvée']]);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// validate the page number
|
|
|
|
if (isset($_GET["page"]) && intval($_GET["page"]) != null) {
|
|
|
|
if (isset($_GET["page"]) && intval($_GET["page"]) != null) {
|
|
|
|
$page = intval($_GET["page"]);
|
|
|
|
$page = intval($_GET["page"]);
|
|
|
|
if ($page > $numberPages || $page < 1) {
|
|
|
|
if ($page > $numberPages || $page < 1) {
|
|
|
@ -214,6 +211,7 @@ class UtilisateurControleur
|
|
|
|
$page = 1;
|
|
|
|
$page = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$start = intval(($page - 1) * 5);
|
|
|
|
$start = intval(($page - 1) * 5);
|
|
|
|
|
|
|
|
|
|
|
|
if ($niveauEtudes == null && $typeContrat == null && $exp == null) {
|
|
|
|
if ($niveauEtudes == null && $typeContrat == null && $exp == null) {
|
|
|
@ -224,6 +222,8 @@ class UtilisateurControleur
|
|
|
|
$offers = $this->userModel->getOffersWithFilters($params);
|
|
|
|
$offers = $this->userModel->getOffersWithFilters($params);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* echo "filtre :".$niveauEtudes."<br>";
|
|
|
|
/* echo "filtre :".$niveauEtudes."<br>";
|
|
|
|
echo "filtre :".$typeContrat."<br>";
|
|
|
|
echo "filtre :".$typeContrat."<br>";
|
|
|
|
echo "filtre :".$exp."<br>";*/
|
|
|
|
echo "filtre :".$exp."<br>";*/
|
|
|
@ -244,12 +244,15 @@ class UtilisateurControleur
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// display the form to create an offer
|
|
|
|
protected function createOfferForm()
|
|
|
|
protected function createOfferForm()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $twig;
|
|
|
|
global $twig;
|
|
|
|
echo $twig->render("CreerOffre.html", []);
|
|
|
|
echo $twig->render("CreerOffre.html", []);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// create offer
|
|
|
|
protected function createOffer()
|
|
|
|
protected function createOffer()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $twig;
|
|
|
|
global $twig;
|
|
|
@ -257,6 +260,8 @@ class UtilisateurControleur
|
|
|
|
|
|
|
|
|
|
|
|
$requiredFields = ['name', 'entreprise', 'description','typeContrat', 'descriptPoste', 'profilRecherche', 'choixExp', 'education', 'mail', 'num'];
|
|
|
|
$requiredFields = ['name', 'entreprise', 'description','typeContrat', 'descriptPoste', 'profilRecherche', 'choixExp', 'education', 'mail', 'num'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// validate required fields
|
|
|
|
$error = false;
|
|
|
|
$error = false;
|
|
|
|
foreach ($requiredFields as $field) {
|
|
|
|
foreach ($requiredFields as $field) {
|
|
|
|
if (empty($_POST[$field])) {
|
|
|
|
if (empty($_POST[$field])) {
|
|
|
@ -270,6 +275,8 @@ class UtilisateurControleur
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// validate entrys
|
|
|
|
if(!Validation::verifierEmail($_POST["mail"]))
|
|
|
|
if(!Validation::verifierEmail($_POST["mail"]))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//echo $twig->render("CreerOffre.html", ['errMsg' => "Email non valide !" ]);
|
|
|
|
//echo $twig->render("CreerOffre.html", ['errMsg' => "Email non valide !" ]);
|
|
|
@ -294,6 +301,8 @@ class UtilisateurControleur
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if errors display the form with errors
|
|
|
|
if(count($taberror) > 0)
|
|
|
|
if(count($taberror) > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
echo $twig->render("CreerOffre.html", ['tabError' => $taberror ]);
|
|
|
|
echo $twig->render("CreerOffre.html", ['tabError' => $taberror ]);
|
|
|
@ -316,6 +325,7 @@ class UtilisateurControleur
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// display offers
|
|
|
|
public function displayOffer()
|
|
|
|
public function displayOffer()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $twig;
|
|
|
|
global $twig;
|
|
|
|