key stakeholders changes for LFMP Product : ps
This commit is contained in:
parent
6332fc4513
commit
a525e8e2d6
@ -48,6 +48,7 @@ class readexceldata
|
|||||||
$where_condition_array = array('isactive' => 1,'section_id' => $section_id);
|
$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)'); }
|
//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);
|
$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();
|
// print_r($section_ref_data);die();
|
||||||
$return_data = array();
|
$return_data = array();
|
||||||
// $section_id = is_null($section_id) ? '' : $section_id;
|
// $section_id = is_null($section_id) ? '' : $section_id;
|
||||||
@ -96,47 +97,70 @@ class readexceldata
|
|||||||
}
|
}
|
||||||
else if($section_id == 5) //handle multiple stake holders data
|
else if($section_id == 5) //handle multiple stake holders data
|
||||||
{
|
{
|
||||||
// echo 'ajjnjk';
|
|
||||||
// print_r($return_data);//die();
|
|
||||||
|
|
||||||
$re_arranged_stake_holders_details = array();
|
$re_arranged_stake_holders_details = array();
|
||||||
if(isset($return_data['key_stakeholders']))
|
if(isset($return_data['key_stakeholders']))
|
||||||
{
|
{ $pd_master = $CI->PD_Model->getPDMasterDetails($pd_id);
|
||||||
// $i =0 ;
|
$product_abbr = $pd_master[0]['product_abbr'];
|
||||||
foreach ($return_data['key_stakeholders'] as $key => $value)
|
if($product_abbr == "LFMP"){ // ### LFMP Started Here.
|
||||||
{
|
$LFMP_company_data = SELF::getIndividualSectionData($sheetData,$company_data);
|
||||||
|
$LFMP_companies = array();
|
||||||
for($i = 0;$i <= 2; $i++)
|
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;
|
||||||
|
for($i = 0;$i <= $companycount; $i++)
|
||||||
{
|
{
|
||||||
$dynamic_share_key = ('share_holding#'.($i + 1));
|
$j =0 ; //### temp inx (bcoz maran asked)
|
||||||
$dynamic_vintage_key = ('vintage_in_current_biz#'.($i + 1));
|
foreach ($return_data['key_stakeholders'] as $key => $value)
|
||||||
$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)))
|
$dynamic_share_key = ('share_holding#'.($i + 1));
|
||||||
{
|
$dynamic_vintage_key = ('vintage_in_current_biz#'.($i + 1));
|
||||||
$temp['stakeholder_name'] = $value['stakeholder_name'];
|
$dynamic_work_exp_key = ('total_work_exp#'.($i + 1));
|
||||||
$temp['share_holding'] = $value[ $dynamic_share_key ];
|
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'] = ($i + 1);
|
{
|
||||||
$temp['vintage_in_current_biz'] = $value[ $dynamic_vintage_key ];
|
$temp['company_id'] = isset($LFMP_companies[$i]['company_id'])?$LFMP_companies[$i]['company_id']:0;
|
||||||
$temp['total_work_exp'] = $value[ $dynamic_work_exp_key ];
|
$temp['company_name'] = isset($LFMP_companies[$i]['company_name'])?$LFMP_companies[$i]['company_name']:"";
|
||||||
$re_arranged_stake_holders_details[] = $temp;
|
$temp['started_biz'] = "NO";
|
||||||
|
$temp['stakeholder_name'.$j] = $value['stakeholder_name'];
|
||||||
}
|
$temp['share_holding'.$j] = $value[$dynamic_share_key];
|
||||||
// if()
|
$temp['vintage_in_current_biz'.$j] = $value[$dynamic_vintage_key];
|
||||||
// {
|
$temp['total_work_exp'.$j] = $value[ $dynamic_work_exp_key ];
|
||||||
|
$re_arranged_stake_holders_details[$i] = $temp;
|
||||||
// }
|
}
|
||||||
// if(array_key_exists( $dynamic_work_exp_key, $value))
|
$j++;
|
||||||
// {
|
}
|
||||||
|
}
|
||||||
// }
|
}//###LFMP Flow Closed Here
|
||||||
|
else{
|
||||||
}
|
foreach ($return_data['key_stakeholders'] as $key => $value)
|
||||||
// $i++;
|
{
|
||||||
}
|
for($i = 0;$i <= 2; $i++)
|
||||||
|
{
|
||||||
}
|
$dynamic_share_key = ('share_holding#'.($i + 1));
|
||||||
// print_r($re_arranged_stake_holders_details);
|
$dynamic_vintage_key = ('vintage_in_current_biz#'.($i + 1));
|
||||||
// die();
|
$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['stakeholder_name'] = $value['stakeholder_name'];
|
||||||
|
$temp['share_holding'] = $value[ $dynamic_share_key ];
|
||||||
|
$temp['company_id'] = ($i + 1);
|
||||||
|
$temp['vintage_in_current_biz'] = $value[ $dynamic_vintage_key ];
|
||||||
|
$temp['total_work_exp'] = $value[ $dynamic_work_exp_key ];
|
||||||
|
$re_arranged_stake_holders_details[] = $temp;
|
||||||
|
|
||||||
|
}
|
||||||
|
}// ### default for loop closed here
|
||||||
|
}// ### foreach closed here
|
||||||
|
}//### normal flow closed here
|
||||||
|
}//### isset if closed here
|
||||||
$return_data['key_stakeholders'] = $re_arranged_stake_holders_details;
|
$return_data['key_stakeholders'] = $re_arranged_stake_holders_details;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user