Changes : ps
This commit is contained in:
parent
ec38c19811
commit
a243f0e913
@ -1169,148 +1169,6 @@ class Flyhi_Controller extends REST_Controller {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function saveFlyhiPDsection_Aspersalespdtype_post()
|
||||
{
|
||||
$records = $this->post('records');
|
||||
$sales_pd_id = $records['sales_pd_id'];
|
||||
$section_id = $records['section_id'];
|
||||
$fk_createdby = $records['fk_createdby'];
|
||||
$status = $records['is_complete'];
|
||||
$section_data = json_encode($records);
|
||||
|
||||
//Get Sales PD master Data
|
||||
|
||||
$columns = array('SALES_PD_DATA.*','ENTITY.short_name','PRODUCT.abbr');
|
||||
$table = SALES_PD_DATA.' as SALES_PD_DATA';
|
||||
$joins = array(
|
||||
array('table' => ENTITY. ' as ENTITY',
|
||||
'condition' =>'SALES_PD_DATA.lender_id = ENTITY.entity_id',
|
||||
'jointype' => 'INNER'),
|
||||
array('table' => PRODUCTS. ' as PRODUCT',
|
||||
'condition' =>'SALES_PD_DATA.product_id = PRODUCT.product_id',
|
||||
'jointype' => 'INNER')
|
||||
);
|
||||
|
||||
$where_condition_array = array('SALES_PD_DATA.sales_pd_id' => $sales_pd_id);
|
||||
$sales_pd_master_data = $this->Flyhi_Model->getJoinRecords($columns,$table,$joins,$where_condition_array);
|
||||
|
||||
//pre process works
|
||||
switch($section_id)
|
||||
{
|
||||
case 1: //General section
|
||||
//update Applicant ID and applicant Name to sales pD master Table
|
||||
$city = '';
|
||||
if($records['questions'])
|
||||
{
|
||||
foreach ($records['questions'] as $g_key => $g_value)
|
||||
{
|
||||
if(isset($g_value['question_key']) && $g_value['question_key'] === 'loan_application_id')
|
||||
{
|
||||
$applicant_id = $g_value['answer_value'] ? $g_value['answer_value'] : 'Not Provided';
|
||||
}
|
||||
if(isset($g_value['question_key']) && $g_value['question_key'] == 'lender_name')
|
||||
{
|
||||
$lender_id = $g_value['answer_value'];
|
||||
}
|
||||
if(isset($g_value['question_key']) && $g_value['question_key'] == 'loan_amount')
|
||||
{
|
||||
$loan_amount = $g_value['answer_value'];
|
||||
}
|
||||
if(isset($g_value['question_key']) && $g_value['question_key'] == 'branch')
|
||||
{
|
||||
$pd_branch_id = $g_value['answer_value'];
|
||||
}
|
||||
if(isset($g_value['question_key']) && $g_value['question_key'] == 'lender_sales_person')
|
||||
{
|
||||
$lender_sales_person = $g_value['answer_value'];
|
||||
}
|
||||
if(isset($g_value['question_key']) && $g_value['question_key'] == 'lender_credit_person')
|
||||
{
|
||||
$lender_credit_person = $g_value['answer_value'];
|
||||
}
|
||||
if(isset($g_value['question_key']) && $g_value['question_key'] == 'product_name')
|
||||
{
|
||||
$product_id = $g_value['answer_value'];
|
||||
}
|
||||
if(isset($g_value['question_key']) && $g_value['question_key'] == 'product_name')
|
||||
{
|
||||
$applicant_name = $g_value['applicant_name'];
|
||||
}
|
||||
if($g_value['answer_value'] == 'Residence verification'){
|
||||
$flyhi_pd_type = 4;
|
||||
}
|
||||
if($g_value['answer_value'] == 'Office verification'){
|
||||
$flyhi_pd_type = 3;
|
||||
}
|
||||
if(isset($g_value['question_key']) && $g_value['question_key'] == 'verification_type')
|
||||
{
|
||||
if(isset($g_value['onchange_properties']))
|
||||
{
|
||||
foreach ($g_value['onchange_properties'] as $h_key => $h_value)
|
||||
{
|
||||
foreach ($h_value['form_controls'] as $i_key => $i_value)
|
||||
{
|
||||
foreach ($i_value['questions'] as $j_key => $j_value)
|
||||
{
|
||||
if($g_value['answer_value'] == 'Residence verification' && $j_value['question_key'] == 'residence_city'){
|
||||
$city = $j_value['answer_value'];
|
||||
}
|
||||
if($g_value['answer_value'] == 'Office verification' && $j_value['question_key'] == 'officer_city'){
|
||||
$city = $j_value['answer_value'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
$FLYHI_PD['applicant_name'] = $applicant_name;
|
||||
$FLYHI_PD['applicant_id'] = $applicant_id;
|
||||
$FLYHI_PD['city_id']=$city;
|
||||
$FLYHI_PD['loan_amount'] = $loan_amount;
|
||||
$FLYHI_PD['lender_sales_person'] = $lender_sales_person ;
|
||||
$FLYHI_PD['lender_credit_person'] = $lender_credit_person ;
|
||||
$FLYHI_PD['pd_branch_id'] = $pd_branch_id;
|
||||
$FLYHI_PD['lender_id'] = $lender_id;
|
||||
$FLYHI_PD['sales_pd_type'] = $flyhi_pd_type;
|
||||
$FLYHI_PD['product_id'] = $product_id ? $product_id : (ENVIRONMENT == 'production' ? 27 : 26);
|
||||
$this->Flyhi_Model->updateRecords($FLYHI_PD,SALES_PD_DATA,array('sales_pd_id' => $sales_pd_id));
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 9: //photosection
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
//make inactive previous records
|
||||
$this->Flyhi_Model->updateRecords(array('isactive' => 0),SALESPD_SECTION_DATA,array('sales_pd_id' =>$sales_pd_id,'section_id' => $section_id ));
|
||||
|
||||
//insert new record
|
||||
$fields = array('sales_pd_id' => $sales_pd_id, 'section_id' => $section_id, 'status' =>$status ,'section_data' => $section_data,'createdby' => $fk_createdby);
|
||||
$is_entry_created = $this->Flyhi_Model->saveRecords($fields,SALESPD_SECTION_DATA);
|
||||
if($is_entry_created)
|
||||
{
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = $is_entry_created;
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['dataStatus'] = false;
|
||||
$data['status'] = REST_Controller::HTTP_NO_CONTENT;
|
||||
$data['msg'] = 'Something went wrong! Try Later';
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
}
|
||||
|
||||
public function saveFlyhiPDsection_post()
|
||||
{
|
||||
$records = $this->post('records');
|
||||
@ -1376,9 +1234,10 @@ class Flyhi_Controller extends REST_Controller {
|
||||
if($g_key == 'verification_type' && $g_value == 'Residence verification'){
|
||||
$flyhi_pd_type = 4;
|
||||
}
|
||||
if($g_key == 'verification_type' && $g_value == 'Office verification'){
|
||||
else if($g_key == 'verification_type' && $g_value == 'Office verification'){
|
||||
$flyhi_pd_type = 3;
|
||||
}
|
||||
else $flyhi_pd_type = 5;
|
||||
if($g_key == 'Same_as_current_residence_address' && $g_value == 'NO'){
|
||||
$current_resd_addr_check = 1;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user