From 1439da26342862b8ffc18b4b8a12143b757f05bc Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Mon, 24 Aug 2020 21:14:04 +0530 Subject: [PATCH] SMC CREDITPD 3 --- api/application/config/routes.php | 1 + .../controllers/Common_Masters_Controller.php | 6 +++- .../controllers/SMC_Credit_PD_Controller.php | 34 +++++++++++++++++-- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/api/application/config/routes.php b/api/application/config/routes.php index bd93bc8e..834d21c4 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -296,4 +296,5 @@ $route['saveSMCCreditPD'] = 'SMC_Credit_PD_Controller/saveSMCCreditPD'; $route['saveSMCCreditPDImage'] = 'SMC_Credit_PD_Controller/saveSMCCreditPDImage'; $route['saveSMCCreditPDsection'] = 'SMC_Credit_PD_Controller/saveSMCCreditPDsection'; $route['getSMCCreditPDSectionData'] = 'SMC_Credit_PD_Controller/getSMCCreditPDSectionData'; +$route['getStakeHoldersInfo'] = 'SMC_Credit_PD_Controller/getStakeHoldersInfo'; diff --git a/api/application/controllers/Common_Masters_Controller.php b/api/application/controllers/Common_Masters_Controller.php index b8bd9ec5..25ef374a 100644 --- a/api/application/controllers/Common_Masters_Controller.php +++ b/api/application/controllers/Common_Masters_Controller.php @@ -1195,7 +1195,11 @@ class Common_Masters_Controller extends REST_Controller { { $config['default_pd_list_count']['count'] = '60'; $config['default_pd_list_count']['factor'] = 'Days'; - + + //Sales PD section to be fetch in SMC Credit PD section_id section_name + $section_names = array(array('section_id' => '1','section_name' => 'General Section'),array('section_id' => '2', 'section_name'=> 'Fund Requirement'),array('section_id' => '3', 'section_name'=> 'stakeholders'),array('section_id' => '4', 'section_name' => 'Brief of business'),array('section_id' => '5', 'section_name' => 'Financial'),array('section_id' => '6', 'section_name' => 'Property Details'),array('section_id' => '7', 'section_name' => 'Final Remraks'),array('section_id' => '8', 'section_name' => 'Officer Details'),array('section_id' => '9', 'section_name' => 'Photography')); + + $config['sales_pd_section_to_fetch'] = $section_names; $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; $data['records'] = $config; diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 5db7c557..f5b6eeee 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -679,7 +679,8 @@ class SMC_Credit_PD_Controller extends REST_Controller { $smc_credit_pd = $records['smc_credit_pd']; $section_id = $records['section_id']; $fk_createdby = $records['fk_createdby']; - $status = $records['is_complete']; + //$status = $records['is_complete']; + $status = 1; $section_data = json_encode($records); //Get Sales PD master Data @@ -1119,7 +1120,7 @@ public function filterSalesPDList_post() { { //separate mobile no - print_r( json_decode($gen_form[0]['section_data'],true)); + //print_r( json_decode($gen_form[0]['section_data'],true)); $msg = "Dear Applicant, Please click the link to upload the photographs. " . SALESPD_CUSTOMER_IMG_URL .$random_string; echo $msg;die(); @@ -1160,6 +1161,35 @@ public function filterSalesPDList_post() { } } + + + function getStakeHoldersInfo_post() + { + $stakeholders = $this->SMC_Credit_PD_Model->selectCustomRecords(array('*'),array('smc_credit_pd' => $this->post('smc_credit_pd'),'section_id' => 3,'isactive' => 1),SMC_CREDIT_PD_SECTION_DATA); + + if(count($stakeholders)) + { + $stakeholders = json_decode($stakeholders[0]['section_data'],true); + $stakeholders = $stakeholders['questions'][0]['questions_group']; + $result_data = array(); + foreach($stakeholders as $k => $s) + { + $result_data[] = $s['questions']['0']['answer_value']; + } + + $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_NOT_FOUND; + $data['msg'] = 'Mobile No Not Found!'; + $this->response($data,REST_Controller::HTTP_OK); + } + } } \ No newline at end of file