diff --git a/.DS_Store b/.DS_Store index 69c6f7e..de363c1 100755 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/php/.DS_Store b/php/.DS_Store index 4813d6c..e471992 100755 Binary files a/php/.DS_Store and b/php/.DS_Store differ diff --git a/php/public/index.php b/php/public/index.php index f01c29e..fb4b697 100755 --- a/php/public/index.php +++ b/php/public/index.php @@ -4,7 +4,7 @@ /** Chargement config */ require_once __DIR__ . '/../src/config/config.php'; require __DIR__ . '/../vendor/autoload.php'; -require_once __DIR__ . '/../src/TwigExtensions.php'; +require_once __DIR__ . '/../src/TwigExtensions.php'; // utile pour les images à supprimer sinon /** Configuration twig */ $loader = new \Twig\Loader\FilesystemLoader(__DIR__ . '/../templates'); @@ -13,5 +13,4 @@ $twig = new \Twig\Environment($loader, [ 'debug' => true ]); - $cont = new \App\controleur\FrontControleur(); \ No newline at end of file diff --git a/php/src/controleur/UtilisateurControleur.php b/php/src/controleur/UtilisateurControleur.php index c1ad0bb..05ced90 100755 --- a/php/src/controleur/UtilisateurControleur.php +++ b/php/src/controleur/UtilisateurControleur.php @@ -121,16 +121,16 @@ class UtilisateurControleur $nbOffers = 5 ; - if(isset($_GET["education"]) && Validation::validateTypeStudies($_GET["education"])) { - $niveauEtudes = $_GET["education"]; + if(isset($_GET["niveauEtudes"]) && Validation::validateTypeStudies($_GET["niveauEtudes"])) { + $niveauEtudes = $_GET["niveauEtudes"]; } if(isset($_GET["typeContrat"]) && Validation::validateTypeContract($_GET["typeContrat"])) { $typeContrat = $_GET["typeContrat"]; } - if(isset($_GET["exp"]) && Validation::validateExperience($_GET["exp"])) { - $exp = $_GET["exp"]; + if(isset($_GET["experience"]) && Validation::validateExperience($_GET["experience"])) { + $exp = $_GET["experience"]; } if ($niveauEtudes == null && $typeContrat == null && $exp == null) { @@ -175,14 +175,20 @@ class UtilisateurControleur $offers = $offerMdl->getOffersWithFilters($params); } - echo "filtre :".$niveauEtudes."
"; + /* echo "filtre :".$niveauEtudes."
"; echo "filtre :".$typeContrat."
"; - echo "filtre :".$exp."
"; + echo "filtre :".$exp."
";*/ echo $twig->render('OffersList.html', [ 'offres' => $offers, 'numberPages' => $numberPages, - 'currentPage' => $page + 'currentPage' => $page, + 'typeContrat' => (($typeContrat != null ? "checked" : "")), + 'experience' => (($exp != null ? "checked" : "")), + 'niveauEtudes' => (($niveauEtudes != null ? "checked" : "")), + 'valContrat' => (($typeContrat != null ? "&typeContrat=".$typeContrat : "")), + 'valExp' => (($exp != null ? "&experience=".$exp : "")), + 'valEtudes' => (($niveauEtudes != null ? "&niveauEtudes=".$niveauEtudes : "")) ]); } diff --git a/php/src/gateway/OffreGateway.php b/php/src/gateway/OffreGateway.php index 89eb006..047be8a 100755 --- a/php/src/gateway/OffreGateway.php +++ b/php/src/gateway/OffreGateway.php @@ -114,13 +114,14 @@ class OffreGateway $params[':lvl'] = array($niveauEtudes, \PDO::PARAM_STR); } - if(isset($filters['start']) && isset($filters['end'])) + if(isset($filters['start']) && isset($filters['nbOffers'])) { $query .= " LIMIT :s, :nb"; $params[':s'] = array($filters['start'], \PDO::PARAM_INT); $params[':nb'] = array($filters['nbOffers'], \PDO::PARAM_INT); } + $this->con->executeQuery($query, $params); return $this->con->getResults(); diff --git a/php/templates/OffersList.html b/php/templates/OffersList.html index 6403cc5..995d5f6 100644 --- a/php/templates/OffersList.html +++ b/php/templates/OffersList.html @@ -1,5 +1,5 @@ - + Alica - Offres @@ -23,19 +23,19 @@
- +
- +
- +
- +
@@ -43,11 +43,11 @@
- +
- +
@@ -56,15 +56,15 @@
- +
- +
- +
@@ -72,9 +72,13 @@ + + Réinitialiser les filtres + +

Offres d'emploi

{% for offre in offres %} @@ -100,27 +104,30 @@ {% endfor %} + - + diff --git a/php/templates/OffreDetailTest.html b/php/templates/OffreDetailTest.html index f6ee760..6df0b4d 100644 --- a/php/templates/OffreDetailTest.html +++ b/php/templates/OffreDetailTest.html @@ -2,7 +2,7 @@ - Détails de l'Offre {{ offre.getId() }} + Détails de l'Offre {{ offre.getNom() }}