Summary Files Commits Branches @commit @diff @stats
path: root / src / controllers / DashboardController.php
diff options
context:
space:
mode:
Commit1856de8c22af1a762961547f042891d5b6f9455c (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-04-03 10:36:27 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-04-03 10:36:27 +0300
Files1ff4f4ec37fa26c851f2682cbfa96c000614fece /src/controllers/DashboardController.php
devrix-job-board-1856de8c22af1a762961547f042891d5b6f9455c.tar
devrix-job-board-1856de8c22af1a762961547f042891d5b6f9455c.tar.gz
devrix-job-board-1856de8c22af1a762961547f042891d5b6f9455c.zip
Parent3d40b19a379b7cd013283e623f773b760b281bdd (diff)
Added skeleton of edit offer and implemented edit and delete buttons in dashboard offers
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();
+ }
+ }
}