diff options
Merge pull request #1 from Syndamia/dev v0.1
Implemented main functionality
1 files changed, 31 insertions, 0 deletions
| -rw-r--r-- | src/controllers/DashboardController.php | 31 |
diff --git a/src/controllers/DashboardController.php b/src/controllers/DashboardController.php new file mode 100644 index 0000000..548f60b --- /dev/null +++ b/src/controllers/DashboardController.php @@ -0,0 +1,31 @@ +<?php +include_once('controllers/BaseController.php'); +include_once('models/JobOffer.php'); +include_once('models/Company.php'); +include_once('controllers/EditOfferController.php'); + +class DashboardController extends BaseController { + public static $companies = array(); + + public static function get() { + $jobs = JobOffer::getAllFromDB(); + foreach(Company::getAllFromDB() as $company) { + self::$companies[$company->id] = $company->name; + } + include "views/dashboard.php"; + } + + public static function post() { + switch($_POST['_method']) { + case "get": + EditOfferController::get(); + break; + case "put": + EditOfferController::put(); + break; + case "delete": + EditOfferController::delete(); + break; + } + } +} |
