diff --git a/api/application/config/constants.php b/api/application/config/constants.php index 528bcc35..afe37b78 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -466,6 +466,9 @@ defined('PDBUSINESSINCOMEID') OR define('PDBUSINESSINCOMEID','pd_business_income defined('COUNTRY') OR define('COUNTRY','m_countries'); defined('COUNTRYID') OR define('COUNTRYID','country_id'); +defined('PDOFFICERCURRENTLOCATION') OR define('PDOFFICERCURRENTLOCATION','t_pd_officer_current_location'); +defined('PDOFFICERCURRENTLOCATIONID') OR define('PDOFFICERCURRENTLOCATIONID','pd_officer_current_location_id'); + diff --git a/api/application/config/routes.php b/api/application/config/routes.php index a1fba038..5853fb94 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -181,6 +181,9 @@ $route['swapOlderPDReportToLatest'] = 'PD_Controller/swapOlderPDReporttoLatest'; $route['filterPDList'] = 'PD_Controller/filterPDList'; $route['getQCLenderRemarks'] = 'PD_Controller/getQCLenderRemarks'; $route['downloadExcel'] = 'PD_Controller/downloadExcel'; +$route['getEndUseOfLoan'] = 'PD_Controller/getEndUseOfLoan'; +$route['savePDOfficerCurrentLocation'] = 'PD_Controller/savePDOfficerCurrentLocation'; +$route['getPDOfficerCurrentLocation'] = 'PD_Controller/getPDOfficerCurrentLocation'; // $route['savePDFormDetailsJSON'] = 'PD_Controller/savePDFormDetailsJSON'; // $route['getPDFormDetailsJSON'] = 'PD_Controller/getPDFormDetailsJSON'; diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index d3e58d83..1bb9d90d 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -3901,8 +3901,8 @@ class PD_Controller extends REST_Controller { // } $data['pd_processed_forms'][$i] = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON); } - // print_r($data['pd_processed_forms']); - print_r(json_decode($data['pd_processed_forms'][13][0]['processed_json'],true)); + print_r($data['pd_processed_forms']); + // print_r(json_decode($data['pd_processed_forms'][13][0]['processed_json'],true)); // echo count($data['pd_processed_forms'][1]); // die(); @@ -4069,5 +4069,86 @@ class PD_Controller extends REST_Controller { } + public function getEndUseOfLoan_post() + { + $records = $this->post('records'); + $pdid = $records['pd_id']; + + $pd_master_details = $this->PD_Model->getPDMasterDetails($pdid); + //print_r($pd_master_details); + if($pd_master_details[0]['fk_subproduct_id'] != "" || $pd_master_details[0]['fk_subproduct_id'] != null) + { + + $fields = array('*'); + $where_condition_array = array('isactive' => 1,'fk_subproduct_id' => $pd_master_details[0]['fk_subproduct_id']); + $result_data = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,ENDUSEOFLOAN); + if(count($result_data)) + { + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = $result_data; + $this->response($data,REST_Controller::HTTP_OK); + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NO_CONTENT; + $data['msg'] = 'No Data Found for End Use Of Loan!'; + $this->response($data,REST_Controller::HTTP_OK); + } + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NO_CONTENT; + $data['msg'] = 'Sub Product Not Choosen for this PD!'; + $this->response($data,REST_Controller::HTTP_OK); + + } + + } + + + public function savePDOfficerCurrentLocation_post() + { + $pdid = $this->post('pd_id'); + $current_location = $this->post('link'); + $record_data = array('fk_pd_id' => $pdid,'current_location'=>$current_location); + $id = $this->PD_Model->saveRecords($record_data,PDOFFICERCURRENTLOCATION); + + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['record'] = $id; + $this->response($data,REST_Controller::HTTP_OK); + + + } + + public function getPDOfficerCurrentLocation_post() + { + $pdid = $this->post('pd_id'); + + + $result_data = $this->db->SELECT('*')->FROM(PDOFFICERCURRENTLOCATION)->WHERE('fk_pd_id',$pdid)->ORDER_BY(PDOFFICERCURRENTLOCATIONID,'DESC')->LIMIT(1)->GET()->result_array(); + + if(count($result_data)) + { + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['record'] = $result_data; + $this->response($data,REST_Controller::HTTP_OK); + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NO_CONTENT; + $data['msg'] = 'No Records Found!'; + $this->response($data,REST_Controller::HTTP_OK); + } + + + } + + } \ No newline at end of file