getTypeOfActivetyFromBusinessForm chnaged
This commit is contained in:
parent
9dc0d638e1
commit
e11acd37c5
@ -1743,6 +1743,15 @@ class PD_Controller extends REST_Controller {
|
||||
$base64images = $records['base64images'];
|
||||
unset($records['base64images']);
|
||||
}
|
||||
|
||||
//If It is General Informatin Form Save New Co Applcants details
|
||||
// by Passing records form to another(saveCoApplicantsFromGeneralInfoForm) internl function
|
||||
if($records['formid'] == 18)
|
||||
{
|
||||
$this->saveCoApplicantsFromGeneralInfoForm($records);
|
||||
}
|
||||
|
||||
|
||||
//Deactivate Old rec
|
||||
$where_condition_array = array('fk_pd_id' => $pd_id,"fk_form_id"=>$pd_form_id);
|
||||
$array = array('isactive'=>0);
|
||||
@ -1882,6 +1891,49 @@ class PD_Controller extends REST_Controller {
|
||||
}
|
||||
|
||||
|
||||
//Save Co applicants details from General Form
|
||||
public function saveCoApplicantsFromGeneralInfoForm($records)
|
||||
{
|
||||
|
||||
if(count($records['co_applicant_details']))
|
||||
{
|
||||
//echo 'saveCoApplicantsFromGeneralInfoForm';
|
||||
$exist_applicants = $this->PD_Model->getApplicantsDetails($records['pdid']);
|
||||
//print_r($exist_applicants);
|
||||
//echo "Yes";
|
||||
$index_of_new_applicants = array();
|
||||
foreach($records['co_applicant_details'] as $applicant_key => $new_applicant)
|
||||
{
|
||||
$count = 0;
|
||||
|
||||
foreach($exist_applicants as $exist_key => $exist_applicant)//,
|
||||
{
|
||||
if($exist_applicant['applicant_type'] != 1)
|
||||
{
|
||||
if(!strcmp($new_applicant['name_ans'],$exist_applicant['applicant_name']))
|
||||
{
|
||||
$count++;
|
||||
$temp_array = array('fk_pd_id'=>$records['pdid'],'applicant_name'=>$new_applicant['name_ans'],'applicant_type'=>0,'relation'=>$new_applicant['relation_ans']);
|
||||
$where_condition_array = array('fk_pd_id'=>$records['pdid'],'applicant_name'=>$exist_applicant['applicant_name']);
|
||||
$this->PD_Model->updateRecords($temp_array,PDAPPLICANTSDETAILS,$where_condition_array);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if($count == 0)
|
||||
{
|
||||
$temp_array = array('fk_pd_id'=>$records['pdid'],'applicant_name'=>$new_applicant['name_ans'],'applicant_type'=>0,'relation'=>$new_applicant['relation_ans']);
|
||||
$this->PD_Model->saveRecords($temp_array,PDAPPLICANTSDETAILS);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function getAssessedIncome_post()
|
||||
{
|
||||
$pd_id = $this->post('pd_id');
|
||||
@ -2192,8 +2244,8 @@ class PD_Controller extends REST_Controller {
|
||||
$temp_array = "";
|
||||
foreach($template_form_details as $template_key => $template_form_detail)
|
||||
{
|
||||
$pd_form_raw_data = $this->PD_Model->getPDFormDetails($pd_id,$template_form_detail['form_id']);
|
||||
//print_r($pd_form_raw_data);
|
||||
$pd_form_raw_data = $this->PD_Model->getPDFormDetailsWithScoring($pd_id,$template_form_detail['form_id']);
|
||||
print_r($pd_form_raw_data);
|
||||
// $pd_form_structured_data = GETPDFORMDETAILS::getPDFormDetailsStructured($pd_form_raw_data,$pd_id,$template_form_detail['form_id']);
|
||||
|
||||
// echo "\n\n";
|
||||
@ -3010,30 +3062,49 @@ class PD_Controller extends REST_Controller {
|
||||
|
||||
if(count($result_array))
|
||||
{
|
||||
$fields = array('name');
|
||||
$where_condition_array = array('type_of_activity_id'=>$result_array[1]['column_value'],'isactive'=>1);
|
||||
$result = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,TYPEOFACTIVITY);
|
||||
$final_data = array();
|
||||
foreach($result_array as $res_key => $res)
|
||||
{
|
||||
if($res['column_name'] == 'profession_name')
|
||||
{
|
||||
$final_data['profession_name'] = $res['column_value'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$final_data['type_of_activity'][] = $res['column_value'];
|
||||
}
|
||||
}
|
||||
//print_r($final_data);
|
||||
|
||||
if(count($result)){ $result_array[1]['name'] = $result[0]['name']; }
|
||||
foreach($final_data['type_of_activity'] as $f_key => $f_value)
|
||||
{
|
||||
$fields = array('name');
|
||||
$where_condition_array = array('type_of_activity_id'=>$f_value,'isactive'=>1);
|
||||
$result = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,TYPEOFACTIVITY);
|
||||
$final_data['type_of_activity'][$f_key] = array('type_of_activity_id' => $f_value,'name' =>$result[0]['name']);
|
||||
}
|
||||
|
||||
if(count($final_data))
|
||||
{
|
||||
|
||||
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = $result_array;
|
||||
$data['records'] = $final_data;
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['dataStatus'] = false;
|
||||
$data['status'] = REST_Controller::HTTP_NO_CONTENT;
|
||||
$data['msg'] = "Fill Business Details First/ No Data Available!";
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3253,7 +3324,7 @@ class PD_Controller extends REST_Controller {
|
||||
// echo $ci_instant;
|
||||
}
|
||||
|
||||
public function calculatePDScore()
|
||||
public function calculatePDScore($pdid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -963,7 +963,28 @@ class PD_Model extends SPARQ_Model {
|
||||
$form_details = $this->db->GET()->result_array();
|
||||
return $form_details;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function getPDFormDetailsWithScoring($pd_id,$pd_form_id = "")
|
||||
{
|
||||
|
||||
|
||||
$pd_master_detials = $this->getPDMasterDetails($pd_id);
|
||||
|
||||
$this->db->SELECT('PDFORMDETAILS.fk_pd_id,PDFORMDETAILS.fk_form_id,PDFORMDETAILS.iter_column_name,PDFORMDETAILS.iter_sub_column_name,PDFORMDETAILS.iteration, PDFORMDETAILS.column_name, PDFORMDETAILS.column_id, PDFORMDETAILS.column_value, PDFORMDETAILS.createdon, PDFORMDETAILS.fk_createdby,USERPROFILE.first_name,USERPROFILE.last_name');
|
||||
$this->db->FROM(PDFORMDETAILS.' as PDFORMDETAILS');
|
||||
$this->db->JOIN(TEMPLATECATEGORYWEIGHTAGE.' as TEMPLATECATEGORYWEIGHTAGE','TEMPLATECATEGORYWEIGHTAGE.fk_template_id ='.$pd_master_detials[0]['fk_pd_template_id']);
|
||||
$this->db->JOIN(USERPROFILE.' as USERPROFILE','PDFORMDETAILS.fk_createdby = USERPROFILE.userid','LEFT');
|
||||
$this->db->WHERE('PDFORMDETAILS.fk_pd_id',$pd_id);
|
||||
if($pd_form_id != "")
|
||||
{
|
||||
$this->db->WHERE('PDFORMDETAILS.fk_form_id',$pd_form_id);
|
||||
}
|
||||
$this->db->WHERE('PDFORMDETAILS.isactive',1);
|
||||
$form_details = $this->db->GET()->result_array();
|
||||
return $form_details;
|
||||
|
||||
}
|
||||
|
||||
public function getAssessedIncome($pdid)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user