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