|
|
|
@ -27,7 +27,8 @@ class UtilisateurControleur
|
|
|
|
|
$utilisateur = $userModel->connection($email, $motDePasse);
|
|
|
|
|
if ($utilisateur instanceof Alumni) {
|
|
|
|
|
$_SESSION['utilisateur'] = $utilisateur;
|
|
|
|
|
header('Location: index.php?action=accueil');
|
|
|
|
|
//header('Location: index.php?action=accueil');
|
|
|
|
|
echo $twig->render("inscription_success.html",[]);
|
|
|
|
|
exit();
|
|
|
|
|
} else {
|
|
|
|
|
$dVueErreur[] = "L'adresse email ou le mot de passe est incorrect.";
|
|
|
|
@ -36,7 +37,7 @@ class UtilisateurControleur
|
|
|
|
|
echo $twig->render('connection.html', ['dVueErreur' => $dVueErreur]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function inscription()
|
|
|
|
|
public function inscription()
|
|
|
|
|
{
|
|
|
|
|
global $twig;
|
|
|
|
|
$dVueErreur = []; // Tableau pour stocker les erreurs, le cas échéant
|
|
|
|
@ -61,7 +62,7 @@ class UtilisateurControleur
|
|
|
|
|
$nouvelUtilisateur = $userModel->inscription($prenom,$nom,$email, $hash);
|
|
|
|
|
|
|
|
|
|
if ($nouvelUtilisateur instanceof Alumni) {
|
|
|
|
|
header('Location: index.php?action=inscription_success');
|
|
|
|
|
echo $twig->render('inscription_success.html');
|
|
|
|
|
exit();
|
|
|
|
|
} else {
|
|
|
|
|
$dVueErreur[] = "L'inscription a échoué, veuillez réessayer.";
|
|
|
|
@ -91,6 +92,7 @@ class UtilisateurControleur
|
|
|
|
|
public function consulterProfilLimite()
|
|
|
|
|
{
|
|
|
|
|
//TODO
|
|
|
|
|
echo 'not implemented yet';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function consultOffers()
|
|
|
|
@ -102,6 +104,8 @@ class UtilisateurControleur
|
|
|
|
|
$typeContrat=null;
|
|
|
|
|
$exp = null;
|
|
|
|
|
|
|
|
|
|
$role = $_SESSION['utilisateur']->getRole() ?? NULL;
|
|
|
|
|
|
|
|
|
|
$nbOffers = 5 ;
|
|
|
|
|
|
|
|
|
|
if(isset($_GET["niveauEtudes"]) && Validation::validateTypeStudies($_GET["niveauEtudes"])) {
|
|
|
|
@ -123,6 +127,7 @@ class UtilisateurControleur
|
|
|
|
|
'typeContrat' => $typeContrat,
|
|
|
|
|
'exp' => $exp,
|
|
|
|
|
'niveauEtudes' => $niveauEtudes,
|
|
|
|
|
'role' => $role
|
|
|
|
|
);
|
|
|
|
|
$offers = $userMdl->getOffersWithFilters($params);
|
|
|
|
|
$totalOffers = count($offers);
|
|
|
|
@ -130,11 +135,9 @@ class UtilisateurControleur
|
|
|
|
|
|
|
|
|
|
$numberPages = ceil($totalOffers / 5);
|
|
|
|
|
|
|
|
|
|
if($numberPages == 0 )
|
|
|
|
|
{
|
|
|
|
|
$msg = NULL;
|
|
|
|
|
if($numberPages == 0 ) {
|
|
|
|
|
$msg = 'Aucune Offre Trouvée';
|
|
|
|
|
echo $twig->render("OffersList.html",['message' => $msg]);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($_GET["page"]) && intval($_GET["page"]) != null) {
|
|
|
|
@ -163,15 +166,17 @@ class UtilisateurControleur
|
|
|
|
|
echo "filtre :".$exp."<br>";*/
|
|
|
|
|
|
|
|
|
|
echo $twig->render('OffersList.html', [
|
|
|
|
|
'msg' => (($msg != null) ? $msg : ""),
|
|
|
|
|
'offres' => $offers,
|
|
|
|
|
'numberPages' => $numberPages,
|
|
|
|
|
'currentPage' => $page,
|
|
|
|
|
'typeContrat' => (($typeContrat != null ? $typeContrat : "")),
|
|
|
|
|
'experience' => (($exp != null ? $exp : "")),
|
|
|
|
|
'niveauEtudes' => (($niveauEtudes != null ? $niveauEtudes : "")),
|
|
|
|
|
'valContrat' => (($typeContrat != null ? "&typeContrat=".$typeContrat : "")),
|
|
|
|
|
'valExp' => (($exp != null ? "&experience=".$exp : "")),
|
|
|
|
|
'valEtudes' => (($niveauEtudes != null ? "&niveauEtudes=".$niveauEtudes : ""))
|
|
|
|
|
'typeContrat' => (($typeContrat != null) ? $typeContrat : ""),
|
|
|
|
|
'experience' => (($exp != null) ? $exp : ""),
|
|
|
|
|
'niveauEtudes' => (($niveauEtudes != null) ? $niveauEtudes : ""),
|
|
|
|
|
'valContrat' => (($typeContrat != null) ? "&typeContrat=".$typeContrat : ""),
|
|
|
|
|
'valExp' => (($exp != null) ? "&experience=".$exp : ""),
|
|
|
|
|
'valEtudes' => (($niveauEtudes != null) ? "&niveauEtudes=".$niveauEtudes : ""),
|
|
|
|
|
'role' => $role
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|