blob: dc9a753a48d2a33f9b8c711c347abd1b5a25165f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<?php
include_once('controllers/BaseController.php');
include_once('models/JobOffer.php');
include_once('models/Company.php');
include_once('controllers/DashboardController.php');
class EditOfferController extends BaseController {
private static $job;
private static $companies;
public static function get() {
self::$job = JobOffer::getFromDBById($_POST['jobId']);
self::$companies = Company::getAllFromDB();
include('views/edit-offer.php');
}
public static function put() {
$newJobOffer = new JobOffer($_POST['title'], $_POST['description'], $_POST['company'], $_POST['salary']);
$newJobOffer->id = $_POST['id'];
JobOffer::updateFromDB($newJobOffer);
DashboardController::get();
}
public static function delete() {
JobOffer::deleteFromDB($_POST['jobId']);
DashboardController::get();
}
}
|