From dfc971f9c06c97e6a43c303ab02b2db99d9fc308 Mon Sep 17 00:00:00 2001 From: Joshua Perry <45966243+jpez-development@users.noreply.github.com> Date: Sun, 5 Feb 2023 13:13:12 +0000 Subject: [PATCH] partial implementation of archive of jobs --- jobs/controllers/Portal.php | 17 +++++++++++------ templates/job_table.html.php | 15 +++++++++++---- todo | 2 +- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/jobs/controllers/Portal.php b/jobs/controllers/Portal.php index 9a858ee..8572938 100644 --- a/jobs/controllers/Portal.php +++ b/jobs/controllers/Portal.php @@ -38,13 +38,18 @@ class Portal { } public function homeSubmit() { - if (isset($_POST['job_id'])) { - $this->jobsTable->delete("id", $_POST['job_id']); - return $this->home(); + if ($_POST['submit'] == "List") { + //TODO: Direct to edit job date } - if (isset($_POST['cat_id'])) { - $this->catsTable->delete("id", $_POST['cat_id']); - return $this->categories(); + else { //TODO: Change to archive instead of delete + if (isset($_POST['job_id'])) { + $this->jobsTable->delete("id", $_POST['job_id']); + return $this->home(); + } + if (isset($_POST['cat_id'])) { + $this->catsTable->delete("id", $_POST['cat_id']); + return $this->categories(); + } } } diff --git a/templates/job_table.html.php b/templates/job_table.html.php index e2b5fe5..2559934 100644 --- a/templates/job_table.html.php +++ b/templates/job_table.html.php @@ -27,10 +27,17 @@ getCat()->name?> Edit View applicants (getApps())?>) -
- - -
+ +
+ + closingDate)) > date('y-m-d')) { ?> + + + + +
+ diff --git a/todo b/todo index 342b61f..88e6bf7 100644 --- a/todo +++ b/todo @@ -17,7 +17,7 @@ Assignment 2: - User accounts made in admin portal - Client user accounts - restricted admin panel @done - - add and archive jobs + - add and archive jobs @done - see who has applied for jobs @done - Client can only see their jobs @done - Homepage has 10 jobs that are about to reach closing date @done