From 81fe26ebc78d45f7967ce68f6983dea21cf7ea99 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 13 Jun 2024 11:16:26 -0400 Subject: [PATCH] employer verify --- app/Config/Routes.php | 2 +- app/Controllers/BkoReports.php | 23 ++++------------------- app/Controllers/Employers.php | 12 ++++++++++++ 3 files changed, 17 insertions(+), 20 deletions(-) create mode 100644 app/Controllers/Employers.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 1519cff..7c0984f 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -26,7 +26,7 @@ $routes->get('/digibko/v1/employers', 'BkoReports::employersList'); $routes->get('/digibko/v1/employers/signatory', 'BkoReports::signatoryList'); $routes->post('/digibko/v1/employers/signatory', 'BkoReports::signatoryAdd'); -$routes->post('/digibko/v1/employers/verify', 'BkoReports::signatoryAdd'); +$routes->post('/digibko/v1/employers/verify', 'Employers::verifyEmployer'); $routes->get('/digibko/v1/users', 'BkoReports::listUsers'); diff --git a/app/Controllers/BkoReports.php b/app/Controllers/BkoReports.php index a9bca50..4bbd272 100644 --- a/app/Controllers/BkoReports.php +++ b/app/Controllers/BkoReports.php @@ -33,7 +33,6 @@ class BkoReports extends BaseController 'records' => $row ]; return $this->respond($data, 200); - // return $this->respond([], 200); } public function pendingApplication() :ResponseInterface @@ -47,7 +46,6 @@ class BkoReports extends BaseController 'records' => $row ]; return $this->respond($data, 200); - // return $this->respond([], 200); } private function applicationQuery($status): string{ @@ -77,45 +75,32 @@ class BkoReports extends BaseController 'records' => $row ]; return $this->respond($data, 200); - // return $this->respond([], 200); } public function approvedApplication() :ResponseInterface { + $approvedQuery = $this->applicationQuery(5); //SELECT uid,loan_amount,payment_month,sales_agent,gender,marital_status,email,address,state,country,status,added,updated FROM applications; - $query = $this->db->query("SELECT c.firstname, c.lastname, a.uid,a.loan_amount, - a.payment_month,a.sales_agent,a.gender, - a.marital_status,a.email,a.address, - a.state,a.country,a.status,a.added, - a.updated - FROM applications a - LEFT JOIN customers c ON c.uid = a.customer_uid WHERE a.status = 5 "); + $query = $this->db->query($approvedQuery); $row = $query->getResult('array'); $data = [ 'call_return' => '100', 'records' => $row ]; return $this->respond($data, 200); - // return $this->respond([], 200); } public function rejectedApplication() :ResponseInterface { + $rejectedQuery = $this->applicationQuery(7); //SELECT uid,loan_amount,payment_month,sales_agent,gender,marital_status,email,address,state,country,status,added,updated FROM applications; - $query = $this->db->query("SELECT c.firstname, c.lastname, a.uid,a.loan_amount, - a.payment_month,a.sales_agent,a.gender, - a.marital_status,a.email,a.address, - a.state,a.country,a.status,a.added, - a.updated - FROM applications a - LEFT JOIN customers c ON c.uid = a.customer_uid WHERE a.status = 7 "); + $query = $this->db->query($rejectedQuery); $row = $query->getResult('array'); $data = [ 'call_return' => '100', 'records' => $row ]; return $this->respond($data, 200); - // return $this->respond([], 200); } public function employersList() :ResponseInterface { diff --git a/app/Controllers/Employers.php b/app/Controllers/Employers.php new file mode 100644 index 0000000..f0d3cc2 --- /dev/null +++ b/app/Controllers/Employers.php @@ -0,0 +1,12 @@ +