diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index c901128a..3cde3564 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -3649,7 +3649,7 @@ class PD_Controller extends REST_Controller { $result = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,TYPEOFACTIVITY); $final_array['type_of_activity'][$f_key] = array('type_of_activity_id' => $f_value['type_of_activity_id'],'name' =>$result[0]['name']); - if($f_value['type_of_activity_id'] == 1) + if($f_value['type_of_activity_id'] == 2) { if(array_key_exists('manufacturing_activity_details',$temp_data)) { @@ -3661,7 +3661,7 @@ class PD_Controller extends REST_Controller { $final_array['type_of_activity'][$f_key]['prodcuts'] =$temp; } } - else if($f_value['type_of_activity_id'] == 2)//Retail trading + else if($f_value['type_of_activity_id'] == 3)//Retail trading { if(array_key_exists('retail_trading_activity_details',$temp_data)) { @@ -3673,7 +3673,7 @@ class PD_Controller extends REST_Controller { $final_array['type_of_activity'][$f_key]['prodcuts'] =$temp; } } - else if($f_value['type_of_activity_id'] == 3)//Wholesale Trade wholesale_trading_activity_details + else if($f_value['type_of_activity_id'] == 4)//Wholesale Trade wholesale_trading_activity_details { $temp = array(); foreach($temp_data['wholesale_trading_activity_details'] as $product_key => $product) @@ -3683,7 +3683,7 @@ class PD_Controller extends REST_Controller { } $final_array['type_of_activity'][$f_key]['prodcuts'] =$temp; } - else//Service Provider + else if($f_value['type_of_activity_id'] == 5)//Service Provider { $temp = array(); foreach($temp_data['service_provider_activity_details'] as $product_key => $product) @@ -4242,6 +4242,18 @@ class PD_Controller extends REST_Controller { //print_r($assest_data); if(count($assest_data)) { + + // GET Assest Types and Properties type from Master + $fields = array('*'); + $where_condition_array = array('isactive' => 1); + $assest_types = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,ASSETTYPE); + + $fields = array('*'); + $where_condition_array = array('isactive' => 1); + $property_types = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PROPERTIES); + + //print_r($property_types);die(); + foreach($assest_data as $key => $assest) { $json = json_decode($assest['json'],true); @@ -4252,7 +4264,29 @@ class PD_Controller extends REST_Controller { { if(!strcmp($business_asset['business_emi'],'yes')) { - $final_data[] = array('business_assets_mode'=>$business_asset['business_assets_mode'],'business_details'=>$business_asset['business_details']); + $business_assets_mode_name = ""; + + foreach($assest_types as $asset_type) + { + if($asset_type['id'] == $business_asset['business_assets_mode']) + { + $business_assets_mode_name = $asset_type['name']; + } + } + + if( $business_asset['business_assets_mode'] == 2) + { + //echo $business_asset['business_details'][0]['property_type']; + foreach($property_types as $property_type) + { + if( $property_type['id'] == $business_asset['business_details'][0]['property_type']) + { + $business_asset['business_details'][0]['property_type_name'] = $property_type['name']; + } + } + } + + $final_data[] = array('business_assets_mode'=>$business_asset['business_assets_mode'],'business_assets_mode_name'=>$business_assets_mode_name,'business_details'=>$business_asset['business_details']); } }