Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
Commit1180687f951cbb0ebf1b2fd9e22df5b2a20fea9b (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-04-03 11:34:24 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-04-03 11:34:24 +0300
Files05038d9e745ea71c91c550178185de4236e01340 /src
devrix-job-board-1180687f951cbb0ebf1b2fd9e22df5b2a20fea9b.tar
devrix-job-board-1180687f951cbb0ebf1b2fd9e22df5b2a20fea9b.tar.gz
devrix-job-board-1180687f951cbb0ebf1b2fd9e22df5b2a20fea9b.zip
Parent9362d6fdfd566f3cc611a02437c6dbdce4f0504b (diff)
Made job offers show all info
4 files changed, 14 insertions, 2 deletions
-rw-r--r--src/controllers/DashboardController.php6
-rw-r--r--src/controllers/LandingController.php6
-rw-r--r--src/views/dashboard.php2
-rw-r--r--src/views/landing.php2
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>";
}
?>