This commit is contained in:
Joshua Perry 2023-02-05 12:05:49 +00:00
parent 6880e237cb
commit 86eab6287d
1 changed files with 8 additions and 3 deletions

View File

@ -37,7 +37,7 @@ class Jobs {
$this->vars['jobs'] = $this->jobsTable->find($columns, $values, $comparators); $this->vars['jobs'] = $this->jobsTable->find($columns, $values, $comparators);
} }
else { else {
$this->vars['jobs'] = $this->jobsTable->find(['categoryId', "closingDate"], ["value0" => $cat[0]->id, "value1" => date("y-m-d")], ["=", ">"]); $this->vars['jobs'] = $this->jobsTable->find(['categoryId', 'closingDate'], ["value0" => $cat[0]->id, "value1" => date("y-m-d")], ["=", ">"]);
} }
$this->vars['heading'] = $cat[0]->name; $this->vars['heading'] = $cat[0]->name;
@ -85,9 +85,14 @@ class Jobs {
'jobId' => $_POST['jobId'], 'jobId' => $_POST['jobId'],
'cv' => $fileName 'cv' => $fileName
]; ];
if (count($this->appsTable->find(['email', 'jobId'], ['value0' => $_POST['email'], 'value1' => $_POST['jobId']])) > 0) {
$this->vars['response'] = 'You have already applied for this job';
}
else {
$this->appsTable->save($record); $this->appsTable->save($record);
$this->vars['response'] = 'Your application is complete. We will contact you after the closing date.'; $this->vars['response'] = 'Your application is complete. We will contact you after the closing date.';
} }
}
else { else {
$this->vars['response'] = 'There was an error uploading your CV'; $this->vars['response'] = 'There was an error uploading your CV';
} }