partial implementation of archive of jobs

This commit is contained in:
Joshua Perry 2023-02-05 13:13:12 +00:00
parent 48508fc429
commit dfc971f9c0
3 changed files with 23 additions and 11 deletions

View File

@ -38,6 +38,10 @@ class Portal {
}
public function homeSubmit() {
if ($_POST['submit'] == "List") {
//TODO: Direct to edit job date
}
else { //TODO: Change to archive instead of delete
if (isset($_POST['job_id'])) {
$this->jobsTable->delete("id", $_POST['job_id']);
return $this->home();
@ -47,6 +51,7 @@ class Portal {
return $this->categories();
}
}
}
public function categories() {
if ($_SESSION['userType'] == 'admin') {

View File

@ -27,10 +27,17 @@
<td><?=$job->getCat()->name?></td>
<td><a style="float: right" href="portal/edit?job_id=<?=$job->id?>">Edit</a></td>
<td><a style="float: right" href="portal/applicants?job_id=<?=$job->id?>">View applicants (<?=count($job->getApps())?>)</a></td>
<td><form method="post" action="portal/">
<td>
<form method="post" action="portal/">
<input type="hidden" name="job_id" value="<?=$job->id?>" />
<?php if (date('y-m-d', strtotime($job->closingDate)) > date('y-m-d')) { ?>
<input type="submit" name="submit" value="Archive" />
</form></td>
<?php }
else { ?>
<input type="submit" name="submit" value="List" />
<?php } ?>
</form>
</td>
</tr>
<?php } ?>
</thead>

2
todo
View File

@ -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