Summary Files Commits Branches @commit @diff @stats
path: root / src / controllers / DashboardController.php
diff options
context:
space:
mode:
1 files changed, 14 insertions, 0 deletions
-rw-r--r--src/controllers/DashboardController.php14
diff --git a/src/controllers/DashboardController.php b/src/controllers/DashboardController.php
index 84beb14..7c01efa 100644
--- a/src/controllers/DashboardController.php
+++ b/src/controllers/DashboardController.php
@@ -1,8 +1,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();
+ }
+ }
}