From d9c97849384442e26882cf17d015df7b02b3d697 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Fri, 14 Aug 2020 00:00:30 +0530 Subject: [PATCH] DUP PD FEEDBACK --- api/application/controllers/PD_Controller.php | 126 ++++++++++++++---- 1 file changed, 103 insertions(+), 23 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index ada3a8ac..fe3f3f3d 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -2937,7 +2937,7 @@ public function getPDFormDetailsJSON_post() $custom_log_info = '###Get General FOrm IMG AWS urls & attach into JSON Function Called - ('. $pd_id.' - '. $pd_form_id.') - ' . date('Y-m-d H:i:s A'); log_message('ERROR',$custom_log_info); $result_data = $this->PD_Model->getSignedPDDocsURL($pd_id,18,null,null,null); - //print_r($result_data); + foreach($temp_rec['individuals'] as $g_key => $g_value) { //print_r( $g_value); @@ -9712,7 +9712,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() - // Get All Applicant's Details + //Get All Applicant's Details $applicants_details = $this->PD_Model->selectCustomRecords(array('pd_co_applicant_id','applicant_name', 'applicant_type', 'mobile_no','relation', 'company_name', 'applicant_title_name','landline'),array('fk_pd_id' => $pdid),PDAPPLICANTSDETAILS); //print_r($applicants_details); @@ -9732,7 +9732,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() } - // Get All PD Related Documents + //Get All PD Related Documents // $pd_documnets = $this->PD_Model->selectCustomRecords(array('fk_pd_id','fk_form_id', 'co_applicant_id', 'img_type', 'pd_document_title', 'pd_document_name','company_id', 'is_show_report', 'rental_count_id','location', 'isactive'),array('isactive' => 1,'fk_pd_type' => $pdid),PDDOCUMENTS); // if(!$new_pd_id && count($applicants_details)) // { @@ -9807,6 +9807,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $json_data = $this->PD_Model->getAllJSONFormData($pdid); if($new_pd_id && count($json_data)) { + log_message('ERROR','####Copying All JSON Data started:-'.$new_pd_id); foreach ($json_data as $key => $value) { @@ -9815,12 +9816,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() if(in_array($value['fk_form_id'], $form_ids_to_replace_new_co_applicants_id)) { - // echo '*****************************************BEFORE***'; - // print_r(json_decode($value['json'])); - //print_r($applicants_ids_array); $current_form_string = ($value['json']); - //print_r($gen_form_string); - //replace old applicant id with new applicant id in gen form foreach ($applicants_ids_array as $old_value => $new_value) { $current_form_string = str_replace( $old_value, $new_value, $current_form_string); @@ -9829,20 +9825,12 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() //replace pd id $current_form_string = str_replace( $pdid, $new_pd_id, $current_form_string); $value['json'] = $current_form_string; - // print_r($gen_form_string); - // die(); - // echo '##########################################################################################################'; - // print_r(json_decode($value['json'])); - // echo '**************************************************************************************************************'; - + } if($value['fk_form_id'] == 24)//credit managers query form { - // print_r($docs_to_be_uploads_ids_array);print_r($add_req_ids_array); - // echo '*****************************************BEFORE***'; - // print_r(json_decode($value['json'])); - //print_r($applicants_ids_array); + $current_form_string = ($value['json']); //print_r($gen_form_string); // @@ -9858,12 +9846,18 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $current_form_string = str_replace( $pdid, $new_pd_id, $current_form_string); $value['json'] = $current_form_string; - // print_r($gen_form_string); - // die(); - //echo '##########################################################################################################'; - //print_r(json_decode($value['json'])); - //echo '**************************************************************************************************************'; + } + + //replace old img string from gen & busi forms + if($value['fk_form_id'] == 18 || $value['fk_form_id'] == 13) + { + //print_r($value); + $value = $this->emptyImgStringsInsideJSON($value); + //print_r($value); + } + + //die(); $this->PD_Model->saveRecords($value,PDFORMDETAILSJSON); } @@ -9907,6 +9901,92 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() } + function emptyImgStringsInsideJSON($value) + { + + if($value['fk_form_id'] == 18) + { + $temp_json = (json_decode($value['json'],true)); + if(isset($temp_json['individuals']) && count($temp_json['individuals'])) + { + foreach ($temp_json['individuals'] as $tj_key => $tj_value) + { + if($tj_value['is_applicant'] == 1) + { + $temp_json['individuals'][$tj_key]['is_person_met_pic'] = ''; + $temp_json['individuals'][$tj_key]['is_person_met_id_proof'] = ''; + } + } + } + $value['json'] = json_encode($temp_json); + + } + + if($value['fk_form_id'] == 13) + { + $temp_json = (json_decode($value['json'],true)); + if(isset($temp_json['shop_eat_act_cert_pic'])) + { + $temp_json['shop_eat_act_cert_pic'] = ""; + } + if(isset($temp_json['practice_cert_pic'])) + { + $temp_json['practice_cert_pic'] = ""; + } + if(isset($temp_json['gst_Regn_cert_pic'])) + { + $temp_json['gst_Regn_cert_pic'] = ''; + } + if(isset($temp_json['pf_regn_pic'])) + { + $temp_json['pf_regn_pic'] =''; + } + if(isset($temp_json['esic_regn_pic'])) + { + $temp_json['esic_regn_pic'] = ''; + } + if(isset($temp_json['pd_document_title'])) + { + $temp_json['export_import_cert_pic'] = ''; + } + if(isset($temp_json['pd_document_title'])) + { + $temp_json['factory_cert_pic'] = $temp_json['doc_url']; + } + if(isset($temp_json['pd_document_title'])) + { + $temp_json['practice_cert_pic'] = ''; + } + if(isset($temp_json['fire_noc_pic'] )) + { + $temp_json['fire_noc_pic'] = ''; + } + if(isset($temp_json['pd_document_title'])) + { + $temp_json['eb_bill_pic'] = ''; + } + + + if(isset($temp_json['documents']) && count($temp_json['documents'])) + { + $temp_iter = $temp_json['documents']; + + foreach ($temp_iter as $tikey => $itvalue) + { + $temp_json['documents'][$tikey]['document_pic'] = ''; + } + } + + $value['json'] = json_encode($temp_json); + + + } + + return $value; + //die(); + } + + function dupAssessedIncomeInfo($pdid,$new_pd_id,$fk_createdby) { //$new_pd_id = 9999;