From 0aa067b783ec3ba374380b82612eb876634c78f8 Mon Sep 17 00:00:00 2001
From: Syndamia
Date: Thu, 1 Apr 2021 13:27:08 +0300
Subject: Made index.php a router and added the basis of landing view and
controller
---
src/views/landing.php | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 src/views/landing.php
(limited to 'src/views')
diff --git a/src/views/landing.php b/src/views/landing.php
new file mode 100644
index 0000000..06e32a5
--- /dev/null
+++ b/src/views/landing.php
@@ -0,0 +1,7 @@
+Landing page!
+
+id} {$job->title}
";
+ }
+?>
--
cgit v1.3.1-26-gb76a
From f6b24f9842fbbc6add0bdf3732e5b9df5b6a4b5a Mon Sep 17 00:00:00 2001
From: Syndamia
Date: Sat, 3 Apr 2021 09:05:30 +0300
Subject: Added create (job) offer and view that have demo functionality (basic
post request and echo values)
---
src/controllers/CreateOfferController.php | 16 ++++++++++++++++
src/index.php | 5 +++++
src/views/create-offer.php | 19 +++++++++++++++++++
3 files changed, 40 insertions(+)
create mode 100644 src/controllers/CreateOfferController.php
create mode 100644 src/views/create-offer.php
(limited to 'src/views')
diff --git a/src/controllers/CreateOfferController.php b/src/controllers/CreateOfferController.php
new file mode 100644
index 0000000..d510978
--- /dev/null
+++ b/src/controllers/CreateOfferController.php
@@ -0,0 +1,16 @@
+Works
+
+
--
cgit v1.3.1-26-gb76a
From 56a5223e14f798e2c875c4347faecc4e2e9730fc Mon Sep 17 00:00:00 2001
From: Syndamia
Date: Sat, 3 Apr 2021 09:31:25 +0300
Subject: Implemented job offer form creating a new job offer in the database;
Fixed insertIntoDB method of JobOffer; Added a link to JobOffer page in
landing page
---
src/controllers/CreateOfferController.php | 15 ++++++++++-----
src/models/JobOffer.php | 2 +-
src/views/create-offer.php | 6 +++++-
src/views/landing.php | 2 ++
4 files changed, 18 insertions(+), 7 deletions(-)
(limited to 'src/views')
diff --git a/src/controllers/CreateOfferController.php b/src/controllers/CreateOfferController.php
index d510978..a223463 100644
--- a/src/controllers/CreateOfferController.php
+++ b/src/controllers/CreateOfferController.php
@@ -1,16 +1,21 @@
insertValue(self::TABLE_NAME, $jb->title, $jb->description, $jb->company, $jb->salary);
+ self::$DB->insertValue(self::TABLE_NAME, $jb->title, $jb->description, $jb->companyId, $jb->salary);
}
/* Read */
diff --git a/src/views/create-offer.php b/src/views/create-offer.php
index 2bdeeaf..9162c90 100644
--- a/src/views/create-offer.php
+++ b/src/views/create-offer.php
@@ -9,7 +9,11 @@
diff --git a/src/views/landing.php b/src/views/landing.php
index 06e32a5..e6477ee 100644
--- a/src/views/landing.php
+++ b/src/views/landing.php
@@ -5,3 +5,5 @@
echo "{$job->id} {$job->title}
";
}
?>
+
+Create a new Job Offer
--
cgit v1.3.1-26-gb76a
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 ++++++++
src/controllers/DashboardLoginController.php | 24 ++++++++++++++++++++++++
src/index.php | 5 +++++
src/views/dashboard-login.php | 12 ++++++++++++
src/views/dashboard.php | 1 +
5 files changed, 50 insertions(+)
create mode 100644 src/controllers/DashboardController.php
create mode 100644 src/controllers/DashboardLoginController.php
create mode 100644 src/views/dashboard-login.php
create mode 100644 src/views/dashboard.php
(limited to 'src/views')
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 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/dashboard.php b/src/views/dashboard.php
new file mode 100644
index 0000000..86c393a
--- /dev/null
+++ b/src/views/dashboard.php
@@ -0,0 +1 @@
+Dashboard works!
--
cgit v1.3.1-26-gb76a
From 3d40b19a379b7cd013283e623f773b760b281bdd Mon Sep 17 00:00:00 2001
From: Syndamia
Date: Sat, 3 Apr 2021 10:02:39 +0300
Subject: Added cross page links
---
src/views/create-offer.php | 3 +--
src/views/dashboard-login.php | 1 +
src/views/landing.php | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
(limited to 'src/views')
diff --git a/src/views/create-offer.php b/src/views/create-offer.php
index 9162c90..19f2186 100644
--- a/src/views/create-offer.php
+++ b/src/views/create-offer.php
@@ -1,5 +1,3 @@
-Works
-
+< Back
diff --git a/src/views/dashboard-login.php b/src/views/dashboard-login.php
index 1431b4f..a4cefe7 100644
--- a/src/views/dashboard-login.php
+++ b/src/views/dashboard-login.php
@@ -10,3 +10,4 @@
+< Back
diff --git a/src/views/landing.php b/src/views/landing.php
index e6477ee..d794d93 100644
--- a/src/views/landing.php
+++ b/src/views/landing.php
@@ -7,3 +7,4 @@
?>
Create a new Job Offer
+Dashboard
--
cgit v1.3.1-26-gb76a
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/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/views')
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-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')
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}
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')
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
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/views')
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}