diff --git a/api/application/config/constants.php b/api/application/config/constants.php index 2263fe46..2bc1dcef 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -448,6 +448,9 @@ defined('PDREPORTSVERSIONBLOBID') OR define('PDREPORTSVERSIONBLOBID','pd_report_ defined('ENTITYLENDERBRANCH') OR define('ENTITYLENDERBRANCH','m_entity_lender_branch'); defined('ENTITYLENDERBRANCHID') OR define('ENTITYLENDERBRANCHID','entity_lender_branch_id'); +defined('PDFORMDETAILSJSON') OR define('PDFORMDETAILSJSON','t_pd_form_details_json'); +defined('PDFORMDETAILSJSONID') OR define('PDFORMDETAILSJSONID','pd_form_detail_json_id'); + diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 696fba07..c634e0ef 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -174,13 +174,15 @@ $route['getListOfPDReportVersions'] = 'PD_Controller/getListOfPDReportVersions'; $route['swapOlderPDReportToLatest'] = 'PD_Controller/swapOlderPDReporttoLatest'; $route['filterPDList'] = 'PD_Controller/filterPDList'; $route['getQCLenderRemarks'] = 'PD_Controller/getQCLenderRemarks'; +// $route['savePDFormDetailsJSON'] = 'PD_Controller/savePDFormDetailsJSON'; +// $route['getPDFormDetailsJSON'] = 'PD_Controller/getPDFormDetailsJSON'; $route['smartyTestFunction'] = 'PD_Controller/smartyTestFunction'; $route['codeigniterViewTest'] = 'PD_Controller/codeigniterViewTest'; //PD Form Related -$route['getPDFormDetails'] = 'PD_Controller/getPDFormDetails'; -$route['savePDFormDetails'] = 'PD_Controller/savePDFormDetails'; +$route['getPDFormDetails'] = 'PD_Controller/getPDFormDetailsJSON'; +$route['savePDFormDetails'] = 'PD_Controller/savePDFormDetailsJSON'; $route['getFinalPDReportQuestions'] = 'PD_Controller/getFinalPDReportQuestions'; $route['getTypeOfActivetyFromBusinessForm'] = 'PD_Controller/getTypeOfActivetyFromBusinessForm'; diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 71c77dc4..dfc87856 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -2028,7 +2028,73 @@ class PD_Controller extends REST_Controller { } + public function savePDFormDetailsJSON_post() + { + $records = $this->post('records'); + + $pdid = $records['pdid']; + $formid = $records['formid']; + $createdby = $records['fk_createdby']; + + $fields = array('isactive' => 0); + $where_condition_array = array('fk_form_id'=>$formid,'fk_pd_id'=>$pdid); + $id = $this->PD_Model->updateRecords($fields,PDFORMDETAILSJSON,$where_condition_array); + unset($records['pdid']); + unset($records['formid']); + unset($records['fk_createdby']); + $records = json_encode($records); + + $temp_array = array('fk_form_id'=>$formid,'fk_pd_id'=>$pdid,'fk_createdby'=>$createdby,'json'=>$records); + $id = $this->PD_Model->saveRecords($temp_array,PDFORMDETAILSJSON); + if($id != "" || $id != null) + { + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = $id; + $this->response($data,REST_Controller::HTTP_OK); + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NOT_MODIFIED; + $data['msg'] = 'Something Went Wrong! Try Later..!'; + $this->response($data,REST_Controller::HTTP_OK); + } + + } + + + public function getPDFormDetailsJSON_post() + { + $pd_id = $this->post('pd_id'); + $pd_form_id = $this->post('pd_form_id'); + + $fields = array('json'); + $where_condition_array = array('isactive' => 1,'fk_form_id'=>$pd_form_id,'fk_pd_id'=>$pd_id); + $rec = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON); + // print_r($rec);die(); + if(count($rec)) + { + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = json_decode($rec[0]['json']); + $this->response($data,REST_Controller::HTTP_OK); + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NOT_MODIFIED; + $data['msg'] = 'Something Went Wrong! Try Later..!'; + $this->response($data,REST_Controller::HTTP_OK); + } + + } + + public function downloadExcel_post() + { + + } //Save Co applicants details from General Form public function saveCoApplicantsFromGeneralInfoForm($records) { @@ -3588,7 +3654,7 @@ class PD_Controller extends REST_Controller { } else if($records['flag'] == 'QC_REMARKS') { - $fields = array('qc_remarks_remarks','pd_status'); + $fields = array('qc_remarks','pd_status'); } $where_condition_array = array('pd_id'=>$pdid);