getProductsWithTypeofActivityFromBusiness
This commit is contained in:
parent
f58b161dd2
commit
151e3a917d
@ -185,6 +185,7 @@ $route['getEndUseOfLoan'] = 'PD_Controller/getEndUseOfLoan';
|
|||||||
$route['savePDOfficerCurrentLocation'] = 'PD_Controller/savePDOfficerCurrentLocation';
|
$route['savePDOfficerCurrentLocation'] = 'PD_Controller/savePDOfficerCurrentLocation';
|
||||||
$route['getPDOfficerCurrentLocation'] = 'PD_Controller/getPDOfficerCurrentLocation';
|
$route['getPDOfficerCurrentLocation'] = 'PD_Controller/getPDOfficerCurrentLocation';
|
||||||
$route['getFamilyDetails'] = 'PD_Controller/getFamilyDetailsFromBusinessAndGeneral';
|
$route['getFamilyDetails'] = 'PD_Controller/getFamilyDetailsFromBusinessAndGeneral';
|
||||||
|
$route['getProductsFromBusiness'] = 'PD_Controller/getProductsWithTypeofActivityFromBusiness';
|
||||||
// $route['savePDFormDetailsJSON'] = 'PD_Controller/savePDFormDetailsJSON';
|
// $route['savePDFormDetailsJSON'] = 'PD_Controller/savePDFormDetailsJSON';
|
||||||
// $route['getPDFormDetailsJSON'] = 'PD_Controller/getPDFormDetailsJSON';
|
// $route['getPDFormDetailsJSON'] = 'PD_Controller/getPDFormDetailsJSON';
|
||||||
|
|
||||||
|
|||||||
@ -4239,7 +4239,84 @@ class PD_Controller extends REST_Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getProductsWithTypeofActivityFromBusiness_post()
|
public function getProductsWithTypeofActivityFromBusiness_post()
|
||||||
{
|
{
|
||||||
|
$pdid = $this->post('pd_id');
|
||||||
|
$company_id = $this->post('company_id');
|
||||||
|
//echo $pdid;
|
||||||
|
//Get Details From General Full
|
||||||
|
$fields = array('json');
|
||||||
|
$where_condition_array = array('isactive' => 1,'fk_form_id' =>13,'fk_pd_id' => $pdid,'company_id' => $company_id);
|
||||||
|
$business_data = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON);
|
||||||
|
$final_data = array();
|
||||||
|
//print_r($business_data);
|
||||||
|
if(count($business_data))
|
||||||
|
{
|
||||||
|
$json = json_decode($business_data[0]['json'],true);
|
||||||
|
//print_r($json);
|
||||||
|
if(array_key_exists('manufacturing_activity_details',$json))
|
||||||
|
{
|
||||||
|
$temp_data['type_of_activity_id'] = 2;
|
||||||
|
$temp_data['name'] = 'Manufacturing';
|
||||||
|
foreach($json['manufacturing_activity_details'] as $key => $manufacturing_activity_details)
|
||||||
|
{
|
||||||
|
$temp_data['products'][] = $manufacturing_activity_details['main_products'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$final_data[] = $temp_data;
|
||||||
|
$temp_data = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(array_key_exists('retail_trading_activity_details',$json))
|
||||||
|
{
|
||||||
|
$temp_data['type_of_activity_id'] = 3;
|
||||||
|
$temp_data['name'] = 'Retail trading';
|
||||||
|
foreach($json['retail_trading_activity_details'] as $key => $retail_trading_activity_details)
|
||||||
|
{
|
||||||
|
$temp_data['products'][] = $retail_trading_activity_details['main_products'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$final_data[] = $temp_data;
|
||||||
|
$temp_data = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(array_key_exists('wholesale_trading_activity_details',$json))
|
||||||
|
{
|
||||||
|
$temp_data['type_of_activity_id'] = 4;
|
||||||
|
$temp_data['name'] = 'Wholesale Trade';
|
||||||
|
foreach($json['wholesale_trading_activity_details'] as $key => $wholesale_trading_activity_details)
|
||||||
|
{
|
||||||
|
$temp_data['products'][] = $wholesale_trading_activity_details['main_products'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$final_data[] = $temp_data;
|
||||||
|
$temp_data = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(array_key_exists('service_provider_activity_details',$json))
|
||||||
|
{
|
||||||
|
$temp_data['type_of_activity_id'] = 5;
|
||||||
|
$temp_data['name'] = 'Service Provider';
|
||||||
|
foreach($json['service_provider_activity_details'] as $key => $service_provider_activity_details)
|
||||||
|
{
|
||||||
|
$temp_data['products'][] = $service_provider_activity_details['main_products'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$final_data[] = $temp_data;
|
||||||
|
$temp_data = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$data['dataStatus'] = true;
|
||||||
|
$data['status'] = REST_Controller::HTTP_OK;
|
||||||
|
$data['record'] = $final_data;
|
||||||
|
$this->response($data,REST_Controller::HTTP_OK);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user