Company details added in key stakeholders : ps

This commit is contained in:
sanjeev.p 2021-08-11 12:02:33 +05:30
parent a525e8e2d6
commit f8807ce4e9

View File

@ -28,7 +28,7 @@ class readexceldata
$sheetData = $spreadsheet_io_fact->getActiveSheet()->toArray(null, true, false, true);
//print_r($sheetData);die();
return
SELF::seperateSectionData($section_id,$sheetData,$pd_id);
SELF::seperateSectionData($section_id,$sheetData,$pd_id,$file_path_withname);
// print_r(SELF::seperateSectionData($section_id,$sheetData,$pd_id));die();
// $CI->load->model('PD_Model');
@ -40,7 +40,7 @@ class readexceldata
}
static function seperateSectionData($section_id,$sheetData,$pd_id)
static function seperateSectionData($section_id,$sheetData,$pd_id,$file)
{
// echo 's-worked';die();
$CI =&get_instance();
@ -48,7 +48,6 @@ class readexceldata
$where_condition_array = array('isactive' => 1,'section_id' => $section_id);
//if($section_id == null){ $where_condition_array = array('isactive' => 1,'section_id in ' => '(null,1)'); }
$section_ref_data = $CI->PD_Model->selectCustomRecords(array('*'),$where_condition_array,EXCEL_COLUMN_REF_NAME);
$company_data = $CI->PD_Model->selectCustomRecords(array('*'),array('isactive' => 1,'section_id' =>1),EXCEL_COLUMN_REF_NAME);
// print_r($section_ref_data);die();
$return_data = array();
// $section_id = is_null($section_id) ? '' : $section_id;
@ -102,20 +101,8 @@ class readexceldata
{ $pd_master = $CI->PD_Model->getPDMasterDetails($pd_id);
$product_abbr = $pd_master[0]['product_abbr'];
if($product_abbr == "LFMP"){ // ### LFMP Started Here.
$LFMP_company_data = SELF::getIndividualSectionData($sheetData,$company_data);
$LFMP_companies = array();
if(!empty($LFMP_company_data['borrower_details'])){
$cid=0;//for company ID
for($i=0;$i<count($LFMP_company_data['borrower_details']);$i++){
$entity_type = $LFMP_company_data['borrower_details'][$i]['entity_type'];
if($entity_type != "Individual"){
$cid++;//for company ID
$LFMP_companies[$i]['company_id'] = $cid;
$LFMP_companies[$i]['company_name'] = $LFMP_company_data['borrower_details'][$i]['borrower_name'];
}
}
}
$companycount = (count($LFMP_companies)>0) ? count($LFMP_companies) : 1;
$LFMP_company_data = SELF::getCompanyListForSMCList($file);
$companycount = (count($LFMP_company_data)>0) ? count($LFMP_company_data) : 1;
for($i = 0;$i <= $companycount; $i++)
{
$j =0 ; //### temp inx (bcoz maran asked)
@ -126,8 +113,8 @@ class readexceldata
$dynamic_work_exp_key = ('total_work_exp#'.($i + 1));
if((array_key_exists( $dynamic_share_key, $value)) && (array_key_exists( $dynamic_vintage_key, $value)) && (array_key_exists( $dynamic_work_exp_key, $value)))
{
$temp['company_id'] = isset($LFMP_companies[$i]['company_id'])?$LFMP_companies[$i]['company_id']:0;
$temp['company_name'] = isset($LFMP_companies[$i]['company_name'])?$LFMP_companies[$i]['company_name']:"";
$temp['company_id'] = isset($LFMP_company_data[$i]['company_id'])?$LFMP_company_data[$i]['company_id']:0;
$temp['company_name'] = isset($LFMP_company_data[$i]['borrower_name'])?$LFMP_company_data[$i]['borrower_name']:"";
$temp['started_biz'] = "NO";
$temp['stakeholder_name'.$j] = $value['stakeholder_name'];
$temp['share_holding'.$j] = $value[$dynamic_share_key];
@ -138,6 +125,7 @@ class readexceldata
$j++;
}
}
$return_data['company_details'] = $LFMP_company_data;
}//###LFMP Flow Closed Here
else{
foreach ($return_data['key_stakeholders'] as $key => $value)