can relist archived listings
This commit is contained in:
parent
d8173208da
commit
7e29e9c8b4
|
|
@ -39,7 +39,10 @@ class Portal {
|
||||||
|
|
||||||
public function homeSubmit() {
|
public function homeSubmit() {
|
||||||
if ($_POST['submit'] == "List") {
|
if ($_POST['submit'] == "List") {
|
||||||
//TODO: Direct to edit job date
|
$this->vars['job'] = $this->jobsTable->find(['id'], ['value0' => $_POST['job_id']])[0];
|
||||||
|
return ['template' => 'job_edit.html.php',
|
||||||
|
'title' => 'Jo\'s Jobs- Update Job',
|
||||||
|
'vars' => $this->vars];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (isset($_POST['job_id'])) {
|
if (isset($_POST['job_id'])) {
|
||||||
|
|
@ -57,6 +60,22 @@ class Portal {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function secondHomeSubmit() {
|
||||||
|
if(isset($_POST['archived'])) {
|
||||||
|
$record = [
|
||||||
|
'id' => $_POST['jobId'],
|
||||||
|
'closingDate' => $_POST['closingDate'],
|
||||||
|
'archived' => $_POST['archived']
|
||||||
|
];
|
||||||
|
$this->jobsTable->save($record);
|
||||||
|
}
|
||||||
|
$this->vars['response'] = 'Update successful';
|
||||||
|
return ['template' => 'response.html.php',
|
||||||
|
'title' => 'Jo\'s Jobs- Success',
|
||||||
|
'vars' => $this->vars
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function categories() {
|
public function categories() {
|
||||||
if ($_SESSION['userType'] == 'admin') {
|
if ($_SESSION['userType'] == 'admin') {
|
||||||
$this->vars['table'] = 'category_table.html.php';
|
$this->vars['table'] = 'category_table.html.php';
|
||||||
|
|
@ -79,7 +98,7 @@ class Portal {
|
||||||
|
|
||||||
public function edit() { //TODO: finish this function
|
public function edit() { //TODO: finish this function
|
||||||
if (isset($_GET['job_id'])) {
|
if (isset($_GET['job_id'])) {
|
||||||
$this->vars['job'] = $this->jobsTable->find(["id"], ['value0' => $_GET['jod_id']]);
|
$this->vars['job'] = $this->jobsTable->find(["id"], ['value0' => $_GET['job_id']]);
|
||||||
}
|
}
|
||||||
if (isset($_GET['cat_id'])) {
|
if (isset($_GET['cat_id'])) {
|
||||||
$this->vars['cat'] = $this->catsTable->find(["id"], ['value0' => $_GET['cat_id']]);
|
$this->vars['cat'] = $this->catsTable->find(["id"], ['value0' => $_GET['cat_id']]);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
<main class="home">
|
||||||
|
<h2>Update <?=$job->title?></h2>
|
||||||
|
<form method="post" action="/portal/secondHome">
|
||||||
|
<?php if ($job->archived == 'y') { ?>
|
||||||
|
<label>Enter new Closing Date</label>
|
||||||
|
<input type="date" name="closingDate"/>
|
||||||
|
<input type="hidden" name="archived" value="n"/>
|
||||||
|
<input type="hidden" name="jobId" value="<?=$job->id?>"/>
|
||||||
|
<?php } ?>
|
||||||
|
<input type="submit" name="submit" value="Update"/>
|
||||||
|
</form>
|
||||||
|
</main>
|
||||||
3
todo
3
todo
|
|
@ -12,7 +12,8 @@ Assignment 2:
|
||||||
- Allow customers to filter by location @done
|
- Allow customers to filter by location @done
|
||||||
- Move new framework into project @done
|
- Move new framework into project @done
|
||||||
- Fix Adding categories @done
|
- Fix Adding categories @done
|
||||||
- Archive jobs instead of delete
|
- Archive jobs instead of delete @done
|
||||||
|
- Relist archived jobs with new closing date @done
|
||||||
- Add admin user control to admin portal
|
- Add admin user control to admin portal
|
||||||
- User accounts made in admin portal
|
- User accounts made in admin portal
|
||||||
- Client user accounts
|
- Client user accounts
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue