$fetchVal){ $storeValue=array(); if(isset($fetchVal['assets_mode_master']) && ($fetchVal['assets_mode_master'] != '' || $fetchVal['assets_mode_master'] != null)) { $assest_owners_name = ''; foreach ( $fetchVal['name_of_the_owner'] as $o_key => $owner) { if($owner['id'] == 0) { $assest_owners_name .= $fetchVal['other_owner']. ','; } else { $assest_owners_name .= $owner['group_id'] == 1 ? $owner['name']. ' , ' : APPLICANTNAME_GRABBER::getApplicantsNameById($owner['id'],$latest_applicants_names).' , '; } } $assest_owners_name = substr_replace($assest_owners_name, '', strrpos($assest_owners_name,','),1) ; if(strrpos($assest_owners_name,',')) { $assest_owners_name = substr_replace($assest_owners_name, 'and', strrpos($assest_owners_name,','),1) ; } $storeValue['assets_mode'] = $fetchVal['assets_mode_master']; $storeValue['name_of_the_owner'] = $assest_owners_name; $storeValue['purchase_year'] = isset($fetchVal['vintage_personal']) && $fetchVal['vintage_personal'] != "" && $fetchVal['vintage_personal'] != 0 ? $fetchVal['vintage_personal']. ' Yrs' : ''; $storeValue['purchase_year'] .= isset($fetchVal['asset_months']) && $fetchVal['asset_months'] != "" && $fetchVal['asset_months'] != 0 ? ($fetchVal['vintage_personal'] != "" && $fetchVal['vintage_personal'] != 0 ? ' & '.$fetchVal['asset_months'] . ' Mns' : $fetchVal['asset_months'] . ' Mns' ): ''; $storeValue['emi'] = (!strcasecmp($fetchVal['emi'],'yes')); // this is for investments type if($fetchVal['assets_mode']==7){ $storeValue['approximate_market_value'] = $fetchVal['details'][0]['amount_of_invest']; switch($fetchVal['details'][0]['investments_type']) { case 1: $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['other_investments_type'].' with '.$fetchVal['details'][0]['bank_name']; break; case 2: $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['bank_name']; break; case 3: $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['bank_name']; break; case 4: $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['bank_name']; break; case 5: $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['bank_name']; break; case 6: $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['bank_name']; break; default: $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['bank_name']; } } // this is for life insurance else if($fetchVal['assets_mode']==6){ $storeValue['approximate_market_value'] = $fetchVal['details'][0]['sum_assured']; $storeValue['is_sum_assured'] = 1; switch($fetchVal['details'][0]['frequency_mode']) { case 1: $storeValue['about_assets'] = $fetchVal['details'][0]['other_frequency_mode'].' premium of Rs.'.$fetchVal['details'][0]['premium_paid'].' covering '.$fetchVal['details'][0]['members_coverd']; break; case 2: $storeValue['about_assets'] ='Annualy premium of Rs.'.$fetchVal['details'][0]['premium_paid'].' covering '.$fetchVal['details'][0]['members_coverd']; break; case 3: $storeValue['about_assets'] ='Halfyearly premium of Rs.'.$fetchVal['details'][0]['premium_paid'].' covering '.$fetchVal['details'][0]['members_coverd']; break; case 4: $storeValue['about_assets'] ='Fortnightly premium of Rs.'.$fetchVal['details'][0]['premium_paid'].' covering '.$fetchVal['details'][0]['members_coverd']; break; case 5: $storeValue['about_assets'] ='Daily premium of Rs.'.$fetchVal['details'][0]['premium_paid'].' covering '.$fetchVal['details'][0]['members_coverd']; break; case 6: $storeValue['about_assets'] ='Quarterly premium of Rs.'.$fetchVal['details'][0]['premium_paid'].' covering '.$fetchVal['details'][0]['members_coverd']; break; case 7: $storeValue['about_assets'] ='Monthly premium of Rs.'.$fetchVal['details'][0]['premium_paid'].' covering '.$fetchVal['details'][0]['members_coverd']; break; default: $setFrequencyType = $fetchVal['details'][0]['premium_paid'].' covering '.$fetchVal['details'][0]['members_coverd']; } } // this is machinaries else if($fetchVal['assets_mode']==4){ $storeValue['approximate_market_value'] = $fetchVal['approximate_market_value']; $storeValue['about_assets'] = $fetchVal['details'][0]['equipment_manufacturing_description']; } // this is for vehicle else if($fetchVal['assets_mode']==3){ $storeValue['approximate_market_value'] = $fetchVal['approximate_market_value']; $storeValue['about_assets'] = $fetchVal['details'][0]['vehicle_type_master'].' - '.$fetchVal['details'][0]['manufacturer_model_vehicle']; } // this property else if($fetchVal['assets_mode']==2){ $storeValue['approximate_market_value'] = $fetchVal['approximate_market_value']; $storeValue['assets_mode'] .= '
('.$fetchVal['details'][0]['property_type_master'].')'; $storeValue['about_assets'] = $fetchVal['details'][0]['property_type_master'] . ' property' ; $storeValue['about_assets'] .= isset($fetchVal['details'][0]['describe_of_the_property_asset']) && $fetchVal['details'][0]['describe_of_the_property_asset'] != "" ? ' ( '. $fetchVal['details'][0]['describe_of_the_property_asset'] .' )': ''; $storeValue['about_assets'] .= ' at '.$fetchVal['details'][0]['address_of_the_property']; $storeValue['about_assets'] .= isset($fetchVal['details'][0]['area_covered_by_this_property']) && $fetchVal['details'][0]['area_covered_by_this_property'] != "" ? ' having area of '. $fetchVal['details'][0]['area_covered_by_this_property'] : ''; $storeValue['about_assets'] .= $fetchVal['details'][0]['uom_of_the_property'] == 1 ? ' '.$fetchVal['details'][0]['uom_of_the_property'].'.' : ' '.$fetchVal['details'][0]['uom_master'].'.'; //$fetchVal['details'][0]['address_of_the_property']? 'Address of Property : ' . $fetchVal['details'][0]['address_of_the_property'].'.' : ''; //$storeValue['about_assets'] .= $fetchVal['details'][0]['describe_of_the_property_asset']? '
Description of Asset : ' . $fetchVal['details'][0]['describe_of_the_property_asset'].'.' : ''; //$storeValue['about_assets'] .= $fetchVal['details'][0]['area_covered_by_this_property']? '
Area of Covered : ' . $fetchVal['details'][0]['area_covered_by_this_property'].'.' : ''; } //this is for other else if($fetchVal['assets_mode']==1){ $storeValue['approximate_market_value'] = $fetchVal['details'][0]['any_other_asset_value']; $storeValue['about_assets'] = $fetchVal['details'][0]['any_other_assets'].' purchased in '. $fetchVal['purchase_year']; } array_push($mergeResult,$storeValue); } } return $mergeResult; } // business asset details public static function getBusinessAssetsDetails($business_assets,$pdid){ $total_tables = count($business_assets) / 5; $total_tables = ceil($total_tables); $overall_data = array(); $latest_applicants_names = APPLICANTNAME_GRABBER::getLatestApplicantsName($pdid); //$i = 10; // $header_row_.$i = 'Particulars'; // echo $header_row_.$i; for($i = 1;$i <= $total_tables; $i++) { $header_row = 'Particulars'; $first_row = 'Asset Type'; $sec_row = 'Asset Description'; $third_row = 'Ownership'; $fourth_row = 'Owned by'; $fifth_row = 'Market Value'; $sixth_row = 'Monthly Rent'; $seventh_row = 'Age of Asset'; $eighth_row = 'Loan (Y/N)'; $rupee_symbol = ""; $rental_flag = 0; $owned_flag = 0; $show_table = 1; $overall_empty_flag = 0; $is_rented = false; $is_owned = false; foreach($business_assets as $bsk => $fetchVal){ $owners_list = null; if($fetchVal['business_assets_mode'] == "" || $fetchVal['business_assets_mode'] == null) { if(count($business_assets) == 1){ $show_table = 0;} } if(isset($fetchVal['business_name_of_the_owner']) && (is_array($fetchVal['business_name_of_the_owner'])) && count($fetchVal['business_name_of_the_owner'])) { foreach($fetchVal['business_name_of_the_owner'] as $owner) { $owners_list .= ($owner['id'] != 0 ? ( $owner['group_id'] == 1 ? $owner['name'].', ' : (APPLICANTNAME_GRABBER::getApplicantsNameById($owner['id'],$latest_applicants_names).' , ')) : $fetchVal['business_name_of_the_other_owner'].', '); } } //print_r($owners_list);die(); $owners_list = substr_replace($owners_list, '', strrpos($owners_list, ','),1); if(strrpos($owners_list, ',')) { $owners_list = substr_replace($owners_list, 'and', strrpos($owners_list, ','),1); } $owners_list = $owners_list != "" || $owners_list != null ? $owners_list : 'NA'; $ownership_type = $fetchVal['business_ownership_type']; if(!strcasecmp($fetchVal['business_ownership_type'],'owned')) { $is_owned = true; //$owned_flag++; }else if(!strcasecmp($fetchVal['business_ownership_type'],'rented')) { $is_rented = true; ///$rental_flag++; } if($fetchVal['business_assets_mode']==4){ $header_row .= 'Asset '.($bsk+1).''; $first_row .= ''.$fetchVal['business_assets_mode_master'].''; $sec_row .= ''.($fetchVal['business_details'][0]['equipment_manufacturing_description']).''; $sec_row .= $fetchVal['business_purchase_year'] != '' || $fetchVal['business_purchase_year'] != null ? ' purchased in '.$fetchVal['business_purchase_year'] .'' : ''; $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').''; $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_monthly_rented_amt']) : 'NA').''; $seventh_row .= ''; $seventh_row .= ($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'].' Yrs ' : '' ); $seventh_row .= isset($fetchVal['asset_months']) && $fetchVal['asset_months'] != '' ? $fetchVal['asset_months'].' Mns' : ($fetchVal['business_vintage'] == "" ? 'NA' : ''); $seventh_row .= ''; $eighth_row .= ''.($fetchVal['business_emi'] != "" ? ucfirst($fetchVal['business_emi']) : 'NA').''; } // this is for vehicle else if($fetchVal['business_assets_mode']==3){ $header_row .= 'Asset '.($bsk+1).''; $first_row .= ''.$fetchVal['business_assets_mode_master'].''; $sec_row .= ''.($fetchVal['business_details'][0]['manufacturer_model_vehicle']).''; $sec_row .= $fetchVal['business_purchase_year'] != '' || $fetchVal['business_purchase_year'] != null ? ' purchased in '.$fetchVal['business_purchase_year'].'' : ''; $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').''; $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_monthly_rented_amt']) : 'NA').''; $seventh_row .= ''; $seventh_row .= ($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'].' Yrs ' : '' ); $seventh_row .= isset($fetchVal['asset_months']) && $fetchVal['asset_months'] != '' ? $fetchVal['asset_months'].' Mns' : ($fetchVal['business_vintage'] == "" ? 'NA' : ''); $eighth_row .= ''.($fetchVal['business_emi'] != "" ? ucfirst($fetchVal['business_emi']) : 'NA').''; } // this property else if($fetchVal['business_assets_mode']==2){ // switch(strtoupper($fetchVal['business_ownership_type'])) { $header_row .= 'Asset '.($bsk+1).''; $first_row .= ''.$fetchVal['business_assets_mode_master'].' at '. $fetchVal['business_details'][0]['address_of_the_property'].''; $sec_row .= ''.($fetchVal['business_details'][0]['property_type']==1 ? $fetchVal['business_details'][0]['other_property_type']:$fetchVal['business_details'][0]['property_type_master']).''; $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').''; $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_monthly_rented_amt']) : 'NA').''; $seventh_row .= ''; $seventh_row .= ($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'].' Yrs ' : '' ); $seventh_row .= isset($fetchVal['asset_months']) && $fetchVal['asset_months'] != '' ? $fetchVal['asset_months'].' Mns' : ($fetchVal['business_vintage'] == "" ? 'NA' : ''); $eighth_row .= ''.($fetchVal['business_emi'] != "" ? ucfirst($fetchVal['business_emi']) : 'NA').''; } //this is for other else if($fetchVal['business_assets_mode']==1){ $header_row .= 'Asset '.($bsk+1).''; $first_row .= ''.$fetchVal['business_assets_mode_master'].''; $sec_row .= ''.$fetchVal['business_details'][0]['any_other_assets'].''; $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').''; $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_monthly_rented_amt']) : 'NA').''; $seventh_row .= ''; $seventh_row .= ($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'].' Yrs ' : '' ); $seventh_row .= isset($fetchVal['asset_months']) && $fetchVal['asset_months'] != '' ? $fetchVal['asset_months'].' Mns' : ($fetchVal['business_vintage'] == "" ? 'NA' : ''); $eighth_row .= ''.($fetchVal['business_emi'] != "" ? ucfirst($fetchVal['business_emi']) : 'NA').''; } unset($business_assets[$bsk]); if($bsk == 4) { break; } } $header_row .= ''; $first_row .= ''; $sec_row .= ''; $third_row .= ''; $fourth_row .= ''; $fourth_row = $is_owned ? $fourth_row : ''; $fifth_row .= ''; $fifth_row = $is_owned ? $fifth_row : ''; $sixth_row .= ''; $sixth_row = $is_rented ? $sixth_row : ''; $seventh_row .= ''; $seventh_row = $is_owned ? $seventh_row : ''; $eighth_row .= ''; $eighth_row = $is_owned ? $eighth_row : ''; $overall_data[] = array('header_row' => $header_row, 'first_row' => $first_row,'sec_row'=> $sec_row,'third_row' =>$third_row,'fourth_row'=>$fourth_row,'fifth_row'=>$fifth_row,'sixth_row'=>$sixth_row,'seventh_row'=>$seventh_row,'eighth_row'=>$eighth_row,'show_table'=> $show_table); } return ($overall_data); } } ?>