diff --git a/app/Config/Routes.php b/app/Config/Routes.php index d6eff62..c1686e5 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -9,8 +9,7 @@ $routes->get('/', 'Home::index'); $routes->post('/digibko/v1/identity/token', 'DigiFiAuth::startBkoToken'); - -$routes->get('/digibko/v1/loan/started', 'BkoReports::startedApplication'); +$routes->get('/digibko/v1/loan/started', 'BkoReports::startedApplication'); $routes->get('/digibko/v1/dashboard/bvn/recent', 'DigiFiAuth::startBkoToken'); @@ -20,6 +19,8 @@ $routes->post('/digiusers/v1/bvn', 'DigiFiBVN::startBVNVerify') $routes->post('/digiusers/v1/bvn/verify', 'DigiFiBVN::completeBVNVerify'); $routes->get('/digiusers/v1/dash', 'Users::userDash'); +$routes->get('/digiusers/v1/profile', 'Users::userProfile'); + $routes->post('/digiusers/v1/loan/apply', 'Loan::loanApply'); $routes->get('/digiusers/v1/loan/loanlist', 'Loan::loanlist'); diff --git a/app/Controllers/BkoReports.php b/app/Controllers/BkoReports.php index d84c28a..d52d8df 100644 --- a/app/Controllers/BkoReports.php +++ b/app/Controllers/BkoReports.php @@ -10,8 +10,14 @@ class BkoReports extends BaseController public function startedApplication() :ResponseInterface { //SELECT uid,loan_amount,payment_month,sales_agent,gender,marital_status,email,address,state,country,status,added,updated FROM applications; - - return $this->respond([], 200); + $query = $this->db->query("SELECT uid,loan_amount,payment_month,sales_agent,gender,marital_status,email,address,state,country,status,added,updated FROM applications "); + $row = $query->getResult('array'); + $data = [ + 'call_return' => '100', + 'records' => $row + ]; + return $this->respond($data, 200); + // return $this->respond([], 200); } public function pendingApplication() :ResponseInterface { diff --git a/app/Controllers/Loan.php b/app/Controllers/Loan.php index fc2954f..d6709f8 100644 --- a/app/Controllers/Loan.php +++ b/app/Controllers/Loan.php @@ -29,6 +29,13 @@ class Loan extends BaseController country VARCHAR(3), loan_detail TEXT, */ + // header('Access-Control-Allow-Origin: "*" '); + //header("Access-Control-Allow-Headers: Origin, X-API-KEY, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Authorization, observe, enctype, Content-Length, X-Csrf-Token"); +// log_message('critical', "0003"); +// header("Access-Control-Allow-Methods: GET, PUT, POST, DELETE, PATCH, OPTIONS"); +// header("Access-Control-Allow-Credentials: true"); +// header("Access-Control-Max-Age: 3600"); +// header('content-type: application/json; charset=utf-8'); $data = $this->request->getPost(); @@ -54,7 +61,7 @@ disbursement log_message('error', "UID3-employment--=>" . serialize( $data->employment)); log_message('error', "UID3-loan_reference--=>" . serialize( $data->loan_reference)); log_message('error', "UID3-disbursement--=>" . serialize( $data->disbursement)); - + // log_message('error', "UID3---=>" . $data2->customer_uid); // log_message('error', "UID4---=>" . $data2["customer_uid"]); diff --git a/app/Controllers/Users.php b/app/Controllers/Users.php index 3467648..77eed1e 100644 --- a/app/Controllers/Users.php +++ b/app/Controllers/Users.php @@ -27,4 +27,20 @@ class Users extends BaseController return $this->respond($data, 200); } + public function userProfile(){ + $in = $this->request->getGet(); + $data = []; + if ($in['uid'] !=''){ + $query = $this->db->query("SELECT * FROM customers WHERE uid = '".$in['uid']."' "); + $row = $query->getRowArray(); + $data = [ + 'call_return' => '100', + 'customer' => $row + ]; + return $this->respond($data, 200); + } + + + } + } \ No newline at end of file