From 68808a388a61c7a778494739fe0150651a09ea66 Mon Sep 17 00:00:00 2001
From: Syndamia
Date: Sat, 3 Apr 2021 09:58:18 +0300
Subject: Implemented a simple login page for (admin) dashboard and skeleton of
dashboard controller and view
---
src/controllers/DashboardController.php | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 src/controllers/DashboardController.php
(limited to 'src/controllers/DashboardController.php')
diff --git a/src/controllers/DashboardController.php b/src/controllers/DashboardController.php
new file mode 100644
index 0000000..84beb14
--- /dev/null
+++ b/src/controllers/DashboardController.php
@@ -0,0 +1,8 @@
+
Date: Sat, 3 Apr 2021 10:36:27 +0300
Subject: Added skeleton of edit offer and implemented edit and delete buttons
in dashboard offers
---
src/controllers/DashboardController.php | 14 ++++++++++++++
src/controllers/DashboardLoginController.php | 8 ++++++--
src/controllers/EditOfferController.php | 5 +++++
src/views/dashboard.php | 17 ++++++++++++++++-
src/views/edit-offer.php | 1 +
5 files changed, 42 insertions(+), 3 deletions(-)
create mode 100644 src/controllers/EditOfferController.php
create mode 100644 src/views/edit-offer.php
(limited to 'src/controllers/DashboardController.php')
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 @@
Dashboard works!
+id} {$job->title}
+
+
+
";
+ }
+?>
diff --git a/src/views/edit-offer.php b/src/views/edit-offer.php
new file mode 100644
index 0000000..957fc3d
--- /dev/null
+++ b/src/views/edit-offer.php
@@ -0,0 +1 @@
+Works!
--
cgit v1.3.1-23-gd82d
From 7677c0edd617c7c6174ec2615febe6599b93cf15 Mon Sep 17 00:00:00 2001
From: Syndamia
Date: Sat, 3 Apr 2021 11:01:48 +0300
Subject: Fixed dashboard controller redirection to edit offer controller
---
src/controllers/DashboardController.php | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
(limited to 'src/controllers/DashboardController.php')
diff --git a/src/controllers/DashboardController.php b/src/controllers/DashboardController.php
index 7c01efa..5bd26d4 100644
--- a/src/controllers/DashboardController.php
+++ b/src/controllers/DashboardController.php
@@ -10,13 +10,16 @@ class DashboardController extends BaseController {
}
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();
+ switch($_POST['_method']) {
+ case "get":
+ EditOfferController::get();
+ break;
+ case "put":
+ EditOfferController::put();
+ break;
+ case "delete":
+ EditOfferController::delete();
+ break;
}
}
}
--
cgit v1.3.1-23-gd82d
From 1180687f951cbb0ebf1b2fd9e22df5b2a20fea9b Mon Sep 17 00:00:00 2001
From: Syndamia
Date: Sat, 3 Apr 2021 11:34:24 +0300
Subject: Made job offers show all info
---
src/controllers/DashboardController.php | 6 ++++++
src/controllers/LandingController.php | 6 ++++++
src/views/dashboard.php | 2 +-
src/views/landing.php | 2 +-
4 files changed, 14 insertions(+), 2 deletions(-)
(limited to 'src/controllers/DashboardController.php')
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 @@
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 @@
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 @@
id} {$job->title}
+ echo "{$job->id} {$job->title} {$job->description} " . self::$companies[$job->companyId] . " {$job->salary}