From c7d4aeb0b880e98c136cef1ae054d00eed8d2a1d Mon Sep 17 00:00:00 2001 From: velz Date: Mon, 24 Dec 2018 16:33:25 +0530 Subject: [PATCH] QC LENDER REMARKS --- api/application/config/routes.php | 1 + api/application/controllers/PD_Controller.php | 40 ++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 0a9b4caf..696fba07 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -173,6 +173,7 @@ $route['saveNewVersionOfPDReport'] = 'PD_Controller/saveNewVersionOfPDReport'; $route['getListOfPDReportVersions'] = 'PD_Controller/getListOfPDReportVersions'; $route['swapOlderPDReportToLatest'] = 'PD_Controller/swapOlderPDReporttoLatest'; $route['filterPDList'] = 'PD_Controller/filterPDList'; +$route['getQCLenderRemarks'] = 'PD_Controller/getQCLenderRemarks'; $route['smartyTestFunction'] = 'PD_Controller/smartyTestFunction'; $route['codeigniterViewTest'] = 'PD_Controller/codeigniterViewTest'; diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index b1d1f0ad..bfc589b1 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -1861,8 +1861,13 @@ class PD_Controller extends REST_Controller { if(!is_array($record))//check key and value pair is not an array { + if($rec_key == 'selected_person') + { + echo "selected_person-".$record; + } $temp_array = array('fk_pd_id'=>$pd_id,'fk_form_id'=>$pd_form_id,'column_name'=>$rec_key,'column_value'=>$record,'fk_createdby'=>$fk_createdby); $id = $this->PD_Model->saveRecords($temp_array,PDFORMDETAILS); + } else // array of key value pairs { @@ -3059,7 +3064,7 @@ class PD_Controller extends REST_Controller { $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; - $data['records'] = $urls; + $data['records'] = array('pdstatus' => $pd_master_details[0]['pd_status'],'reports_urls' => $urls); $this->response($data,REST_Controller::HTTP_OK); } else @@ -3563,4 +3568,37 @@ class PD_Controller extends REST_Controller { } + public function getQCLenderRemarks_post() + { + $records = $this->post('records'); + + $pdid = $records['pd_id']; + $fields = array(); + if($records['flag'] == 'QC') + { + $fields = array('qc_remarks','qc_rating'); + } + else if($records['flag'] == 'LENDER') + { + $fields = array('lender_remarks','lender_rating'); + } + + $where_condition_array = array('pd_id'=>$pdid); + $result = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDTRIGGER); + if(count($result)) + { + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = $result; + $this->response($data,REST_Controller::HTTP_OK); + } + else + { $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NO_CONTENT; + $data['msg'] = 'No Remarks Available for this PD!'; + $this->response($data,REST_Controller::HTTP_OK); + + } + } + } \ No newline at end of file