FILTER NAME ID PROOF NAME TRIM

This commit is contained in:
Velz2020 2019-11-11 12:46:39 +05:30
parent b35c0a6a1d
commit da6640c9cb
3 changed files with 312 additions and 35 deletions

View File

@ -5812,6 +5812,7 @@ public function getPDFormDetailsJSON_post()
$records = $this->post('records');
$pdid = $records['pd_id'];
//$external_path = $this->config->item('external_data_path');
if(!file_exists($this->external_path.'/pd_reports/'.$pdid))
@ -5892,10 +5893,10 @@ public function getPDFormDetailsJSON_post()
// die();
// foreach($u as $v)
// {
///$this->aws_cognito->adminSetUserPassword('subashish.mohapatra@imgc.com');
// $this->aws_cognito->adminSetUserPassword('harshita.nadigatla@imgc.com');
// }
// die();
//die();
$is_regenerate = 0;
@ -5905,6 +5906,7 @@ public function getPDFormDetailsJSON_post()
}
//print_r($records);
$add_on_pd = $this->PD_Model->selectCustomRecords(array('pd_id'),array('parent_pd_id' => $pdid,'is_child' => 1),PDTRIGGER);
$data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($pdid);
@ -5993,7 +5995,7 @@ public function getPDFormDetailsJSON_post()
$data['add_on_pd_forms'] = array();
$data['add_on_pd_images'] = array();
$data['add_on_pd_master_details'] = array();
$add_on_forms = array(18,5,19,1,2,22,23,1,11);
$add_on_forms = array(18,5,19,1,2,22,23,1,11); //
foreach ($add_on_pd as $add_on_pd_key => $add_on_pd_value)
{
foreach ($add_on_forms as $add_on_forms_key => $add_on_forms_value)
@ -6013,24 +6015,31 @@ public function getPDFormDetailsJSON_post()
}
}
// print_r($data['add_on_pd_forms']);
// die();
if($data['pd_master_details'][0]['lender_short_name'] == 'CLIX')
{
$t = $this->load->view('report_templates/JSONTOREPORT_CLIX',$data,true);
// print_r($data['add_on_pd_images']);
// die();
$t = "";
if(!count($add_on_pd))
{
if($data['pd_master_details'][0]['lender_short_name'] == 'CLIX')
{
$t = $this->load->view('report_templates/JSONTOREPORT_CLIX',$data,true);
}
else if($data['pd_master_details'][0]['customer_segment_abbr'] == 'SE-RI')
{
$t = $this->load->view('report_templates/JSONTOREPORT_RI',$data,true);
}
else if($data['pd_master_details'][0]['customer_segment_abbr'] == 'SE-DI' || $data['pd_master_details'][0]['customer_segment_abbr'] == 'SE-AI' || $data['pd_master_details'][0]['customer_segment_abbr'] == 'SEP_INDV')
{
$t = $this->load->view('report_templates/JSONTOREPORT_DI_AI',$data,true);
}
}
else if($data['pd_master_details'][0]['customer_segment_abbr'] == 'SE-RI')
else
{
$t = $this->load->view('report_templates/JSONTOREPORT_RI',$data,true);
$t = $this->load->view('report_templates/JSONTOREPORT_DI_AI_ADDON',$data,true);
}
else if($data['pd_master_details'][0]['customer_segment_abbr'] == 'SE-DI' || $data['pd_master_details'][0]['customer_segment_abbr'] == 'SE-AI' || $data['pd_master_details'][0]['customer_segment_abbr'] == 'SEP_INDV')
{
$t = $this->load->view('report_templates/JSONTOREPORT_DI_AI',$data,true);
}
//$t = $this->load->view('temp_html.html',null,true);
echo $t;
//die();
die();
$total_replaces = substr_count($t,'<span class="tooltip">');
for($i = 0 ;$i < $total_replaces;$i++)
@ -6226,7 +6235,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$form_array[] = array('form_id' => 1,'form_name' => 'Supplier Details');
$form_array[] = array('form_id' => 2,'form_name' => 'Client Details');
$form_array[] = array('form_id' => 11,'form_name' => 'Stock Details');
if(!strcasecmp($lender_short_name, 'CLIX'))
if(!strcasecmp($lender_short_name, 'CLIX') || !strcasecmp($lender_short_name, 'MONEYWISE'))
{
$form_array[] = array('form_id' => 23,'form_name' => 'Future Plans & Business Environments');
}
@ -6243,7 +6252,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$form_array[] = array('form_id' => 2,'form_name' => 'Client Details');
$form_array[] = array('form_id' => 11,'form_name' => 'Stock Details');
$form_array[] = array('form_id' => 16,'form_name' => 'Assessed Income');
if(!strcasecmp($lender_short_name, 'CLIX'))
if(!strcasecmp($lender_short_name, 'CLIX') || !strcasecmp($lender_short_name, 'MONEYWISE'))
{
$form_array[] = array('form_id' => 23,'form_name' => 'Future Plans & Business Environments');
}
@ -9056,7 +9065,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
log_message('ERROR',$custom_log_info);
$applicant_type = $records['is_applicant'] ? 0 : ($records['is_person_met'] ? 3 : '');
$applicant_details = array('fk_pd_id' => $records['fk_pd_id'],'applicant_name' => $records['applicant_name'],'applicant_title_name' => $records['applicant_title_name'],'applicant_type' => $applicant_type );
$applicant_details = array('fk_pd_id' => $records['fk_pd_id'],'applicant_name' => trim($records['applicant_name']),'applicant_title_name' => $records['applicant_title_name'],'applicant_type' => $applicant_type );
//print_r($applicant_details);
if($records['pd_co_applicant_id'] == "" || $records['pd_co_applicant_id'] == null)
{
@ -9081,11 +9090,11 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
if($records['is_person_met_pic'] != "")
{
$img_data[] = array('Name' => $records['applicant_name'], 'image' => $records['is_person_met_pic'], 'link' => $records['link'],'co_applicant_id' => $applicant_id,'img_type' => 1);
$img_data[] = array('Name' => trim($records['applicant_name']), 'image' => $records['is_person_met_pic'], 'link' => $records['link'],'co_applicant_id' => $applicant_id,'img_type' => 1);
}
if($records['is_person_met_id_proof'] != "")
{
$img_data[] = array('Name' => ($records['applicant_name'].'-id_proof'), 'image' => $records['is_person_met_id_proof'], 'link' => $records['link'],'co_applicant_id' => $applicant_id,'img_type' => 2);
$img_data[] = array('Name' => (trim($records['applicant_name']).'-id_proof'), 'image' => $records['is_person_met_id_proof'], 'link' => $records['link'],'co_applicant_id' => $applicant_id,'img_type' => 2);
}
}
///print_r( $img_data );
@ -9095,7 +9104,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
if($records['is_person_met_pic'] != "" && !substr_count($records['is_person_met_pic'],'https'))
{
$img_data[] = array('Name' => $records['applicant_name'], 'image' => $records['is_person_met_pic'], 'link' => $records['link'],'co_applicant_id' => $records['pd_co_applicant_id'],'img_type' => 1);
$img_data[] = array('Name' => trim($records['applicant_name']), 'image' => $records['is_person_met_pic'], 'link' => $records['link'],'co_applicant_id' => $records['pd_co_applicant_id'],'img_type' => 1);
// Make inactive old entries with same data
$sql = 'UPDATE '. PDDOCUMENTS.' SET isactive = 0 where fk_pd_id = '.$records['fk_pd_id'].' and co_applicant_id = '.$records['pd_co_applicant_id'] .' and img_type = 1';
@ -9104,12 +9113,12 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
}
else
{
$this->PD_Model->updateRecords(array('pd_document_title' => $records['applicant_name']),PDDOCUMENTS,array('fk_pd_id' => $records['fk_pd_id'],'fk_form_id' => 18,'co_applicant_id' => $records['pd_co_applicant_id'],'img_type' => 1,'isactive' => 1));// 1- person met img
$this->PD_Model->updateRecords(array('pd_document_title' => trim($records['applicant_name'])),PDDOCUMENTS,array('fk_pd_id' => $records['fk_pd_id'],'fk_form_id' => 18,'co_applicant_id' => $records['pd_co_applicant_id'],'img_type' => 1,'isactive' => 1));// 1- person met img
}
if($records['is_person_met_id_proof'] != "" && !substr_count($records['is_person_met_id_proof'],'https'))
{
$img_data[] = array('Name' => ($records['applicant_name'].'-id_proof'), 'image' => $records['is_person_met_id_proof'], 'link' => $records['link'],'co_applicant_id' => $records['pd_co_applicant_id'],'img_type' => 2);
$img_data[] = array('Name' => (trim($records['applicant_name']).'-id_proof'), 'image' => $records['is_person_met_id_proof'], 'link' => $records['link'],'co_applicant_id' => $records['pd_co_applicant_id'],'img_type' => 2);
// Make inactive old entries with same data
@ -9119,7 +9128,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
}
else
{
$this->PD_Model->updateRecords(array('pd_document_title' => ($records['applicant_name'].'-id_proof')),PDDOCUMENTS,array('fk_pd_id' => $records['fk_pd_id'],'fk_form_id' => 18,'co_applicant_id' => $records['pd_co_applicant_id'],'img_type' => 2,'isactive' => 1));// 2- person met ID proof img
$this->PD_Model->updateRecords(array('pd_document_title' => (trim($records['applicant_name']).'-id_proof')),PDDOCUMENTS,array('fk_pd_id' => $records['fk_pd_id'],'fk_form_id' => 18,'co_applicant_id' => $records['pd_co_applicant_id'],'img_type' => 2,'isactive' => 1));// 2- person met ID proof img
}
}
@ -9136,7 +9145,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$lender_id = $this->PD_Model->selectCustomRecords(array('fk_lender_id'),array('pd_id' => $records['fk_pd_id']),PDTRIGGER);
$bucket_name = LENDER_BUCKET_NAME_PREFIX.$lender_id[0]['fk_lender_id'];
$applicant_name = $this->PD_Model->selectCustomRecords(array('pd_document_name'),array('fk_pd_id' => $records['fk_pd_id'],'pd_document_title' => ($records['applicant_name']),'isactive' => 1,'co_applicant_id is not null' => null,'img_type' => 1),PDDOCUMENTS);
$applicant_name = $this->PD_Model->selectCustomRecords(array('pd_document_name'),array('fk_pd_id' => $records['fk_pd_id'],'pd_document_title' => (trim($records['applicant_name'])),'isactive' => 1,'co_applicant_id is not null' => null,'img_type' => 1),PDDOCUMENTS);
//print_r($this->db->last_query());
if(count($applicant_name))
{
@ -9144,7 +9153,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$profilepics3path,'30 minutes');
$is_person_met_pic = $singed_uri;
}
$applicant_name_id = $this->PD_Model->selectCustomRecords(array('pd_document_name'),array('fk_pd_id' => $records['fk_pd_id'],'pd_document_title' => ($records['applicant_name'].'-id_proof'),'isactive' => 1,'co_applicant_id is not null' =>null,'img_type' => 2),PDDOCUMENTS);
$applicant_name_id = $this->PD_Model->selectCustomRecords(array('pd_document_name'),array('fk_pd_id' => $records['fk_pd_id'],'pd_document_title' => (trim($records['applicant_name']).'-id_proof'),'isactive' => 1,'co_applicant_id is not null' =>null,'img_type' => 2),PDDOCUMENTS);
//print_r($this->db->last_query());
if(count($applicant_name_id))
{

View File

@ -165,7 +165,7 @@ class PD_Model extends SPARQ_Model {
public function PDListwithGlobalFilters($pd_type,$pd_status,$pd_from_date,$pd_to_date,$pd_city,$pd_products,$pd_lender,$pd_applicant_name,$pd_applicant_lender_ref,$pd_officer_name)
{
$this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno,PDTRIGGER.fk_lender_id,PDTRIGGER.imgc_fin_institute,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name,ENTITY.is_score_card_enabled,ENTITY.is_otp_enabled, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %h:%i:%s %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name, PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.lender_sales_person,concat(LENDERSALESPERSON.first_name," ",LENDERSALESPERSON.last_name) as lender_sales_person_name,LENDERSALESPERSON.mobile_no as lender_sales_contact_mobileno,LENDERSALESPERSON.email as lender_sales_person_email,PDTRIGGER.lender_credit_person,concat(LENDERCREDITPERSON.first_name," ",LENDERCREDITPERSON.last_name) as lender_credit_person_name,LENDERCREDITPERSON.mobile_no as lender_credit_person_contact_mobileno,LENDERCREDITPERSON.email as lender_credit_person_email,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,OTPREJECTION.rejection_reason,PDTRIGGER.otp_reject_other_reason,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited,PDTRIGGER.is_zip_created,PDTRIGGER.pd_qc_note,PDTRIGGER.is_notify_enabled');
$this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno,PDTRIGGER.fk_lender_id,PDTRIGGER.imgc_fin_institute,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name,ENTITY.is_score_card_enabled,ENTITY.is_otp_enabled, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %h:%i:%s %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name, PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.lender_sales_person,concat(LENDERSALESPERSON.first_name," ",LENDERSALESPERSON.last_name) as lender_sales_person_name,LENDERSALESPERSON.mobile_no as lender_sales_contact_mobileno,LENDERSALESPERSON.email as lender_sales_person_email,PDTRIGGER.lender_credit_person,concat(LENDERCREDITPERSON.first_name," ",LENDERCREDITPERSON.last_name) as lender_credit_person_name,LENDERCREDITPERSON.mobile_no as lender_credit_person_contact_mobileno,LENDERCREDITPERSON.email as lender_credit_person_email,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,OTPREJECTION.rejection_reason,PDTRIGGER.otp_reject_other_reason,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited,PDTRIGGER.is_zip_created,PDTRIGGER.pd_qc_note,PDTRIGGER.is_notify_enabled');
$this->db->FROM(PDTRIGGER.' as PDTRIGGER');
$this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id ','LEFT');
$this->db->JOIN(ENTITYBILLING.' as ENTITYBILLING','PDTRIGGER.fk_entity_billing_id = ENTITYBILLING.entity_billing_id','LEFT');

View File

@ -559,6 +559,13 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php
$general_form = json_decode($pd_processed_forms[18][0]['processed_json'],true);
$add_on_general_forms = array();
foreach ($add_on_pd_forms as $key_pd_id => $add_on_general)
{
$tempGen = json_decode($add_on_general[18][0]['processed_json'],true);
array_push($add_on_general_forms,$tempGen);
}
$total_no_of_business = count($general_form['companies']);
$persons_met = "Default";
$all_company_details = null;
@ -604,7 +611,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$id = trim($applicant_name).'-id_proof';
if(!strcasecmp($id,trim($pm_value['pd_document_title'])))
{
$temp_person_met['id_proof'] = $pm_value['doc_url'] ;
$temp_person_met['id_proof'] = $pm_value['doc_url'];
}
}
$company_relationship_data = null;
@ -683,8 +690,140 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
echo '</div>';
echo "</div>";
echo '<br>';
// ####################### ADD ON PERSON MET SECTION START #################################
$add_on_person_met_data = array();
//print_r($add_on_general_forms);die();
foreach($add_on_general_forms as $add_on_gen_key => $add_on_general)
{
//print_r($add_on_general);
foreach ($add_on_general['individuals'] as $I_key => $individual)
{
// print_r($individual) ;die();
if($individual['is_person_met'] == true)
{
//array_push($person_met_images);
$temp_person_met = array();
$applicant_name = $individual['applicant_name'];
//$applicant_name = array_key_exists('pd_co_applicant_id_master',$individual) ? $individual['pd_co_applicant_id_master'] : "Not Available" ;
//echo '<br>'.$individual['applicant_title_name_master'] .' '. $applicant_name.'<br>' ;
$temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name;
$temp_person_met['photo'] = '';
$temp_person_met['id_proof'] = '';
foreach ($add_on_pd_images as $pd_level_key => $single_pd_images)
{
foreach($single_pd_images[18] as $pm_Key => $pm_value)
{
//echo $applicant_name.'-'.$pm_value['pd_document_title'];
if( !strcasecmp(trim($applicant_name),trim($pm_value['pd_document_title'])) )
{
$temp_person_met['photo'] = $pm_value['doc_url'] ;
}
$id = trim($applicant_name).'-id_proof';
if(!strcasecmp($id,trim($pm_value['pd_document_title'])))
{
$temp_person_met['id_proof'] = $pm_value['doc_url'] ;
}
if($temp_person_met['photo'] != "" && $temp_person_met['id_proof'] != "")
{
break;
}
}
}
$company_relationship_data = null;
foreach($general_form['company_with_relationships'] as $company_with_relationship)
{
if($individual['pd_co_applicant_id'] == $company_with_relationship['applicant_name'])
{
//FInd Company Name from JSON
$company_relationship_data .= $company_with_relationship['company_relationship_master'].' '.$company_with_relationship['company_name'];
//$company_relationship_data.='<br><center>and</center><br>';
$company_relationship_data.=', ';
}
}
//$temp_person_met['name'] =
//print_r($general_form['persons_with_relationships']);
$personal_relationship_data = null;
foreach($general_form['persons_with_relationships'] as $persons_with_relationship)
{
if($individual['pd_co_applicant_id'] == $persons_with_relationship['pd_co_applicant_id'] && isset($persons_with_relationship['relationship']))
{
if(isset($persons_with_relationship['relation_to_master']))
{
//? $persons_with_relationship['relation_to_master'] : " Could Not Find";
$RSNA = $persons_with_relationship['relation_to_master'];
if(isset($persons_with_relationship['relationship_master']))
{
$personal_relationship_data .= $persons_with_relationship['relationship_master'] .' Of '. $RSNA;
//$personal_relationship_data.='<br><center>and</center><br>';
$personal_relationship_data.=', ';
}
}
}
}
$company_relationship_data .= $personal_relationship_data;
$temp_person_met['relations'] = $company_relationship_data;
array_push($add_on_person_met_data,$temp_person_met);
}
}
}
//print_r($add_on_person_met_data);die();
// echo '<div id="page_break"></div>';
foreach($add_on_person_met_data as $pk => $person)
{
echo '<p><strong>Person(s) Met at other location:</strong> </p>';
echo '<div style="border: 1px solid #0191ed;">';
$display_for_person_met =$person['relations'] != "" ? substr_replace($person['relations'],'.',strrpos($person['relations'],','),1) : '';
$person_met_details = $person['name'];
if( strcasecmp($pd_master_details[0]['customer_segment_abbr'],'SEP_INDV'))
{
$person_met_details .= ($display_for_person_met != "" ? ' - ' . $display_for_person_met :'');
}
echo '<p>'.$person_met_details.'</p>';
//if($display_for_person_met != "" || $display_for_person_met != null){
echo '<br><br>';
//}
if($person['photo'])
{
echo '<img src="'.$person['photo'].'" width="300" height="200" alt=""/>';
}
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
if($person['id_proof'])
{
echo '<img src="'.$person['id_proof'].'" width="300" height="200" alt=""/>';
}
//echo count($person_met_data) != ($pk+1)? '<hr>':'';
echo '</div>';
echo '<br>';
}
// ####################### ADD ON PERSON MET SECTION END #####################
?>
<br>
@ -791,7 +930,131 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php
echo '<p>'.$general_form['general_remark'].'</p>';
}
?>
?>
<!-- ############################# ADD ON LOAN APPLICANTS SECTION START ###################################-->
<?php
// /print_r($add_on_general_forms);die();
foreach($add_on_general_forms as $add_on_gen_key => $add_on_general)
{
?>
<br>
<p contenteditable="true"><b>Loan Applicants as per addtional PD:</b></p>
<table class="scorecard_table">
<tr> <th>Name</th> <th>Age<br>(Yrs/Mns)</th> <th>Qualification / Type of Entity</th> <th>Relationships</th> </tr>
<tbody>
<?php
foreach($add_on_general['individuals'] as $ind_key => $add_on_individual)
{
if($add_on_individual['is_applicant'] == true && $add_on_individual['is_active'] == true)
{
$education_qualification = $add_on_individual['qualification_master'];
$education_qualification = $add_on_individual['course_name'] != "" || $add_on_individual['course_name'] != null ? $education_qualification.'<br>('.$add_on_individual['course_name'].')' : $education_qualification;
$applicant_name = array_key_exists('pd_co_applicant_id_master',$add_on_individual) ? $add_on_individual['pd_co_applicant_id_master'] : " Could Not Find" ;
//echo $applicant_name.'**************************';
$title = isset($add_on_individual['applicant_title_name_master']) && $add_on_individual['applicant_title_name_master'] != "" ? $add_on_individual['applicant_title_name_master'] : '';
$kyc_data = '';
if($ind_key == 0 && array_key_exists('is_kyc', $general_form) && $general_form['is_kyc'] == 'no')
{
$kyc_data = "<br><br>Name noticed as per KYC is ". $general_form['kyc_and_captur_the_name'];
}
echo '<tr><td class="customtd">'.$title.' '.$applicant_name.$kyc_data.'</td><td class="customtd">'.$add_on_individual['age'].'</td><td class="customtd">'.$education_qualification.'</td><td class="customtd">';
$add_on_company_relationship_data = null;
//print_r($general_form['company_with_relationships']);
foreach($add_on_general['company_with_relationships'] as $add_on_company_with_relationship)
{
//print_r($company_with_relationship);
if($add_on_individual['pd_co_applicant_id'] == $add_on_company_with_relationship['applicant_name'])
{
//FInd Company Name from JSON
//echo "ONCE";
$add_on_company_relationship_data = ($add_on_company_with_relationship['company_relationship_master'] .' '.$add_on_company_with_relationship['company_name']);
$add_on_company_relationship_data.= ($add_on_company_relationship_data != " " ? '<br><center>and</center><br>' : '');
}
}
$add_on_personal_relationship_data = null;
foreach($add_on_general['persons_with_relationships'] as $add_on_persons_with_relationship)
{
if(($add_on_individual['pd_co_applicant_id'] == $add_on_persons_with_relationship['pd_co_applicant_id'] || !strcasecmp($applicant_name,$add_on_persons_with_relationship['applicant_name']))&& isset($add_on_persons_with_relationship['relationship']))
{
if( isset($add_on_persons_with_relationship['relation_to_master']))
{
$RSNA = $add_on_persons_with_relationship['relation_to_master'];
if(isset($add_on_persons_with_relationship['relationship_master']))
{
$add_on_personal_relationship_data .= $add_on_persons_with_relationship['relationship_master'] .' of '. $RSNA;
$add_on_personal_relationship_data.='<br><center>and</center><br>';
}
}
}
}
$add_on_company_relationship_data .= $add_on_personal_relationship_data;
//echo $add_on_company_relationship_data;
echo substr_replace($add_on_company_relationship_data, '', strrpos($add_on_company_relationship_data, '<br><center>and</center><br>'),strlen($add_on_company_relationship_data));
echo "</td></tr>";
}
if(isset($add_on_general['companies']) && count($add_on_general['companies']))
{
$business_entity_type_master = array(1 => 'Others', 2 => 'Public Ltd Company', 3 => 'Sole proprietorship', 4 => 'HUF (Hindu Undivided Family)', 5 => 'Partnership',6 => 'Cooperative',7 => 'Limited Liability Partnership(LLP)',8 => 'OPC (One Person Company)',9 => 'Society',10 => 'Trust',11 => 'Private Limited Company');
foreach ($add_on_general['companies'] as $comp_key => $add_on_ind_company) {
if($add_on_ind_company['is_company_applicant'] != null)
{
echo '<tr><td class="customtd">'. $add_on_ind_company['company_name'] .'</td><td class="customtd">'. $add_on_ind_company['business_years']. (isset($add_on_ind_company['business_month']) ? ' . ' . $add_on_ind_company['business_month']: null) .'</td><td class="customtd">'. ( $add_on_ind_company['business_entity_type'] == 1 ? $add_on_ind_company['business_entity_type_other'] : $business_entity_type_master[ $add_on_ind_company['business_entity_type'] ] ).'</td><td class="customtd"> Not Applicable </td></tr>';
}
}
}
}
?>
</tbody>
</table>
<?php
//
if($add_on_general['general_remark'] != "") { ?>
<!-- <p>PD Officers Note (About General Section) :</p> -->
<?php
echo '<p>'.$add_on_general['general_remark'].'</p>';
}
} //add form loop end
//die();
?>
<!-- ############################# ADD ON LOAN APPLICANTS SECTION END ######################################-->
<!-- ########################### End of Cover Page Section ####################################-->
@ -962,7 +1225,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php
$address_form = json_decode($pd_processed_forms[5][0]['processed_json'],true);
//print_r($address_form);
$add_on_address_forms = array();
foreach ($add_on_pd_forms as $add_on_address_key => $add_on_address) {
$add_on_address_forms[] = json_decode($add_on_address[5][0]['processed_json'],true);
}
//print_r($add_on_address_forms);die();
$final_remark_data = json_decode($pd_processed_forms[20][0]['processed_json'],true) ;
$business_assets_details = json_decode($pd_processed_forms[22][0]['processed_json'],true);
@ -1350,7 +1618,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$bindEachResult["company_details"]=$companyList;
// this is for partner details
if(array_key_exists('partners',$businessRow)){
$bindEachResult["partner"]=Businessform::getPartnerDetails($businessRow['partners']);
$bindEachResult["partner"]=Businessform::getPartnerDetails($businessRow['partners'],$pd_master_details[0]['pd_id']);
}
else {
$getPartner=array();
@ -1358,7 +1626,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
// this is for person with relationship
if(array_key_exists('persons_with_relationships',$businessRow)){
$bindEachResult["family_members_involved"]=Businessform::getFamilyMemberDetails($businessRow['persons_with_relationships'],,$pd_master_details[0]['pd_id']);
$bindEachResult["family_members_involved"]=Businessform::getFamilyMemberDetails($businessRow['persons_with_relationships'],$pd_master_details[0]['pd_id']);
}
else {
@ -3822,7 +4090,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if(strtoupper($otherIcomeRow['other_income'])=='YES' && count($otherIcomeRow['income_details'])>0){
$is_other_income_available = 1;
$otherIncomeResult=OTHERINCOMEFORM::getIncomeDetails($otherIcomeRow['income_details'],,$pd_master_details[0]['pd_id']);
$otherIncomeResult=OTHERINCOMEFORM::getIncomeDetails($otherIcomeRow['income_details'],$pd_master_details[0]['pd_id']);
}
}