NEW ISSUES FIXED WFH
This commit is contained in:
parent
060d5b28f7
commit
21bca8c4ae
@ -956,32 +956,18 @@ class PD_Controller extends REST_Controller {
|
||||
public function getPDCompleteDetails_post()
|
||||
{
|
||||
|
||||
//print_r($this->db->select('*')->from('PD_MIS')->GET()->result_array());
|
||||
//echo $this->assignPDTempalate(array());
|
||||
//die();
|
||||
|
||||
$records = $this->post('records');
|
||||
$pdid = $records['pd_id'];
|
||||
$pd_master_detials = $this->PD_Model->getPDMasterDetails($pdid);
|
||||
|
||||
$address_count = $this->db->SELECT('count(*) as count')->FROM(PDADDRESS.' as PDADDRESS')->WHERE('PDADDRESS.fk_pd_id',$pd_master_detials[0]['parent_pd_id'])->WHERE('assigned_pd is null')->GET()->result_array();
|
||||
|
||||
if($pd_master_detials[0]['is_child'] == 0)//primary PD
|
||||
{
|
||||
$address_count = $this->db->SELECT('count(*) as count')->FROM(PDADDRESS)->WHERE('fk_pd_id',$pdid)->GET()->result_array();
|
||||
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = array('address_count'=>(int)$address_count[0]['count']);
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
else// Addtional PD
|
||||
{
|
||||
$address_count = $this->db->SELECT('count(*) as count')->FROM(PDADDRESS.' as PDADDRESS')->WHERE('PDADDRESS.fk_pd_id',$pd_master_detials[0]['parent_pd_id'])->WHERE('assigned_pd is null')->GET()->result_array();
|
||||
//print_r($this->db->last_query());
|
||||
//If this one is addtional PD
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = array('address_count' => (int)$address_count[0]['count']);
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function assignPDTempalate($data)
|
||||
@ -2217,6 +2203,7 @@ class PD_Controller extends REST_Controller {
|
||||
$parent_pdid = $records['parent_pdid'];;
|
||||
$parent_form_index = null;
|
||||
$parent_forms = $this->config->item('parent_forms');
|
||||
$additional_pd_id = $pdid;
|
||||
|
||||
if($pdid != $parent_pdid)
|
||||
{
|
||||
@ -2359,7 +2346,7 @@ class PD_Controller extends REST_Controller {
|
||||
unset($records['fk_createdby']);
|
||||
unset($records['company_id']);
|
||||
unset($records['parent_pdid']);
|
||||
unset($records['rental_count_id']);
|
||||
//unset($records['rental_count_id']);
|
||||
$records = json_encode($records);
|
||||
if($processed_json != null)
|
||||
{
|
||||
@ -2372,6 +2359,14 @@ class PD_Controller extends REST_Controller {
|
||||
$id = $this->PD_Model->saveRecords($temp_array,PDFORMDETAILSJSON);
|
||||
if($id != "" || $id != null)
|
||||
{
|
||||
// Update form dummy entry against Additional PD common form ID to avoid every time fetch data from additional PD forms - scenarios like exist loan obligations, other family details
|
||||
if($formid == 4)//other asset
|
||||
{
|
||||
$temp_array = array('fk_form_id'=>$formid,'company_id' => $company_id,'fk_pd_id'=>$additional_pd_id,'fk_createdby'=>$createdby,'json'=>$records,'processed_json' => $processed_json,'rental_count_id' => $rental_count_id);
|
||||
$id = $this->PD_Model->saveRecords($temp_array,PDFORMDETAILSJSON);
|
||||
}
|
||||
// End Of update Additional Entry
|
||||
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = $id;
|
||||
@ -2396,12 +2391,16 @@ class PD_Controller extends REST_Controller {
|
||||
$company_id = $this->post('company_id') ? $this->post('company_id') : null;
|
||||
$parent_form_index = null;
|
||||
$parent_forms = $this->config->item('parent_forms');
|
||||
|
||||
$is_addtional_pd = 0;
|
||||
$additional_pd_id = null;
|
||||
if($pd_id != $parent_pd_id)
|
||||
{
|
||||
$is_addtional_pd = 1;
|
||||
$parent_form_index = array_search($pd_form_id,$parent_forms);
|
||||
$additional_pd_id = $pd_id;
|
||||
$pd_id = $parent_form_index != null ? $parent_pd_id : $pd_id;
|
||||
|
||||
|
||||
}
|
||||
//echo $pd_id;
|
||||
if($pd_form_id == 18)
|
||||
@ -2411,7 +2410,7 @@ class PD_Controller extends REST_Controller {
|
||||
$where_condition_array = array('fk_pd_id' => $pd_id,'fk_form_id' =>$pd_form_id , 'isactive' => 1);
|
||||
$form_count = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON);
|
||||
//print_r($form_count);
|
||||
if(count($form_count))
|
||||
if(!count($form_count))
|
||||
{
|
||||
//echo "dsjsbsdj";
|
||||
$fields = array('json','processed_json');
|
||||
@ -2430,6 +2429,8 @@ class PD_Controller extends REST_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($pd_form_id == 5 )//address form && ($parent_pd_id != $pd_id)
|
||||
{
|
||||
|
||||
@ -2460,7 +2461,7 @@ class PD_Controller extends REST_Controller {
|
||||
$address[] = array('address' => $temp_address['addressline1'],'address_type' => 1,'address_type_others' => '','state'=>$temp_address['fk_state'],'city'=>$temp_address['fk_city'],'citySearch' =>'','stateSearch'=>'','citySearch'=>'','pinSearch' => '','pincode'=>$temp_address['pincode'],'pincode_others' => '','locality' => '','locality_others'=>'','pd_location' => '','comment_locality' => '','estimated_area' => '','uom' => '','uom_others'=>'');
|
||||
|
||||
$records['addresses'] = $address;
|
||||
$records['address_form_remark'] = 'From COnd';
|
||||
$records['address_form_remark'] = '';
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = $records;
|
||||
@ -2476,17 +2477,41 @@ class PD_Controller extends REST_Controller {
|
||||
|
||||
if($company_id != null)
|
||||
{
|
||||
$where_condition_array = array('fk_form_id'=>$pd_form_id,'fk_pd_id'=>$pd_id,'company_id' => $company_id,'isactive' => 1);
|
||||
$where_condition_array = array('fk_form_id'=>$pd_form_id,'fk_pd_id'=>$pd_id,'company_id' => $company_id,'isactive' => 1);
|
||||
}
|
||||
$rec = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON);
|
||||
//print_r($this->db->last_query());
|
||||
|
||||
// if(count($rec))
|
||||
// {
|
||||
// if($pd_form_id == 8 && $is_addtional_pd == 1)
|
||||
// {
|
||||
// //echo "add";
|
||||
// $additional_count = $this->PD_Model->selectCustomRecords(array('*'),array('fk_form_id'=>8,'fk_pd_id'=>$additional_pd_id,'company_id' => $company_id,'isactive' => 1),PDFORMDETAILSJSON);
|
||||
// if(!count($additional_count))
|
||||
// {
|
||||
|
||||
// //get addtional PD business and other assets details and attach it with existing loan Obligation From(Parent PD existing Loan JSON Details).
|
||||
// $json = $this->getAddtionalPDAssetsWithLoanFromBusinessAndOtherAssets($rec[0]['json'],$pd_id,$additional_pd_id,$company_id);
|
||||
|
||||
// $data['dataStatus'] = true;
|
||||
// $data['status'] = REST_Controller::HTTP_OK;
|
||||
// $data['records'] = $json;
|
||||
// $this->response($data,REST_Controller::HTTP_OK);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
if(count($rec))
|
||||
{
|
||||
$json = null;
|
||||
if($pd_form_id == 17)
|
||||
{
|
||||
|
||||
foreach($rec as $r)
|
||||
{
|
||||
|
||||
$json[] = json_decode($r['json'],true);
|
||||
}
|
||||
}
|
||||
@ -2494,6 +2519,7 @@ class PD_Controller extends REST_Controller {
|
||||
{
|
||||
$json = json_decode($rec[0]['json']);
|
||||
}
|
||||
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = $json;
|
||||
@ -2510,6 +2536,190 @@ class PD_Controller extends REST_Controller {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getAddtionalPDAssetsWithLoanFromBusinessAndOtherAssets($parentpd_existing_loan_details,$pd_id,$additional_pd_id,$company_id = null)
|
||||
{
|
||||
$parentpd_existing_loan_details = json_decode($parentpd_existing_loan_details,true);
|
||||
//echo 'getAddtionalPDAssetsWithLoanFromBusinessAndOtherAssets';
|
||||
//Get Other Assets
|
||||
$fields = array('json','processed_json');
|
||||
$where_condition_array = array('isactive' => 1,'fk_form_id'=>4,'fk_pd_id'=>$pd_id);
|
||||
$other_assests = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON);
|
||||
|
||||
|
||||
//Get Business Assets
|
||||
$fields = array('json','processed_json');
|
||||
$where_condition_array = array('isactive' => 1,'fk_form_id'=>22,'fk_pd_id'=>$additional_pd_id);
|
||||
|
||||
if($company_id != null)
|
||||
{
|
||||
$where_condition_array['company_id'] = $company_id;
|
||||
}
|
||||
$business_assests = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON);
|
||||
|
||||
if(count($other_assests))
|
||||
{
|
||||
$other_assests = json_decode($other_assests[0]['json'],true);
|
||||
//print_r($other_assests);
|
||||
foreach($other_assests['assets_details'] as $other_assest)
|
||||
{
|
||||
|
||||
if($other_assest['emi'] == 'ýes')
|
||||
{
|
||||
$converted_data = $this->convertOtherAssetAsExistingLoanParams($other_assest);
|
||||
//print_r($converted_data);
|
||||
$parentpd_existing_loan_details['loan_details'][] = $converted_data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(count($business_assests))
|
||||
{
|
||||
$business_assests = json_decode($business_assests[0]['json'],true);
|
||||
//print_r($other_assests);
|
||||
|
||||
if(isset($business_assests['business_assets_for_address']))
|
||||
{
|
||||
if($business_assests['business_assets_for_address'][0]['business_emi'] == 'yes')
|
||||
{
|
||||
$data['loan_amount'] = "";
|
||||
$data['frequency'] = "";
|
||||
$data['other_frequency'] = "";
|
||||
$data['emi'] = "";
|
||||
$data['loan_type'] = "";
|
||||
$data['others_loan_type'] = "";
|
||||
$data['loan_taken_by'] = "";
|
||||
$data['lender'] = "";
|
||||
$data['others_lender'] = "";
|
||||
$data['original_tenure'] = "";
|
||||
$data['current_balance_tenure'] = "";
|
||||
$data['elapsed_tenure'] = "";
|
||||
$data['label'] = $business_assests['business_assets_for_address'][0]['address_label'];
|
||||
$parentpd_existing_loan_details['loan_details'][] = $data;
|
||||
}
|
||||
}
|
||||
foreach($business_assests['business_assets_details'] as $business_assest)
|
||||
{
|
||||
if($business_assest['business_emi'] == 'yes')
|
||||
{
|
||||
$converted_data = $this->convertBusinessAssetAsExistingLoanParams($business_assest);
|
||||
|
||||
$parentpd_existing_loan_details['loan_details'][] = $converted_data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return $parentpd_existing_loan_details;
|
||||
}
|
||||
|
||||
function convertBusinessAssetAsExistingLoanParams($business_assest)
|
||||
{
|
||||
$data['loan_amount'] = "";
|
||||
$data['frequency'] = "";
|
||||
$data['other_frequency'] = "";
|
||||
$data['emi'] = "";
|
||||
$data['loan_type'] = "";
|
||||
$data['others_loan_type'] = "";
|
||||
$data['loan_taken_by'] = "";
|
||||
$data['lender'] = "";
|
||||
$data['others_lender'] = "";
|
||||
$data['original_tenure'] = "";
|
||||
$data['current_balance_tenure'] = "";
|
||||
$data['elapsed_tenure'] = "";
|
||||
$label = null;
|
||||
|
||||
$fields = array('*');
|
||||
$where_condition_array = array('isactive' => 1);
|
||||
$investment_types = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,INVESTMENTTYPE);
|
||||
|
||||
$fields = array('*');
|
||||
$where_condition_array = array('isactive' => 1);
|
||||
$property_types = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PROPERTIES);
|
||||
|
||||
// print_r($investment_types);
|
||||
//print_r($other_assest);
|
||||
switch($business_assest['business_assets_mode'])
|
||||
{
|
||||
case 7 :
|
||||
$label = $business_assest['business_name_of_the_owner'][0]['name'].' - Investments ('. $investment_types[ ($business_assest['details'][0]['investments_type'] - 1) ]['name'] .')';
|
||||
break;
|
||||
|
||||
case 4 :
|
||||
$label = $business_assest['business_name_of_the_owner'][0]['name'].' - Equipment & Machinary ('. ($business_assest['details'][0]['equipment_manufacturing_description']) .')';
|
||||
break;
|
||||
|
||||
case 6 :
|
||||
$label = $business_assest['business_name_of_the_owner'][0]['name'].' - Life Insurance Policy';
|
||||
break;
|
||||
|
||||
case 2 :
|
||||
$label = $business_assest['business_name_of_the_owner'][0]['name'].' - Property ('. ($property_types[ $business_assest['details'][0]['property_type'] - 1]['name']) .')';
|
||||
break;
|
||||
}
|
||||
$data['label'] = $label;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
function convertOtherAssetAsExistingLoanParams($other_assest)
|
||||
{
|
||||
//echo 'convertOtherAssetAsExistingLoanParams';
|
||||
$data['loan_amount'] = "";
|
||||
$data['frequency'] = "";
|
||||
$data['other_frequency'] = "";
|
||||
$data['emi'] = "";
|
||||
$data['loan_type'] = "";
|
||||
$data['others_loan_type'] = "";
|
||||
$data['loan_taken_by'] = "";
|
||||
$data['lender'] = "";
|
||||
$data['others_lender'] = "";
|
||||
$data['original_tenure'] = "";
|
||||
$data['current_balance_tenure'] = "";
|
||||
$data['elapsed_tenure'] = "";
|
||||
$label = null;
|
||||
|
||||
$fields = array('*');
|
||||
$where_condition_array = array('isactive' => 1);
|
||||
$investment_types = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,INVESTMENTTYPE);
|
||||
|
||||
$fields = array('*');
|
||||
$where_condition_array = array('isactive' => 1);
|
||||
$property_types = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PROPERTIES);
|
||||
|
||||
// print_r($investment_types);
|
||||
//print_r($other_assest);
|
||||
switch($other_assest['assets_mode'])
|
||||
{
|
||||
case 7 :
|
||||
$label = $other_assest['name_of_the_owner'][0]['name'].' - Investments ('. $investment_types[ ($other_assest['details'][0]['investments_type'] - 1) ]['name'] .')';
|
||||
break;
|
||||
|
||||
case 4 :
|
||||
$label = $other_assest['name_of_the_owner'][0]['name'].' - Equipment & Machinary ('. ($other_assest['details'][0]['equipment_manufacturing_description']) .')';
|
||||
break;
|
||||
|
||||
case 6 :
|
||||
$label = $other_assest['name_of_the_owner'][0]['name'].' - Life Insurance Policy';
|
||||
break;
|
||||
|
||||
case 2 :
|
||||
$label = $other_assest['name_of_the_owner'][0]['name'].' - Property ('. ($property_types[ $other_assest['details'][0]['property_type'] - 1]['name']) .')';
|
||||
break;
|
||||
|
||||
//case
|
||||
}
|
||||
$data['label'] = $label;
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function renewGeneralFormForAddtionalPD($json)
|
||||
{
|
||||
//echo 'renewGeneralFormForAddtionalPD';
|
||||
@ -2531,10 +2741,10 @@ class PD_Controller extends REST_Controller {
|
||||
$json['companies'][$company_key]['business_years'] = "";
|
||||
$json['companies'][$company_key]['business_month'] = "";
|
||||
$json['companies'][$company_key]['business_date_object'] = "";
|
||||
$json['companies'][$company_key]['business_date_object'] = "";
|
||||
//$json['companies'][$company_key]['business_date_object'] = "";
|
||||
}
|
||||
}
|
||||
unset($json['company_with_relationships']);
|
||||
$json['company_with_relationships'][] = array('applicant_name' => "",'company_relationship' => '','relation_to_company' => "");
|
||||
$json['general_remark'] = "";
|
||||
|
||||
return (($json));
|
||||
@ -4479,8 +4689,8 @@ class PD_Controller extends REST_Controller {
|
||||
public function codeigniterViewTest_post()
|
||||
{
|
||||
|
||||
// echo MYUTIL::customIndianNumberFormat(4589621);
|
||||
// die();
|
||||
PDALERTS::pdnotification(652);
|
||||
die();
|
||||
$records = $this->post('records');
|
||||
$pdid = $records['pd_id'];
|
||||
$is_regenerate = 0;
|
||||
@ -4489,12 +4699,13 @@ class PD_Controller extends REST_Controller {
|
||||
$is_regenerate = 1;
|
||||
}
|
||||
//print_r($records);
|
||||
$data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($pdid);
|
||||
$data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid);
|
||||
$data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid);
|
||||
$data['score_questions_display'] = $this->PD_Model->getScoreableQuestionToDispaly();
|
||||
// $data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($pdid);
|
||||
// $data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid);
|
||||
// $data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid);
|
||||
// $data['score_questions_display'] = $this->PD_Model->getScoreableQuestionToDispaly();
|
||||
$data['pd_score'] = $this->calculateScore($pdid);
|
||||
//print_r($data['pd_score']['business']);//die();
|
||||
print_r($data['pd_score']);
|
||||
die();
|
||||
$score_for_chart = $data['pd_score']['score_summary']['overall_score']['final_score'] ? round($data['pd_score']['score_summary']['overall_score']['final_score'],2) : 0;
|
||||
//echo $score_for_chart;
|
||||
$chart = null;
|
||||
@ -4649,12 +4860,16 @@ class PD_Controller extends REST_Controller {
|
||||
|
||||
foreach($temp_data['companies'] as $company)
|
||||
{
|
||||
$temp_array = array('company_order_id' => $company['company_order_id'],'company_name' => $company['company_name'],'is_active' => $company['is_active'],'is_company_applicant'=>$company['is_company_applicant'],'business_entity_type'=>$company['business_entity_type'],'business_years'=>$company['business_years'],'business_month'=>$company['business_month'],'business_month'=>$company['business_month'],'business_date_object'=>$company['business_date_object']);
|
||||
|
||||
if($company['associate_pd_id'] == $pd_id)
|
||||
{
|
||||
$temp_array = array('company_order_id' => $company['company_order_id'],'company_name' => $company['company_name'],'is_active' => $company['is_active'],'is_company_applicant'=>$company['is_company_applicant'],'business_entity_type'=>$company['business_entity_type'],'business_years'=>$company['business_years'],'business_month'=>$company['business_month'],'business_month'=>$company['business_month'],'business_date_object'=>$company['business_date_object']);
|
||||
if(isset($company['business_entity_type_other']))
|
||||
{
|
||||
$temp_array['business_entity_type_other'] = $company['business_entity_type_other'];
|
||||
}
|
||||
$company_list[] = $temp_array;
|
||||
}
|
||||
}
|
||||
// $company_list = array( array('company_order_id' => 1));
|
||||
//print_r($company_list);
|
||||
|
||||
@ -19,9 +19,9 @@ class PDALERTS
|
||||
{
|
||||
if($pdid != "" || $pdid != null)
|
||||
{
|
||||
|
||||
//echo $pdid;
|
||||
$CI =&get_instance();
|
||||
$CI->load->library('AWS_SNS');
|
||||
//$CI->load->library('AWS_SNS');
|
||||
//$CI->load->library('Phpmailer_library');
|
||||
$pd_notification_configs = array();
|
||||
//die();
|
||||
@ -57,6 +57,39 @@ class PDALERTS
|
||||
//print_r($CI->db->last_query());
|
||||
//print_r($pd_notification_configs);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*********************************************/
|
||||
/*******Get Previous PD status from History Table*****/
|
||||
/*********************************************/
|
||||
$CI->db->SELECT("*");
|
||||
$CI->db->FROM(COMMONMASTER." as COMMONMASTER");
|
||||
$CI->db->WHERE("COMMONMASTER.primary_key",$pdid);
|
||||
$CI->db->WHERE("COMMONMASTER.field_name",'pd_status');
|
||||
$CI->db->WHERE("COMMONMASTER.table_name",PDTRIGGER);
|
||||
$pd_previous_status = $CI->db->GET()->result_array();
|
||||
|
||||
$is_flag = 0;
|
||||
//print_r($pd_previous_status);
|
||||
if($core_details[0]['pd_status'] != 'ALLOCATED' || $core_details[0]['pd_status'] != 'SCHEDULED')
|
||||
{
|
||||
if(count($pd_previous_status))
|
||||
{
|
||||
foreach($pd_previous_status as $previous_status)
|
||||
{
|
||||
if($previous_status['old_value'] == $core_details[0]['pd_status'])
|
||||
{
|
||||
$is_flag = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($is_flag == 0)
|
||||
{
|
||||
|
||||
/*********************************************/
|
||||
/*******Get SMS Notifications From Master*****/
|
||||
/*********************************************/
|
||||
@ -211,7 +244,7 @@ class PDALERTS
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -224,7 +257,7 @@ class PDALERTS
|
||||
/*********************************************/
|
||||
public static function stringReplace($msg,$core_details)
|
||||
{
|
||||
|
||||
|
||||
$msg = str_replace('{{applicant_name}}',$core_details[0]['applicant_name'],$msg);
|
||||
$msg = str_replace('{{applicant_id}}',$core_details[0]['lender_applicant_id'],$msg);
|
||||
$msg = str_replace('{{schedule_time}}',$core_details[0]['scheduled_on'],$msg);
|
||||
@ -235,8 +268,8 @@ class PDALERTS
|
||||
$msg = str_replace('{{lender_name}}',$core_details[0]['short_name'],$msg);
|
||||
$msg = str_replace('{{link}}',$core_details[0]['encrypted_url'],$msg);
|
||||
//$msg = str_replace('{{\n\n}}','\n\n',$msg);
|
||||
$msg = str_replace('\n','<br>',$msg);
|
||||
$msg = str_replace('\\',' ',$msg);
|
||||
$msg = str_replace('\n','',$msg);
|
||||
$msg = str_replace('\\','',$msg);
|
||||
$msg = nl2br($msg);
|
||||
|
||||
return $msg;
|
||||
@ -254,25 +287,27 @@ class PDALERTS
|
||||
|
||||
$mail->IsSMTP(); // Telling the class to use SMTP
|
||||
$mail->SMTPAuth = true;
|
||||
//$mail->SMTPDebug = 3;
|
||||
$mail->SMTPDebug = 1;
|
||||
$mail->SMTPSecure = "ssl";
|
||||
$mail->Host = 'bh-in-16.webhostbox.net'; // SMTP server
|
||||
$mail->Username = "noreply@ssa.sineedge.com"; // "The account"
|
||||
$mail->Password = "noreply@ssa"; // "The password"
|
||||
$mail->Port = 465; // "The port"
|
||||
$mail->addAddress('velmurugan.s@venbainfotech.com'); // Name is optional
|
||||
$mail->addAddress($lender_email); // Name is optional
|
||||
$mail->From = 'noreply@ssa.sineedge.com';
|
||||
$mail->FromName = 'SineEdge QC Team';
|
||||
$mail->isHTML(true); // Set email format to HTML
|
||||
$mail->Subject = 'PD Report For Application ID -'.$core_details[0]['lender_applicant_id'];
|
||||
$mail->Body = $msg;
|
||||
$mail->AltBody = $msg;
|
||||
|
||||
|
||||
|
||||
$logger = MYLOG::logFunction();
|
||||
if(!$mail->send()) {
|
||||
//echo 'Message could not be sent.';
|
||||
//echo 'Mailer Error: ' . $mail->ErrorInfo;
|
||||
$logger->error("Mailer Error:" ,array($mail->ErrorInfo));
|
||||
|
||||
} else {
|
||||
//echo 'Message has been sent';
|
||||
$logger->error("Mailer Send:" ,array('mail ID' => $lender_email,'Status' => 'SEND'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -107,12 +107,12 @@ class PDSCORE
|
||||
|
||||
$neibourhood_check_as_per_pd_officer_max_score = ($l1_general/100) * ($neibourhood_check_as_per_pd_officer_L2/100) * max($neibourhood_check_as_per_pd_officer);
|
||||
|
||||
$score_questions['general']['neibourhood_check_as_per_pd_officer'] = array('l1_weightage' => $l1_general,'l2_weightage' => $neibourhood_check_as_per_pd_officer_L2,'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['neibourhood_check_as_per_pd_officer'],'attributed_score' => round($neibourhood_check_as_per_pd_officer_actual_score,2), 'max_score' => round($neibourhood_check_as_per_pd_officer_max_score,2),'score_band'=>$neibourhood_check_as_per_pd_officer[$score_questions['general']['neibourhood_check_as_per_pd_officer'] != "" || $score_questions['general']['neibourhood_check_as_per_pd_officer'] != null ?$score_questions['general']['neibourhood_check_as_per_pd_officer']: "Negative" ],'max_score_band' => max($neibourhood_check_as_per_pd_officer));
|
||||
$score_questions['general']['neibourhood_check_as_per_pd_officer'] = array('l1_weightage' => $l1_general,'l2_weightage' => $neibourhood_check_as_per_pd_officer_L2,'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['neibourhood_check_as_per_pd_officer'],'attributed_score' => ($neibourhood_check_as_per_pd_officer_actual_score), 'max_score' => ($neibourhood_check_as_per_pd_officer_max_score),'score_band'=>$neibourhood_check_as_per_pd_officer[$score_questions['general']['neibourhood_check_as_per_pd_officer'] != "" || $score_questions['general']['neibourhood_check_as_per_pd_officer'] != null ?$score_questions['general']['neibourhood_check_as_per_pd_officer']: "Negative" ],'max_score_band' => max($neibourhood_check_as_per_pd_officer));
|
||||
}
|
||||
|
||||
//$general_distribute_level_weightage = round($general_distribute_level_weightage,2);
|
||||
|
||||
|
||||
|
||||
//echo $general_distribute_level_weightage;
|
||||
|
||||
|
||||
|
||||
@ -125,8 +125,10 @@ class PDSCORE
|
||||
$person_met_is_applicant_actual_score = ($l1_general/100) * ($person_met_is_applicant_L2/100) * $person_met_is_applicant[$score_questions['general']['person_met_is_applicant']];
|
||||
|
||||
$person_met_is_applicant_max_score = ($l1_general/100) * ($person_met_is_applicant_L2/100) * max($person_met_is_applicant);
|
||||
|
||||
$score_questions['general']['person_met_is_applicant'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($person_met_is_applicant_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['person_met_is_applicant'],'attributed_score' => round($person_met_is_applicant_actual_score,2), 'max_score' => round($person_met_is_applicant_max_score,2),'score_band'=>($person_met_is_applicant[$score_questions['general']['person_met_is_applicant']]),'max_score_band' => max($person_met_is_applicant));
|
||||
//echo $person_met_is_applicant_L2;
|
||||
//echo $person_met_is_applicant_max_score;
|
||||
|
||||
$score_questions['general']['person_met_is_applicant'] = array('l1_weightage' => $l1_general,'l2_weightage' => ($person_met_is_applicant_L2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['person_met_is_applicant'],'attributed_score' => ($person_met_is_applicant_actual_score), 'max_score' => ($person_met_is_applicant_max_score),'score_band'=>($person_met_is_applicant[$score_questions['general']['person_met_is_applicant']]),'max_score_band' => max($person_met_is_applicant));
|
||||
|
||||
//######1.2 pd_location_approach
|
||||
|
||||
@ -136,7 +138,7 @@ class PDSCORE
|
||||
|
||||
$pd_location_approach_max_score = ($l1_general/100) * ($pd_location_approach_L2/100) * max($pd_location_approach);
|
||||
|
||||
$score_questions['general']['pd_location_approach'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($pd_location_approach_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['pd_location_approach'],'attributed_score' => round($pd_location_approach_actual_score,2), 'max_score' => round($pd_location_approach_max_score,2),'score_band'=>$pd_location_approach[$score_questions['general']['pd_location_approach']],'max_score_band' => max($pd_location_approach));
|
||||
$score_questions['general']['pd_location_approach'] = array('l1_weightage' => $l1_general,'l2_weightage' => ($pd_location_approach_L2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['pd_location_approach'],'attributed_score' => ($pd_location_approach_actual_score), 'max_score' => ($pd_location_approach_max_score),'score_band'=>$pd_location_approach[$score_questions['general']['pd_location_approach']],'max_score_band' => max($pd_location_approach));
|
||||
|
||||
//######1.3 comment_locality
|
||||
|
||||
@ -146,7 +148,7 @@ class PDSCORE
|
||||
|
||||
$comment_locality_max_score = ($l1_general/100) * ($comment_locality_L2/100) * max($comment_locality);
|
||||
|
||||
$score_questions['general']['comment_locality'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($comment_locality_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['comment_locality'],'attributed_score' => round($comment_locality_actual_score,2), 'max_score' => round($comment_locality_max_score,2),'score_band'=>$comment_locality[$score_questions['general']['comment_locality']],'max_score_band' => max($comment_locality));
|
||||
$score_questions['general']['comment_locality'] = array('l1_weightage' => $l1_general,'l2_weightage' => ($comment_locality_L2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['comment_locality'],'attributed_score' => ($comment_locality_actual_score), 'max_score' => ($comment_locality_max_score),'score_band'=>$comment_locality[$score_questions['general']['comment_locality']],'max_score_band' => max($comment_locality));
|
||||
|
||||
//######1.4 customer_behaviour
|
||||
|
||||
@ -156,7 +158,7 @@ class PDSCORE
|
||||
|
||||
$customer_behaviour_max_score = ($l1_general/100) * ($customer_behaviour_L2/100) * max($customer_behaviour);
|
||||
|
||||
$score_questions['general']['customer_behaviour'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($customer_behaviour_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['customer_behaviour'],'attributed_score' => round($customer_behaviour_actual_score,2), 'max_score' => round($customer_behaviour_max_score,2),'score_band'=>$customer_behaviour[$score_questions['general']['customer_behaviour']],'max_score_band' => max($customer_behaviour));
|
||||
$score_questions['general']['customer_behaviour'] = array('l1_weightage' => $l1_general,'l2_weightage' => ($customer_behaviour_L2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['customer_behaviour'],'attributed_score' => ($customer_behaviour_actual_score), 'max_score' => ($customer_behaviour_max_score),'score_band'=>$customer_behaviour[$score_questions['general']['customer_behaviour']],'max_score_band' => max($customer_behaviour));
|
||||
|
||||
//######1.6 was_the_company_name_board_sighted
|
||||
|
||||
@ -166,7 +168,7 @@ class PDSCORE
|
||||
|
||||
$was_the_company_name_board_sighted_max_score = ($l1_general/100) * ($was_the_company_name_board_sighted_L2/100) * max($was_the_company_name_board_sighted);
|
||||
|
||||
$score_questions['general']['was_the_company_name_board_sighted'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($was_the_company_name_board_sighted_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['was_the_company_name_board_sighted'],'attributed_score' => round($was_the_company_name_board_sighted_actual_score,2), 'max_score' => round($was_the_company_name_board_sighted_max_score,2),'score_band'=>$was_the_company_name_board_sighted[$score_questions['general']['was_the_company_name_board_sighted']],'max_score_band' => max($was_the_company_name_board_sighted));
|
||||
$score_questions['general']['was_the_company_name_board_sighted'] = array('l1_weightage' => $l1_general,'l2_weightage' => ($was_the_company_name_board_sighted_L2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['was_the_company_name_board_sighted'],'attributed_score' => ($was_the_company_name_board_sighted_actual_score), 'max_score' => ($was_the_company_name_board_sighted_max_score),'score_band'=>$was_the_company_name_board_sighted[$score_questions['general']['was_the_company_name_board_sighted']],'max_score_band' => max($was_the_company_name_board_sighted));
|
||||
|
||||
//######1.7 otp_done
|
||||
|
||||
@ -176,7 +178,7 @@ class PDSCORE
|
||||
|
||||
$otp_done_max_score = ($l1_general/100) * ($otp_done_L2/100) * max($otp_done);
|
||||
|
||||
$score_questions['general']['otp_done'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($otp_done_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['otp_done'],'attributed_score' => round($otp_done_actual_score,2), 'max_score' => round($otp_done_max_score,2),'score_band'=>$otp_done[$score_questions['general']['otp_done']],'max_score_band' => max($otp_done));
|
||||
$score_questions['general']['otp_done'] = array('l1_weightage' => $l1_general,'l2_weightage' => ($otp_done_L2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['otp_done'],'attributed_score' => ($otp_done_actual_score), 'max_score' => ($otp_done_max_score),'score_band'=>$otp_done[$score_questions['general']['otp_done']],'max_score_band' => max($otp_done));
|
||||
|
||||
//######1.8 qualification
|
||||
|
||||
@ -187,7 +189,7 @@ class PDSCORE
|
||||
$qualification_max_score = ($l1_general/100) * ($qualification_L2/100) * max($qualification['id_score']);
|
||||
$keys = array_keys($qualification['name_score']);
|
||||
|
||||
$score_questions['general']['qualification'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($qualification_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $keys[($score_questions['general']['qualification']-1)],'attributed_score' => round($qualification_actual_score,2), 'max_score' => round($qualification_max_score,2),'score_band'=>$qualification['id_score'][$score_questions['general']['qualification']],'max_score_band' => max($qualification['id_score']));
|
||||
$score_questions['general']['qualification'] = array('l1_weightage' => $l1_general,'l2_weightage' => ($qualification_L2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $keys[($score_questions['general']['qualification']-1)],'attributed_score' => ($qualification_actual_score), 'max_score' => ($qualification_max_score),'score_band'=>$qualification['id_score'][$score_questions['general']['qualification']],'max_score_band' => max($qualification['id_score']));
|
||||
|
||||
//######1.9 value of assets as a % of Loan Amount
|
||||
//print_r($personal_asset_grid);
|
||||
@ -240,7 +242,7 @@ class PDSCORE
|
||||
$asset_calculation_details['score'] = $final_asset_score;
|
||||
// echo "final_asset_score--".$final_asset_score;
|
||||
// die();
|
||||
$score_questions['general']['value_of_other_assets'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($value_of_other_assets_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['value_of_other_assets'],'attributed_score' => round($final_asset_attributed_score,2), 'max_score' => round((($l1_general/100 ) * ($value_of_other_assets_L2/100) * 10),2),'score_band'=> $final_asset_score,'max_score_band' => 10);
|
||||
$score_questions['general']['value_of_other_assets'] = array('l1_weightage' => $l1_general,'l2_weightage' => ($value_of_other_assets_L2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['value_of_other_assets'],'attributed_score' => ($final_asset_attributed_score), 'max_score' => ((($l1_general/100 ) * ($value_of_other_assets_L2/100) * 10)),'score_band'=> $final_asset_score,'max_score_band' => 10);
|
||||
|
||||
|
||||
/*-----------END OF GENERAL SECTION -----------*/
|
||||
@ -291,7 +293,7 @@ class PDSCORE
|
||||
|
||||
$minimum_supplier_info_max_score = strcasecmp($score_questions['business']['minimum_supplier_info'],'Not Applicable') ? ($l1_business/100) * ($minimum_supplier_info_L2/100) * max($minimum_supplier_info) : 0;
|
||||
|
||||
$score_questions['business']['minimum_supplier_info'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($minimum_supplier_info_L2,2),'answer' => $score_questions['business']['minimum_supplier_info'],'attributed_score' => round($minimum_supplier_info_actual_score,2), 'max_score' => round($minimum_supplier_info_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band'=>$minimum_supplier_info [ $score_questions['business']['minimum_supplier_info'] ],'max_score_band' => max($minimum_supplier_info));
|
||||
$score_questions['business']['minimum_supplier_info'] = array('l1_weightage' => $l1_business,'l2_weightage' => ($minimum_supplier_info_L2),'answer' => $score_questions['business']['minimum_supplier_info'],'attributed_score' => ($minimum_supplier_info_actual_score), 'max_score' => ($minimum_supplier_info_max_score),'distributed_weightage' => $business_distribute_level_weightage,'score_band'=>$minimum_supplier_info [ $score_questions['business']['minimum_supplier_info'] ],'max_score_band' => max($minimum_supplier_info));
|
||||
|
||||
//######2.8 atleast one client info provided
|
||||
$minimum_client_info_L2 = $business_distribute_level_weightage ? ($minimum_client_info_L2 + ($minimum_client_info_L2 / (100 - $business_distribute_level_weightage )) * $business_distribute_level_weightage) : $minimum_client_info_L2 ;
|
||||
@ -300,16 +302,16 @@ class PDSCORE
|
||||
|
||||
$minimum_client_info_max_score = strcasecmp($score_questions['business']['minimum_client_info'],'Not Applicable') ? ($l1_business/100) * ($minimum_client_info_L2/100) * max($minimum_client_info) : 0;
|
||||
|
||||
$score_questions['business']['minimum_client_info'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($minimum_client_info_L2,2),'answer' => $score_questions['business']['minimum_client_info'],'attributed_score' => round($minimum_client_info_actual_score,2), 'max_score' => round($minimum_client_info_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band'=>$minimum_client_info [ $score_questions['business']['minimum_client_info'] ],'max_score_band' => max($minimum_client_info));
|
||||
$score_questions['business']['minimum_client_info'] = array('l1_weightage' => $l1_business,'l2_weightage' => ($minimum_client_info_L2),'answer' => $score_questions['business']['minimum_client_info'],'attributed_score' => ($minimum_client_info_actual_score), 'max_score' => ($minimum_client_info_max_score),'distributed_weightage' => $business_distribute_level_weightage,'score_band'=>$minimum_client_info [ $score_questions['business']['minimum_client_info'] ],'max_score_band' => max($minimum_client_info));
|
||||
|
||||
//######2.9 stock of raw material
|
||||
$stock_raw_material_enough_L2 = $business_distribute_level_weightage ? ($stock_raw_material_enough_L2 + ($stock_raw_material_enough_L2 / (100 - $business_distribute_level_weightage )) * $business_distribute_level_weightage) : $stock_raw_material_enough_L2 ;
|
||||
|
||||
$stock_raw_material_enough_actual_score = ($l1_business/100) * ($stock_raw_material_enough_L2/100) * $stock_answer_scores [ strtolower($score_questions['business']['stock_raw_material_enough']) ];
|
||||
|
||||
$stock_raw_material_enough_max_score = ($l1_business/100) * ($stock_raw_material_enough_L2/100) * max($stock_answer_scores);
|
||||
$stock_raw_material_enough_max_score = strcasecmp($score_questions['business']['stock_raw_material_enough'],'Not Applicable') ? ($l1_business/100) * ($stock_raw_material_enough_L2/100) * max($stock_answer_scores) : 0;
|
||||
|
||||
$score_questions['business']['stock_raw_material_enough'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($stock_raw_material_enough_L2,2),'answer' => $score_questions['business']['stock_raw_material_enough'],'attributed_score' => round($stock_raw_material_enough_actual_score,2), 'max_score' => round($stock_raw_material_enough_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $stock_answer_scores [ strtolower($score_questions['business']['stock_raw_material_enough']) ],'max_score_band' =>max($stock_answer_scores) );
|
||||
$score_questions['business']['stock_raw_material_enough'] = array('l1_weightage' => $l1_business,'l2_weightage' => ($stock_raw_material_enough_L2),'answer' => $score_questions['business']['stock_raw_material_enough'],'attributed_score' => ($stock_raw_material_enough_actual_score), 'max_score' => ($stock_raw_material_enough_max_score),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $stock_answer_scores [ strtolower($score_questions['business']['stock_raw_material_enough']) ],'max_score_band' =>max($stock_answer_scores) );
|
||||
|
||||
//######2.10 stock_finished_goods_enough
|
||||
$stock_finished_goods_enough_L2 = $business_distribute_level_weightage ? ($stock_finished_goods_enough_L2 + ($stock_finished_goods_enough_L2 / (100 - $business_distribute_level_weightage )) * $business_distribute_level_weightage) : $stock_finished_goods_enough_L2 ;
|
||||
@ -320,7 +322,7 @@ class PDSCORE
|
||||
|
||||
|
||||
$temp_stock_finished_goods_enough = strtolower($score_questions['business']['stock_finished_goods_enough']);
|
||||
$score_questions['business']['stock_finished_goods_enough'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($stock_finished_goods_enough_L2,2),'answer' => $score_questions['business']['stock_finished_goods_enough'],'attributed_score' => round($stock_finished_goods_enough_actual_score,2), 'max_score' => round($stock_finished_goods_enough_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $stock_answer_scores [ $temp_stock_finished_goods_enough != "" || $temp_stock_finished_goods_enough != null ? $temp_stock_finished_goods_enough : "no" ],'max_score_band' => max($stock_answer_scores));
|
||||
$score_questions['business']['stock_finished_goods_enough'] = array('l1_weightage' => $l1_business,'l2_weightage' => ($stock_finished_goods_enough_L2),'answer' => $score_questions['business']['stock_finished_goods_enough'],'attributed_score' => ($stock_finished_goods_enough_actual_score), 'max_score' => ($stock_finished_goods_enough_max_score),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $stock_answer_scores [ $temp_stock_finished_goods_enough != "" || $temp_stock_finished_goods_enough != null ? $temp_stock_finished_goods_enough : "no" ],'max_score_band' => max($stock_answer_scores));
|
||||
|
||||
|
||||
|
||||
@ -349,10 +351,10 @@ class PDSCORE
|
||||
// echo $business_certificates_distribution;die();
|
||||
$certificate_actual_score = 0;
|
||||
$certificate_max_score = 0;
|
||||
|
||||
//print_r($score_questions['business']['cerificates']);
|
||||
foreach($score_questions['business']['cerificates'] as $certificate_key => $certificate)
|
||||
{
|
||||
|
||||
//print_r($certificate);
|
||||
$acutal_score = 0;
|
||||
$max_score = 0;
|
||||
if(strcasecmp($certificate,'not applicable'))
|
||||
@ -361,17 +363,17 @@ class PDSCORE
|
||||
$max_score = ($l1_business/100) * ($business_certificates_distribution/100) * max($cerificates);
|
||||
|
||||
}
|
||||
$score_questions['business']['cerificates'][$certificate_key] = array('answer' => $certificate,'attributed_score' => round($acutal_score,2), 'max_score' => round($max_score,2),'score_band' => $cerificates[$certificate],'max_score_band'=> max($cerificates),'l1_weightage' =>round($l1_business,2),'l2_weightage'=> round($business_certificates_distribution,2));
|
||||
$score_questions['business']['cerificates'][$certificate_key] = array('answer' => $certificate,'attributed_score' => ($acutal_score), 'max_score' => ($max_score),'score_band' => $cerificates[$certificate],'max_score_band'=> max($cerificates),'l1_weightage' =>($l1_business),'l2_weightage'=> ($business_certificates_distribution));
|
||||
|
||||
$certificate_actual_score += $acutal_score;
|
||||
$certificate_max_score += $max_score;
|
||||
}
|
||||
|
||||
$score_questions['business']['cerificates']['l1_weightage'] = $l1_business;
|
||||
$score_questions['business']['cerificates']['l2_weightage'] = round(($business_certificates_distribution * $business_certificates_distribution_count),2);
|
||||
$score_questions['business']['cerificates']['l2_weightage'] = (($business_certificates_distribution * $business_certificates_distribution_count));
|
||||
$score_questions['business']['cerificates']['distributed_weightage'] = $business_distribute_level_weightage;
|
||||
$score_questions['business']['cerificates']['max_score'] = round($certificate_max_score,2);
|
||||
$score_questions['business']['cerificates']['attributed_score'] = round($certificate_actual_score,2);
|
||||
$score_questions['business']['cerificates']['max_score'] = ($certificate_max_score);
|
||||
$score_questions['business']['cerificates']['attributed_score'] = ($certificate_actual_score);
|
||||
$score_questions['business']['cerificates']['score_band'] = 'Derived';
|
||||
$score_questions['business']['cerificates']['max_score_band'] = 'Derived';
|
||||
|
||||
@ -404,7 +406,7 @@ class PDSCORE
|
||||
|
||||
$no_of_years_business_run_max_score = ($l1_business/100) * ($no_of_years_business_run_L2/100) * max($no_of_years_business_run);
|
||||
|
||||
$score_questions['business']['no_of_years_business_run'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($no_of_years_business_run_L2,2),'answer' => $score_questions['business']['no_of_years_business_run'],'attributed_score' => round($no_of_years_business_run_actual_score,2), 'max_score' => round($no_of_years_business_run_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $score_band,'max_score_band' => max($no_of_years_business_run));
|
||||
$score_questions['business']['no_of_years_business_run'] = array('l1_weightage' => $l1_business,'l2_weightage' => ($no_of_years_business_run_L2),'answer' => $score_questions['business']['no_of_years_business_run'],'attributed_score' => ($no_of_years_business_run_actual_score), 'max_score' => ($no_of_years_business_run_max_score),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $score_band,'max_score_band' => max($no_of_years_business_run));
|
||||
|
||||
|
||||
//######2.2 business seasonal
|
||||
@ -416,7 +418,7 @@ class PDSCORE
|
||||
|
||||
$business_seasonality_max_score = ($l1_business/100) * ($business_seasonality_L2/100) * max($business_seasonality);
|
||||
|
||||
$score_questions['business']['business_seasonality'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($business_seasonality_L2,2),'answer' => $score_questions['business']['business_seasonality'],'attributed_score' => round($business_seasonality_actual_score,2), 'max_score' => round($business_seasonality_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $business_seasonality[ $score_questions['business']['business_seasonality'] ],'max_score_band' => max($business_seasonality));
|
||||
$score_questions['business']['business_seasonality'] = array('l1_weightage' => $l1_business,'l2_weightage' => ($business_seasonality_L2),'answer' => $score_questions['business']['business_seasonality'],'attributed_score' => ($business_seasonality_actual_score), 'max_score' =>($business_seasonality_max_score),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $business_seasonality[ $score_questions['business']['business_seasonality'] ],'max_score_band' => max($business_seasonality));
|
||||
|
||||
//######2.3 employees_total
|
||||
$employees_total_actual_score = 0;
|
||||
@ -444,7 +446,7 @@ class PDSCORE
|
||||
|
||||
$employees_total_max_score = ($l1_business/100) * ($employees_total_L2/100) * max($employees_total);
|
||||
|
||||
$score_questions['business']['employees_total'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($employees_total_L2,2),'answer' => $score_questions['business']['employees_total'],'attributed_score' => round($employees_total_actual_score,2), 'max_score' => round($employees_total_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' =>$score_band,'max_score_band' => max($employees_total));
|
||||
$score_questions['business']['employees_total'] = array('l1_weightage' => $l1_business,'l2_weightage' => ($employees_total_L2),'answer' => $score_questions['business']['employees_total'],'attributed_score' => ($employees_total_actual_score), 'max_score' => ($employees_total_max_score),'distributed_weightage' => $business_distribute_level_weightage,'score_band' =>$score_band,'max_score_band' => max($employees_total));
|
||||
|
||||
|
||||
//######2.5 owned_property
|
||||
@ -454,7 +456,7 @@ class PDSCORE
|
||||
$owned_property_actual_score = ($l1_business/100) * ($owned_property_L2/100) * $owned_property[ $score_questions['business']['owned_property'] ];
|
||||
$owned_property_max_score = ($l1_business/100) * ($owned_property_L2/100) * max($owned_property);
|
||||
|
||||
$score_questions['business']['owned_property'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($owned_property_L2,2),'answer' => $score_questions['business']['owned_property'],'attributed_score' => round($owned_property_actual_score,2), 'max_score' => round($owned_property_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $owned_property[ $score_questions['business']['owned_property'] ],'max_score_band' => max($owned_property));
|
||||
$score_questions['business']['owned_property'] = array('l1_weightage' => $l1_business,'l2_weightage' => ($owned_property_L2),'answer' => $score_questions['business']['owned_property'],'attributed_score' => ($owned_property_actual_score), 'max_score' => ($owned_property_max_score),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $owned_property[ $score_questions['business']['owned_property'] ],'max_score_band' => max($owned_property));
|
||||
|
||||
//######2.6 owned_vechile
|
||||
$owned_vechile_L2 = $business_distribute_level_weightage ? ($owned_vechile_L2 + ($owned_vechile_L2 / (100 - $business_distribute_level_weightage )) * $business_distribute_level_weightage) : $owned_vechile_L2 ;
|
||||
@ -462,7 +464,7 @@ class PDSCORE
|
||||
$owned_vechile_actual_score = ($l1_business/100) * ($owned_vechile_L2/100) * $owned_vechile[ $score_questions['business']['owned_vechile'] ];
|
||||
$owned_vechile_max_score = ($l1_business/100) * ($owned_vechile_L2/100) * max($owned_vechile);
|
||||
|
||||
$score_questions['business']['owned_vechile'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($owned_vechile_L2,2),'answer' => $score_questions['business']['owned_vechile'],'attributed_score' => round($owned_vechile_actual_score,2), 'max_score' => round($owned_vechile_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $owned_vechile[ $score_questions['business']['owned_vechile'] ],'max_score_band' => max($owned_vechile));
|
||||
$score_questions['business']['owned_vechile'] = array('l1_weightage' => $l1_business,'l2_weightage' => ($owned_vechile_L2),'answer' => $score_questions['business']['owned_vechile'],'attributed_score' => ($owned_vechile_actual_score), 'max_score' => ($owned_vechile_max_score),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $owned_vechile[ $score_questions['business']['owned_vechile'] ],'max_score_band' => max($owned_vechile));
|
||||
|
||||
//######2.11 location_suited_for_busienss
|
||||
|
||||
@ -471,7 +473,7 @@ class PDSCORE
|
||||
$location_suited_for_busienss_actual_score = ($l1_business/100) * ($location_suited_for_busienss_L2/100) * $location_suited_for_busienss[ $score_questions['business']['location_suited_for_busienss'] ];
|
||||
$location_suited_for_busienss_max_score = ($l1_business/100) * ($location_suited_for_busienss_L2/100) * max($location_suited_for_busienss);
|
||||
|
||||
$score_questions['business']['location_suited_for_busienss'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($location_suited_for_busienss_L2,2),'answer' => $score_questions['business']['location_suited_for_busienss'],'attributed_score' => round($location_suited_for_busienss_actual_score,2), 'max_score' => round($location_suited_for_busienss_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $location_suited_for_busienss[ $score_questions['business']['location_suited_for_busienss'] ],'max_score_band' => max($location_suited_for_busienss));
|
||||
$score_questions['business']['location_suited_for_busienss'] = array('l1_weightage' => $l1_business,'l2_weightage' => ($location_suited_for_busienss_L2),'answer' => $score_questions['business']['location_suited_for_busienss'],'attributed_score' => ($location_suited_for_busienss_actual_score), 'max_score' => ($location_suited_for_busienss_max_score),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $location_suited_for_busienss[ $score_questions['business']['location_suited_for_busienss'] ],'max_score_band' => max($location_suited_for_busienss));
|
||||
|
||||
//######2.11 business_activity_has_seen
|
||||
|
||||
@ -480,7 +482,7 @@ class PDSCORE
|
||||
$business_activity_has_seen_actual_score = ($l1_business/100) * ($business_activity_has_seen_L2/100) * $business_activity_has_seen[ $score_questions['business']['business_activity_has_seen'] ];
|
||||
$business_activity_has_seen_max_score = ($l1_business/100) * ($business_activity_has_seen_L2/100) * max($business_activity_has_seen);
|
||||
|
||||
$score_questions['business']['business_activity_has_seen'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($business_activity_has_seen_L2,2),'answer' => $score_questions['business']['business_activity_has_seen'],'attributed_score' => round($business_activity_has_seen_actual_score,2), 'max_score' => round($business_activity_has_seen_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $business_activity_has_seen[ $score_questions['business']['business_activity_has_seen'] ], 'max_score_band' => max($business_activity_has_seen));
|
||||
$score_questions['business']['business_activity_has_seen'] = array('l1_weightage' => $l1_business,'l2_weightage' => ($business_activity_has_seen_L2),'answer' => $score_questions['business']['business_activity_has_seen'],'attributed_score' => ($business_activity_has_seen_actual_score), 'max_score' => ($business_activity_has_seen_max_score),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $business_activity_has_seen[ $score_questions['business']['business_activity_has_seen'] ], 'max_score_band' => max($business_activity_has_seen));
|
||||
|
||||
//######2.13 vintage business banking
|
||||
|
||||
@ -509,7 +511,7 @@ class PDSCORE
|
||||
|
||||
$vintage_of_business_account_max_score = ($l1_business/100) * ($vintage_of_business_account_L2/100) * max($vintage_of_business_account);
|
||||
|
||||
$score_questions['business']['vintage_of_business_account'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($business_activity_has_seen_L2,2),'answer' => $score_questions['business']['vintage_of_business_account'],'attributed_score' => round($vintage_of_business_account_actual_score,2), 'max_score' => round($vintage_of_business_account_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $score_band,'max_score_band' => max($vintage_of_business_account));
|
||||
$score_questions['business']['vintage_of_business_account'] = array('l1_weightage' => $l1_business,'l2_weightage' => ($business_activity_has_seen_L2),'answer' => $score_questions['business']['vintage_of_business_account'],'attributed_score' => ($vintage_of_business_account_actual_score), 'max_score' => ($vintage_of_business_account_max_score),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $score_band,'max_score_band' => max($vintage_of_business_account));
|
||||
/*-----------END OF BUSINESS SECTION -----------*/
|
||||
|
||||
|
||||
|
||||
@ -2,10 +2,7 @@
|
||||
|
||||
class SMS_GUPSHUP
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
public static function sendSMS($msg,$no)
|
||||
{
|
||||
$CI =&get_instance();
|
||||
@ -17,8 +14,10 @@ class SMS_GUPSHUP
|
||||
|
||||
$client = new \GuzzleHttp\Client();
|
||||
$response = $client->post($sms_api_url);
|
||||
$contents = (string) $response->getBody();
|
||||
|
||||
|
||||
$logger = MYLOG::logFunction();
|
||||
$logger->info("Msg Send Status",array('response_data' => $contents));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -276,7 +276,7 @@ class PD_Model extends SPARQ_Model {
|
||||
|
||||
//Get all AddtionalPD's ID
|
||||
$addtional_pd_ids = $this->getAddtionalPDIDs($parent_pd_id);
|
||||
print_r($addtional_pd_ids);
|
||||
//print_r($addtional_pd_ids);
|
||||
$addtional_pd_ids_string = array();
|
||||
if(count($addtional_pd_ids))
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user