From d574a28c1d5f1f84c7a43ceb53eb243308fef29e Mon Sep 17 00:00:00 2001 From: Joshua Perry <45966243+jpez-development@users.noreply.github.com> Date: Wed, 25 Jan 2023 16:33:08 +0000 Subject: [PATCH] added filter --- jobs/controllers/Jobs.php | 8 +++++++- templates/category.html.php | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/jobs/controllers/Jobs.php b/jobs/controllers/Jobs.php index 8e14de4..73b6ac5 100644 --- a/jobs/controllers/Jobs.php +++ b/jobs/controllers/Jobs.php @@ -26,7 +26,13 @@ class Jobs { return $this->notFound(); } else { - $this->vars['jobs'] = $this->jobsTable->find('categoryId', $cat[0]->id); + if (isset($_GET['filter'])) { + $this->vars['jobs'] = $this->jobsTable->find('categoryId', $cat[0]->id, "location", $_GET['filter']); + } + else { + $this->vars['jobs'] = $this->jobsTable->find('categoryId', $cat[0]->id); + + } $this->vars['heading'] = $cat[0]->name; return ['template' => 'category.html.php', 'title' => 'Jo\'s Jobs- '. $_GET['page'], diff --git a/templates/category.html.php b/templates/category.html.php index b006e66..cf5b803 100644 --- a/templates/category.html.php +++ b/templates/category.html.php @@ -7,6 +7,16 @@

Jobs

+
+ + + + +