From 1856de8c22af1a762961547f042891d5b6f9455c Mon Sep 17 00:00:00 2001 From: Syndamia 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/views/edit-offer.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/views/edit-offer.php (limited to 'src/views/edit-offer.php') 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-26-gb76a From fcab2fc159a64c0c5dc9f6181a7bbca2f331acf6 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 3 Apr 2021 11:04:23 +0300 Subject: Implemented get, put and delete requests for edit offer controller; Implemented edit-offer view --- src/controllers/EditOfferController.php | 25 +++++++++++++++++++++++++ src/views/dashboard.php | 2 +- src/views/edit-offer.php | 25 ++++++++++++++++++++++++- 3 files changed, 50 insertions(+), 2 deletions(-) (limited to 'src/views/edit-offer.php') diff --git a/src/controllers/EditOfferController.php b/src/controllers/EditOfferController.php index 950b6dc..ae49c5b 100644 --- a/src/controllers/EditOfferController.php +++ b/src/controllers/EditOfferController.php @@ -1,5 +1,30 @@ id = $_POST['id']; + JobOffer::updateFromDB($newJobOffer); + + DashboardController::get(); + } + + public static function delete() { + JobOffer::deleteFromDB($_POST['jobId']); + + DashboardController::get(); + } } diff --git a/src/views/dashboard.php b/src/views/dashboard.php index b1b648c..2312419 100644 --- a/src/views/dashboard.php +++ b/src/views/dashboard.php @@ -2,7 +2,7 @@ foreach($jobs as $job) { echo "{$job->id} {$job->title}
- + id}\">
diff --git a/src/views/edit-offer.php b/src/views/edit-offer.php index 957fc3d..b9fb464 100644 --- a/src/views/edit-offer.php +++ b/src/views/edit-offer.php @@ -1 +1,24 @@ -

Works!

+
+ + + +
+ + +
+ + +
+ + +
+ + +
-- cgit v1.3.1-26-gb76a From 9362d6fdfd566f3cc611a02437c6dbdce4f0504b Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 3 Apr 2021 11:07:46 +0300 Subject: Added a link to dashboard in edit offer view and enabled login screen in dashboard --- src/controllers/DashboardLoginController.php | 3 +-- src/views/edit-offer.php | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/views/edit-offer.php') diff --git a/src/controllers/DashboardLoginController.php b/src/controllers/DashboardLoginController.php index 775b96f..fe2009b 100644 --- a/src/controllers/DashboardLoginController.php +++ b/src/controllers/DashboardLoginController.php @@ -6,8 +6,7 @@ class DashboardLoginController extends BaseController { private static $message; public static function get() { - // include "views/dashboard-login.php"; - DashboardController::invoke(); + include "views/dashboard-login.php"; } public static function post() { diff --git a/src/views/edit-offer.php b/src/views/edit-offer.php index b9fb464..a6d699e 100644 --- a/src/views/edit-offer.php +++ b/src/views/edit-offer.php @@ -22,3 +22,4 @@ +< Back to Dashboard -- cgit v1.3.1-26-gb76a