Summary Files Commits Branches @commit @diff @stats
path: root / src / controllers / DashboardController.php
blob: 7c01efa3bceccbb29003c39ff28da5b60f31e925 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
include_once('controllers/BaseController.php');
include_once('models/JobOffer.php');
include_once('controllers/EditOfferController.php');

class DashboardController extends BaseController {
	public static function get() {
		$jobs = JobOffer::getAllFromDB();
		include "views/dashboard.php";
	}

	public static function post() {
		if ($_POST['_method'] == "put") {
			$_SERVER['REQUEST_METHOD'] = "PUT";
			EditOfferController::invoke();
		}
		else if ($_POST['_method'] == "delete") {
			$_SERVER['REQUEST_METHOD'] = "DELETE";
			EditOfferController::invoke();
		}
	}
}