diff options
Made job offers show all info
4 files changed, 14 insertions, 2 deletions
| -rw-r--r-- | src/controllers/DashboardController.php | 6 | ||||
| -rw-r--r-- | src/controllers/LandingController.php | 6 | ||||
| -rw-r--r-- | src/views/dashboard.php | 2 | ||||
| -rw-r--r-- | src/views/landing.php | 2 |
diff --git a/src/controllers/DashboardController.php b/src/controllers/DashboardController.php index 5bd26d4..548f60b 100644 --- a/src/controllers/DashboardController.php +++ b/src/controllers/DashboardController.php @@ -1,11 +1,17 @@ <?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"; } diff --git a/src/controllers/LandingController.php b/src/controllers/LandingController.php index aa28505..ffa8644 100644 --- a/src/controllers/LandingController.php +++ b/src/controllers/LandingController.php @@ -1,10 +1,16 @@ <?php include_once("models/JobOffer.php"); +include_once('models/Company.php'); include_once("controllers/BaseController.php"); class LandingController extends BaseController { + private static $companies = array(); + public static function get() { $jobs = JobOffer::getAllFromDB(); + foreach(Company::getAllFromDB() as $company) { + self::$companies[$company->id] = $company->name; + } include "views/landing.php"; } } diff --git a/src/views/dashboard.php b/src/views/dashboard.php index 2312419..9060317 100644 --- a/src/views/dashboard.php +++ b/src/views/dashboard.php @@ -1,6 +1,6 @@ <?php foreach($jobs as $job) { - echo "{$job->id} {$job->title} + echo "{$job->id} {$job->title} {$job->description} " . self::$companies[$job->companyId] . " {$job->salary} <form method=\"post\"> <input type=\"hidden\" name=\"_method\" value=\"get\"> <input type=\"hidden\" name=\"jobId\" value=\"{$job->id}\"> diff --git a/src/views/landing.php b/src/views/landing.php index d794d93..1bd679c 100644 --- a/src/views/landing.php +++ b/src/views/landing.php @@ -2,7 +2,7 @@ <?php foreach($jobs as $job) { - echo "{$job->id} {$job->title}<br>"; + echo "{$job->title} {$job->description} " . self::$companies[$job->companyId] . " {$job->salary}<br>"; } ?> |
