renaming Existing PD info : ps

This commit is contained in:
VE10-Sanjeev 2022-08-20 22:18:44 +05:30
parent 5a308b7544
commit b9c5ef3d1f
4 changed files with 440 additions and 3 deletions

View File

@ -398,3 +398,5 @@ $route['archivePDSMCImages'] = 'SMC_Credit_PD_Controller/archivePDImages';
$route['smcPhotoPDFDownload'] = 'SMC_Credit_PD_Controller/imgPDFDownload';
$route['myFunction']='Flyhi_Controller/myFunction';
$route['previewDigiLockerDocs']='Flyhi_Controller/previewDigiLockerDocs';
$route['renamingExistingPDinfo']='Data_Dump_Controller/renamingExistingPDinfo';

View File

@ -495,4 +495,439 @@ class Data_Dump_Controller extends REST_Controller {
log_message('ERROR',"#/# G-Sheet Final PDID : ".$pd_id);
return $pd_id;
}
// delete Old PD.
// step 1 : DB-tables update
// step 2 : json and processed_json
// step 3 : rar images docs.....
// step 4 : processjson inactive data deleted..
//working fine on tables.
public function deleteOldPDbk_up_get(){
$_90th_date = date("Y/m/d",strtotime('-90 days'));
$columns = array('PDTRIGGER.pd_id','PDTRIGGER.addressline1','PDTRIGGER.addressline2','PDTRIGGER.addressline3','PDTRIGGER.pd_contact_mobileno','PDTRIGGER.pd_contact_landline','PDTRIGGER.pd_sno','DATE_FORMAT(PDTRIGGER.createdon, "%d/%m/%Y") as createdon','PDAPPLICANTSDETAILS.pd_co_applicant_id','PDTRIGGER.pd_contact_person_mail');
$table = PDTRIGGER.' as PDTRIGGER';
$joins = array(array('table' => PDAPPLICANTSDETAILS. ' as PDAPPLICANTSDETAILS',
'condition' =>'PDAPPLICANTSDETAILS.fk_pd_id = PDTRIGGER.pd_id AND PDAPPLICANTSDETAILS.isactive = 1 AND PDAPPLICANTSDETAILS.applicant_type = 1',
'jointype' => 'LEFT'));
$tgr_cond_arr = array('PDTRIGGER.pd_status' => QC_COMPLETED ,'DATE_FORMAT(PDTRIGGER.createdon, "%d/%m/%Y") <=' => $_90th_date );
$tgr_dtls = $this->PD_Model->getJoinRecords($columns,$table,$joins,$tgr_cond_arr);
$i = 0; // testing Purpose only
// for($i = 0 ;$i < count($tgr_dtls);$i++){
$pdid = $tgr_dtls[$i]['pd_id'];
$pdsno = $tgr_dtls[$i]['pd_sno'];
$pdappcntid = $tgr_dtls[$i]['pd_co_applicant_id'];
$general_format = $pdsno."-".$pdid."-".$pdappcntid;
$updt_on_tgr['addressline1'] = $tgr_dtls[$i]['addressline1'] ? $general_format.' - addressline1' : null ;
$updt_on_tgr['addressline2'] = $tgr_dtls[$i]['addressline2'] ? $general_format.' - addressline2' : null ;
$updt_on_tgr['addressline3'] = $tgr_dtls[$i]['addressline3'] ? $general_format.' - addressline3' : null ;
$updt_on_tgr['pd_contact_mobileno'] = $tgr_dtls[$i]['pd_contact_mobileno'] ? $general_format.' - mobileno' : null;
$updt_on_tgr['pd_contact_landline'] = $tgr_dtls[$i]['pd_contact_landline'] ? $general_format.' - landline' : null;
$updt_on_tgr['pd_contact_person_mail'] = $tgr_dtls[$i]['pd_contact_person_mail'] ? $general_format.' - person_mail' : null;
$updt_tgr_where = array('pd_id' => $pdid,'pd_status' => QC_COMPLETED);
$this->PD_Model->updateRecords($updt_on_tgr,PDTRIGGER,$updt_tgr_where);
if(!empty($pdid)){
$apcnt_fields = array('pd_co_applicant_id', 'mobile_no', 'additional_mobile_no', 'landline', 'email', 'addressline1', 'addressline2', 'addressline3', 'company_name');
$apcnt_cond_arr = array('isactive' => 1,'fk_pd_id'=>$pdid);
$apcnt_dtls = $this->PD_Model->selectCustomRecords($apcnt_fields,$apcnt_cond_arr,PDAPPLICANTSDETAILS);
if(!empty($apcnt_dtls)){
for($j = 0 ;$j < count($apcnt_dtls);$j++){
$appcnt_id = $pdsno."-".$pdid."-".$apcnt_dtls[$j]['pd_co_applicant_id'];
$updt_apcnt_dtls['applicant_name'] = $appcnt_id;
$updt_apcnt_dtls['mobile_no'] = $apcnt_dtls[$j]['mobile_no'] ? $appcnt_id.' - mobile_no' : null ;
$updt_apcnt_dtls['additional_mobile_no'] = $apcnt_dtls[$j]['additional_mobile_no'] ? $appcnt_id.' - additional_mobile_no' : null ;
$updt_apcnt_dtls['landline'] = $apcnt_dtls[$j]['landline'] ? $appcnt_id.' - landline' : null ;
$updt_apcnt_dtls['email'] = $apcnt_dtls[$j]['email'] ? $appcnt_id.' - email' : null ;
$updt_apcnt_dtls['addressline1'] = $apcnt_dtls[$j]['addressline1'] ? $appcnt_id.' - addressline1' : null ;
$updt_apcnt_dtls['addressline2'] = $apcnt_dtls[$j]['addressline2'] ? $appcnt_id.' - addressline2' : null ;
$updt_apcnt_dtls['addressline3'] = $apcnt_dtls[$j]['addressline3'] ? $appcnt_id.' - addressline3' : null ;
$updt_apcnt_dtls['company_name'] = $apcnt_dtls[$j]['company_name'] ? $appcnt_id.' - company_name' : null ;
$this->PD_Model->updateRecords($updt_apcnt_dtls,PDAPPLICANTSDETAILS,array('pd_co_applicant_id' => $apcnt_dtls[$j]['pd_co_applicant_id']));
}
}
$addr_fields = array('pd_address_id', 'addressline1');
$addr_cond_arr = array('isactive' => 1,'fk_pd_id'=>$pdid);
$addr_dtls = $this->PD_Model->selectCustomRecords($addr_fields,$addr_cond_arr,PDADDRESS);
if(!empty($addr_dtls)){
for($k = 0 ;$k < count($addr_dtls);$k++){
$updt_addr_dtls['addressline1'] = $addr_dtls[$k]['addressline1'] ? $general_format.' - addressline1' : null ;
$this->PD_Model->updateRecords($updt_addr_dtls,PDADDRESS,array('pd_address_id' => $addr_dtls[$k]['pd_address_id']));
}
}
$json_fields = array('json','processed_json');
$json_cond_arr = array('isactive' => 1,'fk_pd_id'=>$pdid);
$json_dtls = $this->PD_Model->selectCustomRecords($json_fields,$json_cond_arr,PDFORMDETAILSJSON);
// -- replace(COL,Wrong Value,New Value)
// UPDATE sineedgeprod.t_salespd_section_data
// SET section_data = replace(CONVERT(section_data USING utf8), '[answer_value] =>"SAVED"','"answer_value":""')
// where sales_pd_id = 5620 and section_id = 9 and isactive = 1;
}
// } // undo the command
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;
// $data['query'] = $this->db->last_query();
// $data['total data'] =count($tgr_dtls);
// $data['before 90 days data'] = $tgr_dtls;
$this->response($data,REST_Controller::HTTP_OK);
}
public function renamingExistingPDinfo_get(){
log_message('ERROR',"renamingExistingPDinfo Called");
$_90th_date = date("Y/m/d",strtotime('-90 days'));
log_message('ERROR',"90th date => ".$_90th_date);
$pdid_arr = array();// testing purpose
$columns = array('PDTRIGGER.pd_id','PDTRIGGER.addressline1','PDTRIGGER.addressline2','PDTRIGGER.addressline3','PDTRIGGER.pd_contact_mobileno','PDTRIGGER.pd_contact_landline','PDTRIGGER.pd_sno','DATE_FORMAT(PDTRIGGER.createdon, "%d/%m/%Y") as createdon','PDAPPLICANTSDETAILS.pd_co_applicant_id','PDTRIGGER.pd_contact_person_mail','PDTRIGGER.fk_lender_id');
$table = PDTRIGGER.' as PDTRIGGER';
$joins = array(array('table' => PDAPPLICANTSDETAILS. ' as PDAPPLICANTSDETAILS',
'condition' =>'PDAPPLICANTSDETAILS.fk_pd_id = PDTRIGGER.pd_id AND PDAPPLICANTSDETAILS.isactive = 1 AND PDAPPLICANTSDETAILS.applicant_type = 1',
'jointype' => 'LEFT'));
$tgr_cond_arr = array('PDTRIGGER.pd_status' => QC_COMPLETED ,'DATE_FORMAT(PDTRIGGER.createdon, "%d/%m/%Y") <=' => $_90th_date);
// 'PDTRIGGER.fk_customer_segment'=> 11 // 1 4 5 8 9 10 11
log_message('ERROR',"trigger details count ".count($tgr_cond_arr));
$tgr_dtls = $this->PD_Model->getJoinRecords($columns,$table,$joins,$tgr_cond_arr);
// $i = 0; // testing Purpose only
// for($i = 0 ;$i < 3;$i++){ // testing purpose only.
for($i = 0 ;$i < count($tgr_dtls);$i++){
$pdid = $tgr_dtls[$i]['pd_id'];
$earliest['trigger_details'] = $tgr_dtls[$i] ;
if(!empty($pdid)){
$apcnt_fields = array('pd_co_applicant_id', 'mobile_no', 'additional_mobile_no', 'landline', 'email', 'addressline1', 'addressline2', 'addressline3', 'company_name','applicant_name');
$apcnt_cond_arr = array('isactive' => 1,'fk_pd_id'=>$pdid);
$apcnt_dtls = $this->PD_Model->selectCustomRecords($apcnt_fields,$apcnt_cond_arr,PDAPPLICANTSDETAILS);
if(!empty($apcnt_dtls)){
$earliest['applicant_details'] = $apcnt_dtls;
}
$addr_fields = array('pd_address_id', 'addressline1');
$addr_cond_arr = array('isactive' => 1,'fk_pd_id'=>$pdid);
$addr_dtls = $this->PD_Model->selectCustomRecords($addr_fields,$addr_cond_arr,PDADDRESS);
if(!empty($addr_dtls)){
$earliest['address_details'] = $addr_dtls;
}
$json_fields = array('pd_form_detail_json_id','json','processed_json','fk_pd_id', 'fk_form_id');
$json_cond_arr = array('isactive' => 1,'fk_pd_id'=>$pdid);
$json_dtls = $this->PD_Model->selectCustomRecords($json_fields,$json_cond_arr,PDFORMDETAILSJSON);
if(!empty($json_dtls)){
$earliest['json_details'] = $json_dtls;
}
$previous_json_fields = array('pd_form_detail_json_id');
$previous_json_cond_arr = array('isactive' => 0,'fk_pd_id'=>$pdid);
$previous_json_dtls = $this->PD_Model->selectCustomRecords($previous_json_fields,$previous_json_cond_arr,PDFORMDETAILSJSON);
if(!empty($previous_json_dtls)){
foreach($previous_json_dtls as $val) {
$result[] = $val['pd_form_detail_json_id'];
}
$this->db->where_in('pd_form_detail_json_id',$result);
$this->db->delete(PDFORMDETAILSJSON);
}
$docs_fields = array('pd_document_id', 'pd_document_title', 'pd_document_name');
$docs_cond_arr = array('isactive' => 1,'fk_pd_id'=>$pdid);
$docs_dtls = $this->PD_Model->selectCustomRecords($docs_fields,$docs_cond_arr,PDDOCUMENTS);
if(!empty($docs_dtls)){
$earliest['docs_details'] = $docs_dtls;
}
}
$return = $this->renamingProcess($earliest);
array_push($pdid_arr['updated pdid'],$return);
array_push($pdid_arr['data'],$earliest);
} // undo the command
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;
$data['arr'] = $pdid_arr;
// $data['earliest'] = $earliest;
// $data['totalDetailsInCount'] =count($tgr_dtls);
// $data['before 90 days data'] = $tgr_dtls;
$this->response($data,REST_Controller::HTTP_OK);
}
public function renamingProcess($details){
$have_to_replace = array();
$tgr_dtls = $details['trigger_details'] ;
$apcnt_dtls = $details['applicant_details'];
//print_r($apcnt_dtls);die();
$addr_dtls = $details['address_details'];
$json_dtls = $details['json_details'];
$docs_dtls = $details['docs_details'];
$pdid = $tgr_dtls['pd_id'];
$pdsno = $tgr_dtls['pd_sno'];
$pdlenid = $tgr_dtls['fk_lender_id'];
$pdappcntid = $tgr_dtls['pd_co_applicant_id'];
$general_format = $pdsno."-".$pdid."-".$pdappcntid;
if(!empty($tgr_dtls)){
if($tgr_dtls['addressline1']){
$updt_on_tgr['addressline1'] = $general_format.'-addressline1' ;
$have_to_replace[$tgr_dtls['addressline1']] = $general_format.'-addressline1';
}else{ $updt_on_tgr['addressline1'] = null; }
if($tgr_dtls['addressline2']){
$updt_on_tgr['addressline2'] = $general_format.' - addressline2';
$have_to_replace[$tgr_dtls['addressline2']] = $general_format.'-addressline2';
}else{ $updt_on_tgr['addressline1'] = null; }
if($tgr_dtls['addressline3']){
$updt_on_tgr['addressline3'] = $general_format.'-addressline3';
$have_to_replace[$tgr_dtls['addressline3']] = $general_format.'-addressline3';
}else{ $updt_on_tgr['addressline1'] = null; }
if($tgr_dtls['pd_contact_mobileno']){
$updt_on_tgr['pd_contact_mobileno'] = $general_format.'-mobileno' ;
$have_to_replace[$tgr_dtls['pd_contact_mobileno']] = $general_format.'-mobileno';
}else{ $updt_on_tgr['pd_contact_mobileno'] = null; }
if($tgr_dtls['pd_contact_landline']){
$updt_on_tgr['pd_contact_landline'] = $general_format.'-landline' ;
$have_to_replace[$tgr_dtls['pd_contact_landline']] = $general_format.'-landline';
}else{ $updt_on_tgr['pd_contact_landline'] = null; }
if($tgr_dtls['pd_contact_person_mail']){
$updt_on_tgr['pd_contact_person_mail'] = $general_format.'-mail' ;
$have_to_replace[$tgr_dtls['pd_contact_person_mail']] = $general_format.'-mail';
}else{ $updt_on_tgr['pd_contact_person_mail'] = null ; }
}
if(!empty($apcnt_dtls)){
for($j = 0 ;$j < count($apcnt_dtls);$j++){
$appcnt_id = $pdsno."-".$pdid."-".$apcnt_dtls[$j]['pd_co_applicant_id'];
if($apcnt_dtls[$j]['applicant_name']){
// $have_to_replace[str_replace(' ','',$apcnt_dtls[$j]['applicant_name'])] = $appcnt_id;
$have_to_replace[$apcnt_dtls[$j]['applicant_name']] = $appcnt_id;
$updt_apcnt_dtls['applicant_name'] = $appcnt_id;
}
if($apcnt_dtls[$j]['mobile_no']){
$updt_apcnt_dtls['mobile_no'] = $appcnt_id.'-mobile_no';
$have_to_replace[$apcnt_dtls[$j]['mobile_no']] = $appcnt_id.'-mobile_no';
}else{ $updt_apcnt_dtls['mobile_no'] = null ; }
if($apcnt_dtls[$j]['additional_mobile_no']){
$updt_apcnt_dtls['additional_mobile_no'] = $appcnt_id.'-additional_mobile_no';
$have_to_replace[$apcnt_dtls[$j]['additional_mobile_no']] = $appcnt_id.'-additional_mobile_no';
}else{ $updt_apcnt_dtls['additional_mobile_no'] = null ; }
if($apcnt_dtls[$j]['landline']){
$updt_apcnt_dtls['landline'] = $appcnt_id.'-landline';
$have_to_replace[$apcnt_dtls[$j]['landline']] = $appcnt_id.'-landline';
}else{ $updt_apcnt_dtls['landline'] = null ; }
if($apcnt_dtls[$j]['email']){
$updt_apcnt_dtls['email'] = $appcnt_id.'-email';
$have_to_replace[$apcnt_dtls[$j]['email']] = $appcnt_id.'-email';
}else{ $updt_apcnt_dtls['email'] = null ; }
if($apcnt_dtls[$j]['addressline1']){
$updt_apcnt_dtls['addressline1'] = $appcnt_id.'-addressline1';
$have_to_replace[$apcnt_dtls[$j]['addressline1']] = $appcnt_id.'-addressline1';
}else{ $updt_apcnt_dtls['addressline1'] = null ; }
if($apcnt_dtls[$j]['addressline2']){
$updt_apcnt_dtls['addressline2'] = $appcnt_id.'-addressline2';
$have_to_replace[$apcnt_dtls[$j]['addressline2']] = $appcnt_id.'-addressline2';
}else{ $updt_apcnt_dtls['addressline2'] = null ; }
if($apcnt_dtls[$j]['addressline3']){
$updt_apcnt_dtls['addressline3'] = $appcnt_id.'-addressline3';
$have_to_replace[$apcnt_dtls[$j]['addressline3']] = $appcnt_id.'-addressline3';
}else{ $updt_apcnt_dtls['addressline3'] = null ; }
if($apcnt_dtls[$j]['company_name']){
$updt_apcnt_dtls['company_name'] = $appcnt_id.'-company_name';
$have_to_replace[$apcnt_dtls[$j]['company_name']] = $appcnt_id.'-company_name';
}else{ $updt_apcnt_dtls['company_name'] = null ; }
$this->PD_Model->updateRecords($updt_apcnt_dtls,PDAPPLICANTSDETAILS,array('pd_co_applicant_id' => $apcnt_dtls[$j]['pd_co_applicant_id']));
}
}
if(!empty($addr_dtls)){
for($k = 0 ;$k < count($addr_dtls);$k++){
if($addr_dtls[$k]['addressline1']){
$updt_addr_dtls['addressline1'] = $general_format.'-addressline1';
$have_to_replace[$addr_dtls[$k]['addressline1']] = $general_format.'-addressline1';
}else{
$updt_addr_dtls['addressline1'] = null ;
}
$this->PD_Model->updateRecords($updt_addr_dtls,PDADDRESS,array('pd_address_id' => $addr_dtls[$k]['pd_address_id']));
}
}
if(!empty($json_dtls)){
for($l = 0 ;$l < count($json_dtls);$l++){
$fid = $json_dtls[$l]['fk_form_id'];
// echo count($json_dtls);
// pd_form_detail_json_id, fk_pd_id, fk_form_id, company_id, isactive, json, processed_json,
$original_j_arr = json_decode($json_dtls[$l]['json'],true);
$original_pj_arr = json_decode($json_dtls[$l]['processed_json'],true);
// $have_to_replace["is_person_met_pic"] = "";
foreach($have_to_replace as $key => $value){
$replaced_pj_arr = $this->replace_in_array($key, $value, $original_pj_arr);
$replaced_j_arr = $this->replace_in_array($key, $value, $original_j_arr);
}
// $fid=18;
switch($fid)
{
case 1:
// 1 trade_product_contact_person_name , person_landline ,person_stdcode
$arr1 = array('trade_product_contact_person_name' , 'person_landline' ,'person_stdcode');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr1,$general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr1,$general_format);
break;
case 2:
// 2 trade_product_contact_person_name , person_landline
$arr2 = array('trade_product_contact_person_name' , 'person_landline');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr2,$general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr2,$general_format);
break;
case 5:
// 5 alternative_address
$arr5 = array('alternative_address','address');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr5,$general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr5,$general_format);
break;
case 6:
// 6 residence_place
$arr6 = array('residence_place','earning_name_of_the_employer_or_business','family_member_name');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr6,$general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr6,$general_format);
break;
case 8:
// 8 label
$arr8 = array('label');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr8,$general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr8,$general_format);
break;
case 9:
// 9 address
$arr9 = array('address');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr9,$general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr9,$general_format);
break;
case 10:
$arr10 = array('address','property_seller');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr10,$general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr10,$general_format);
break;
case 12:
$arr9 = array("employer_name","designation_person_met");
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr12,$general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr12,$general_format);
break;
case 13:
// 13 partner_name_master . gst_Regn_cert_pic , shop_eat_act_cert_pic
$arr13 = array("partner_name_master","gst_Regn_cert_pic","shop_eat_act_cert_pic","export_import_cert_pic","factory_cert_pic","pf_regn_pic","esic_regn_pic","eb_bill_pic");
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr13,$general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr13,$general_format);
break;
case 17:
$arr17 = array('address_property');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr17,$general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr17,$general_format);
break;
case 18:
// 18 is_person_met_pic , is_person_met_id_proof
$arr18 = array('is_person_met_pic' , 'is_person_met_id_proof');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr18,$general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr18,$general_format);
break;
case 19:
// 19 neighbourhood_name
$arr19 = array('neighbourhood_name');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr19,$general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr19,$general_format);
break;
case 22:
// 22 address_label,address_label
$arr22 = array('address_label' , 'address_label');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr22,$general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr22,$general_format);
break;
}
// traverseArray(&$array, $keys)
$update_json_arr['json'] = json_encode($replaced_j_arr);
$update_json_arr['processed_json'] = json_encode($replaced_pj_arr);
$this->PD_Model->updateRecords($update_json_arr,PDFORMDETAILSJSON,array('pd_form_detail_json_id' => $json_dtls[$l]['pd_form_detail_json_id'] ));
// $data['have_to_replace_this'] = $have_to_replace;
// $data['replaced_pj_array'] = $replaced_pj_arr;
// $data['original_pj_array'] = $original_pj_arr;
// $data['original_j_array'] = $original_j_arr;
// $data['replaced_j_array'] = $replaced_j_arr;
}
}
// $earliest['docs_details'] = $docs_dtls;
if(!empty($doc_dtls)){
for($m = 0 ;$m < count($doc_dtls);$m++){
$docname = $doc_dtls[$m]['pd_document_name'];
$destination_path = $this->external_path."/pd_reports/". $pdid ."/".$docname;
// unlink($destination_path);
$bucketname = LENDER_BUCKET_NAME_PREFIX.$pdlenid;
$key = 'pd'.$pdid.'/'.$docname;
// $s3result= $this->aws_s3->deleteSingleObjFromBucket($bucketname,$key);
// if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
// {}
}
}
$updt_tgr_where = array('pd_id' => $pdid,'pd_status' => QC_COMPLETED);
$this->PD_Model->updateRecords($updt_on_tgr,PDTRIGGER,$updt_tgr_where);
return $pdid;
// $data['pdid'] = $pdid ;
// $this->response($data,REST_Controller::HTTP_OK);
}
function replace_in_array($find, $replace, &$array) {
array_walk_recursive($array, function(&$array) use($find, $replace) {
if($array === $find) {
$array= $replace;
}
});
return $array;
}
function traverseArray(&$array, $keys,$format) {
foreach ($array as $key => &$value) {
if (is_array($value)) {
$this->traverseArray($value, $keys,$format);
} else {
if (in_array($key, $keys)){
// unset($array[$key]);
$array[$key] = $format."-".$key;
}
}
}
return $array;
}
function delete_file_destination($file,$pdid) {
// foreach ($files as $file) {
// if (file_exists($file)) {
// unlink($file);
$destination_path = $this->external_path."/pd_reports/". $pdid ."/".$file;
unlink($destination_path);
// } else {
// // File not found.
// }
// }
}
}

View File

@ -11744,7 +11744,7 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post()
}
function PDjson_get(){
$data = $this->PD_Model->testSection($this->get('id'));
$data = $this->PD_Model->testSection($this->get('id'),$this->get('fid'));
$this->response($data,REST_Controller::HTTP_OK);
}
function checkmail_post(){

View File

@ -2641,8 +2641,8 @@ class PD_Model extends SPARQ_Model {
return $result_data;
}
public function testSection($id){
$this->db->SELECT('*')->FROM("t_pd_form_details_json")->WHERE('fk_pd_id',$id)->WHERE('isactive',1)->WHERE('fk_form_id',5);
public function testSection($id,$fid){
$this->db->SELECT('*')->FROM("t_pd_form_details_json")->WHERE('fk_pd_id',$id)->WHERE('isactive',1)->WHERE('fk_form_id',$fid);
// ->WHERE('company_id',1);
$query = $this->db->get();
return $query->result();