|
|
|
@ -104,6 +104,14 @@ class UtilisateurControleur
|
|
|
|
|
echo 'not implemented yet';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function resetFilters()
|
|
|
|
|
{
|
|
|
|
|
unset($_SESSION["niveauEtudes"]);
|
|
|
|
|
unset($_SESSION["typeContrat"]);
|
|
|
|
|
unset($_SESSION["experience"]);
|
|
|
|
|
$this->consultOffers(null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function consultOffers(?array $params)
|
|
|
|
|
{
|
|
|
|
|
$userMdl = new UtilisateurModele();
|
|
|
|
@ -117,16 +125,29 @@ class UtilisateurControleur
|
|
|
|
|
$nbOffers = 5 ;
|
|
|
|
|
|
|
|
|
|
if(isset($_POST["niveauEtudes"]) && Validation::validateTypeStudies($_POST["niveauEtudes"])) {
|
|
|
|
|
$niveauEtudes = $_POST["niveauEtudes"];
|
|
|
|
|
//$niveauEtudes = $_POST["niveauEtudes"];
|
|
|
|
|
$_SESSION["niveauEtudes"] = $_POST["niveauEtudes"];
|
|
|
|
|
$niveauEtudes = $_SESSION["niveauEtudes"];
|
|
|
|
|
}
|
|
|
|
|
else if(isset($_SESSION["niveauEtudes"]))
|
|
|
|
|
{$niveauEtudes = $_SESSION["niveauEtudes"];}
|
|
|
|
|
|
|
|
|
|
if(isset($_POST["typeContrat"]) && Validation::validateTypeContract($_POST["typeContrat"])) {
|
|
|
|
|
$typeContrat = $_POST["typeContrat"];
|
|
|
|
|
//$typeContrat = $_POST["typeContrat"];
|
|
|
|
|
$_SESSION["typeContrat"] = $_POST["typeContrat"];
|
|
|
|
|
$typeContrat = $_SESSION["typeContrat"];
|
|
|
|
|
}
|
|
|
|
|
else if(isset($_SESSION["typeContrat"]))
|
|
|
|
|
{$typeContrat = $_SESSION["typeContrat"];}
|
|
|
|
|
|
|
|
|
|
if(isset($_POST["experience"]) && Validation::validateExperience($_POST["experience"])) {
|
|
|
|
|
$exp = $_POST["experience"];
|
|
|
|
|
//$exp = $_POST["experience"];
|
|
|
|
|
$_SESSION["experience"] = $_POST["experience"];
|
|
|
|
|
$exp = $_SESSION["experience"];
|
|
|
|
|
}
|
|
|
|
|
else if(isset($_SESSION["experience"]))
|
|
|
|
|
{$exp = $_SESSION["experience"];}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($niveauEtudes == null && $typeContrat == null && $exp == null) {
|
|
|
|
|
$totalOffers = $userMdl->getNbOffers();
|
|
|
|
@ -144,8 +165,14 @@ class UtilisateurControleur
|
|
|
|
|
|
|
|
|
|
$numberPages = ceil($totalOffers / 5);
|
|
|
|
|
|
|
|
|
|
if (isset($_GET["page"]) && intval($_GET["page"]) != null) {
|
|
|
|
|
$page = intval($_GET["page"]);
|
|
|
|
|
//var_dump($params);
|
|
|
|
|
//echo "page : ".$params["id"];
|
|
|
|
|
/*if (isset($params["id"]) && intval($params["id"]) != null)*/
|
|
|
|
|
if(isset($_GET['id']) && intval($_GET['id']) != null)
|
|
|
|
|
{
|
|
|
|
|
$page = intval($_GET['id']);
|
|
|
|
|
|
|
|
|
|
//echo "page : ".$page;
|
|
|
|
|
if ($page > $numberPages || $page < 1) {
|
|
|
|
|
$dVueErreur[] = "Page introuvable";
|
|
|
|
|
echo $twig->render("erreur.html", ['dVueErreur' => $dVueErreur ]);
|
|
|
|
|