SCORE IMPROVED

This commit is contained in:
velz 2019-03-16 22:46:37 +05:30
parent a5167015c6
commit 03c8a7a689
9 changed files with 196 additions and 82 deletions

View File

@ -89,7 +89,7 @@ $autoload['drivers'] = array();
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myuitil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup');
$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myutil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup');
/*
| -------------------------------------------------------------------

View File

@ -26,6 +26,7 @@ class PD_Controller extends REST_Controller {
$this->load->library('AWS_SNS');
$this->load->helper('GETPDFORMDETAILS');
$this->load->helper('GETPROCESSEDJSON');
$this->load->helper('MYUTIL');
$this->load->library('pdfgenerator');
$this->load->library('excel');
$this->load->library('phpmailer_library');
@ -4319,6 +4320,7 @@ class PD_Controller extends REST_Controller {
public function codeigniterViewTest_post()
{
$records = $this->post('records');
$pdid = $records['pd_id'];
$is_regenerate = 0;
@ -4330,9 +4332,19 @@ class PD_Controller extends REST_Controller {
$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($pdid);
$data['pd_score'] = $this->calculateScore($pdid);
//print_r($data['score_questions_display']);
//print_r($data['pd_score']);
//die();
// foreach($data['pd_score']['general'] as $key => $value)
// {
// // echo '\n\n';
// MYUTIL::findQuestionByKey($data['score_questions_display'],$key);
// // echo '\n\n';
// // echo $key;
// // echo "***********************";
// }
// 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;
@ -5390,7 +5402,7 @@ class PD_Controller extends REST_Controller {
//seperate PD Scorable quesitons from JSON
$score_questions = $this->seperateScoreQuestions($form_data,$pd_master_details[0]['is_otp_done']);
// print_r($score_questions);
//print_r($score_questions);die();
// echo "###################################";
//Get Pesrsonal Assets Grid Masters Details
$this->db->SELECT('*');
@ -5441,27 +5453,28 @@ class PD_Controller extends REST_Controller {
#####General Form Questions########
$general_form = (json_decode($form_data[18][0]['processed_json'],true));
// echo "seperateScoreQuestions";
// print_r($general_form);die();
//print_r($general_form);die();
// - QNO (1.7) OTP AUTHENDICATION DONE
$score_questions['general']['otp_done'] = $OTP ? 'Yes': 'No';
// 1 - QNO(1.1) - Is Person Met, One Of the Applicant's
$qualification_temp_array = array();
$score_questions['general']['person_met_is_applicant'] = 'no';
foreach($general_form['individuals'] as $person)
{
array_merge($qualification_temp_array,array($person['qualification']));
//print_r($person);
$qualification_temp_array = array_merge($qualification_temp_array,array($person['qualification']));
if($person['is_applicant'] == true && $person['is_person_met'] == true)
{
//echo $person['applicant_name'];
$score_questions['general']['person_met_is_applicant'] = 'yes';
}
else
{
$score_questions['general']['person_met_is_applicant'] = 'no';
}
}
}
$min = count($qualification_temp_array) ? min($qualification_temp_array) : 6;
//print_r($qualification_temp_array);die();
// 2 - QNO(1.8) - Qualification
$score_questions['general']['qualification'] = $min;
@ -5566,7 +5579,7 @@ class PD_Controller extends REST_Controller {
#####supplier Form Questions########
$supplier_form = (json_decode($form_data[1][0]['processed_json'],true));
$supplier_form = isset($form_data[1][0]['processed_json'])?(json_decode($form_data[1][0]['processed_json'],true)):array();
//print_r($supplier_form);
if(count($supplier_form))
{
@ -5603,7 +5616,7 @@ class PD_Controller extends REST_Controller {
#####client Form Questions########
$client_form = (json_decode($form_data[2][0]['processed_json'],true));
$client_form = isset($form_data[2][0]['processed_json'])?(json_decode($form_data[2][0]['processed_json'],true)):array();
//print_r($client_form);die();
if(count($client_form))
{
@ -5649,7 +5662,7 @@ class PD_Controller extends REST_Controller {
#####End of client Form Questions########
#####Stock Form Questions########
$stock_form = (json_decode($form_data[11][0]['processed_json'],true));
$stock_form = isset($form_data[11][0]['processed_json'])?(json_decode($form_data[11][0]['processed_json'],true)):array();
//print_r($stock_form);
if(count($stock_form))
{
@ -5659,6 +5672,8 @@ class PD_Controller extends REST_Controller {
}
else
{
$score_questions['business']['stock_raw_material_enough'] = 'Not Applicable';
$score_questions['business']['stock_finished_goods_enough'] = 'Not Applicable';
$score_questions['general']['value_of_other_assets'] = 'Not Applicable';
}
#####End of Stock Form Questions########

Binary file not shown.

View File

@ -1,6 +1,6 @@
<?php
class MYUITIL
class MYUTIL
{
@ -93,7 +93,23 @@ class MYUITIL
{
return 'Company Not Found';
}
}
}
public static function findQuestionByKey($array,$qkey)
{
foreach($array as $key => $value)
{
//echo $value['key'].'--'.$qkey;
if(!strcmp(trim($value['key']),trim($qkey)))
{
// echo "\n";
// echo 'IF'.$value['key'].'--'.$qkey;
return $value['question'];
}
}
}
}
?>

View File

@ -93,7 +93,7 @@ class PDSCORE
$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' => $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']]));
$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
@ -101,21 +101,21 @@ 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' => $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']]);
$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
$comment_locality_actual_score = ($l1_general/100) * ($comment_locality_L2/100) * $comment_locality[$score_questions['general']['comment_locality']];
$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' => $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']]);
$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
$customer_behaviour_actual_score = ($l1_general/100) * ($customer_behaviour_L2/100) * $customer_behaviour[$score_questions['general']['customer_behaviour']];
$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' => $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']]);
$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.5 neibourhood_check_as_per_pd_officer
@ -123,21 +123,21 @@ 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' => $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" ]);
$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));
//######1.6 was_the_company_name_board_sighted
$was_the_company_name_board_sighted_actual_score = ($l1_general/100) * ($was_the_company_name_board_sighted_L2/100) * $was_the_company_name_board_sighted[$score_questions['general']['was_the_company_name_board_sighted']];
$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' => $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']]);
$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
$otp_done_actual_score = ($l1_general/100) * ($otp_done_L2/100) * $otp_done[$score_questions['general']['otp_done']];
$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' => $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']]);
$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
$qualification_actual_score = ($l1_general/100) * ($qualification_L2/100) * $qualification['id_score'][$score_questions['general']['qualification']];
@ -145,32 +145,55 @@ 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' => $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']]);
$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
$asset_calculation_details = array();
$actual_value_of_assets = $score_questions['general']['value_of_other_assets'];
//$actual_value_of_assets = 600000;
$asset_calculation_details['actual_value_of_assets'] = $actual_value_of_assets;
//echo 'actual_value_of_assets -'.$actual_value_of_assets;
$loan_amount = $pd_master_details[0]['loan_amount'];
//$loan_amount = 2000000;
$asset_calculation_details['loan_amount'] = $loan_amount;
//echo 'loan_amount - '.$loan_amount;
$avg_expected_value_of_assets = $personal_asset_grid['master_grid'][0]['avg_expected_value_assets'];
$expected_value_of_assets = ($avg_expected_value_of_assets / 100 ) * $personal_asset_grid['master_grid'][0]['loan_amount_to'];
$asset_calculation_details['avg_expected_value_of_assets'] = $avg_expected_value_of_assets;
//echo "avg_expected_value_of_assets - ".$avg_expected_value_of_assets;
//$expected_value_of_assets = ($avg_expected_value_of_assets / 100 ) * $personal_asset_grid['master_grid'][0]['loan_amount_to'];
$expected_value_of_assets = ($avg_expected_value_of_assets / 100 ) * $loan_amount;
$asset_calculation_details['expected_value_of_assets'] = $expected_value_of_assets;
//echo 'expected_value_of_assets--'.$expected_value_of_assets;
$actual_value_of_assets_percentage = ($actual_value_of_assets / $loan_amount) * 100;
$asset_calculation_details['actual_value_of_assets_percentage'] =
$actual_value_of_assets_percentage;
//echo 'actual_value_of_assets_percentage--'.$actual_value_of_assets_percentage;
$variance = (($actual_value_of_assets_percentage - $avg_expected_value_of_assets)/$avg_expected_value_of_assets )* 100 ;
//echo 'varience--'.$variance;
$asset_calculation_details['variance'] = $variance;
$final_asset_score = 'No Asset';
$final_asset_attributed_score = 0;
$final_asset_score = 0;
foreach($personal_asset_grid['variance_grid'] as $grid)
{
//print_r($grid);
if($grid['variance_ ratio_from'] < $variance && $grid['variance_ration_to'] > $variance)
//print_r($grid['score']);
if($grid['variance_ ratio_from'] <= $variance && $grid['variance_ration_to'] > $variance)
{
$final_asset_score = $grid['score'];
$final_asset_score = ($l1_general/100 ) * ($value_of_other_assets_L2/100)* $final_asset_score;
$final_asset_attributed_score = ($l1_general/100 ) * ($value_of_other_assets_L2/100)* $final_asset_score;
}
}
$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' => $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);
$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_score, 'max_score' => (($l1_general/100 ) * ($value_of_other_assets_L2/100) * 10),'score_band'=> 'As Per Grid');
/*-----------END OF GENERAL SECTION -----------*/
/*-----------FINAL REMARKS SECTION -----------*/
@ -180,7 +203,7 @@ class PDSCORE
$pd_officer_recommandations_max_score = ($l1_final/100) * ($pd_officer_recommadations_L2/100) * max($pd_officer_recommandations);
$score_questions['final_remarks']['pd_officer_recommandations'] = array('l1_weightage' => $l1_final,'l2_weightage' => $pd_officer_recommadations_L2,'distributed_weightage' => 0,'answer' => $score_questions['final_remarks']['pd_officer_recommandations'],'attributed_score' => $pd_officer_recommandations_actual_score, 'max_score' => $pd_officer_recommandations_max_score,'score_band'=>$pd_officer_recommandations[ $score_questions['final_remarks']['pd_officer_recommandations'] ]);
$score_questions['final_remarks']['pd_officer_recommandations'] = array('l1_weightage' => $l1_final,'l2_weightage' => $pd_officer_recommadations_L2,'distributed_weightage' => 0,'answer' => $score_questions['final_remarks']['pd_officer_recommandations'],'attributed_score' => $pd_officer_recommandations_actual_score, 'max_score' => $pd_officer_recommandations_max_score,'score_band'=>$pd_officer_recommandations[ $score_questions['final_remarks']['pd_officer_recommandations'] ],'max_score_band' => max($pd_officer_recommandations));
/*-----------END OF FINAL REMARKS SECTION -----------*/
@ -219,7 +242,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' => $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'] ]);
$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));
//######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 ))) : $minimum_client_info_L2 ;
@ -228,7 +251,7 @@ 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' => $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'] ]);
$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));
//######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 ))) : $stock_raw_material_enough_L2 ;
@ -237,7 +260,7 @@ class PDSCORE
$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' => $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 [ $score_questions['business']['stock_raw_material_enough'] ]);
$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 [ $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 ))) : $stock_finished_goods_enough_L2 ;
@ -246,11 +269,12 @@ class PDSCORE
$stock_finished_goods_enough_max_score = strcasecmp($score_questions['business']['stock_finished_goods_enough'],'Not Applicable') ? ($l1_business/100) * ($stock_finished_goods_enough_L2/100) * max($stock_answer_scores) : 0;
$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 [ $score_questions['business']['stock_finished_goods_enough'] != "" || $score_questions['business']['stock_finished_goods_enough'] != null ? $score_questions['business']['stock_finished_goods_enough'] : "no" ]);
$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 [ $score_questions['business']['stock_finished_goods_enough'] != "" || $score_questions['business']['stock_finished_goods_enough'] != null ? $score_questions['business']['stock_finished_goods_enough'] : "no" ],'max_score_band' => max($stock_answer_scores));
//######2.1 Business Certificates
$cerificates_L2 = 10;
$cerificates_L2 = $business_distribute_level_weightage ? ($cerificates_L2 + ($cerificates_L2 / (100 - $business_distribute_level_weightage ))) : $cerificates_L2;
//find out no of not applicable cases
@ -279,18 +303,19 @@ class PDSCORE
$max_score = ($l1_business/100) * ($business_certificates_distribution/100) * max($cerificates);
}
$score_questions['business']['cerificates'][$certificate_key] = array('answer' => $certificate,'attributed_score' => $acutal_score, 'max_score' => $max_score);
$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));
$certificate_actual_score += $acutal_score;
$certificate_max_score += $max_score;
}
$score_questions['business']['cerificates']['l1_weightage'] = $l1_business;
$score_questions['business']['cerificates']['l2_weightage'] = $business_certificates_distribution;
$score_questions['business']['cerificates']['l2_weightage'] = round($business_certificates_distribution,2);
$score_questions['business']['cerificates']['distributed_weightage'] = $business_distribute_level_weightage;
$score_questions['business']['cerificates']['max_score'] = $certificate_max_score;
$score_questions['business']['cerificates']['attributed_score'] = $certificate_actual_score;
$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']['score_band'] = 'Derived';
$score_questions['business']['cerificates']['max_score_band'] = 'Derived';
//echo $business_certificates_distribution;die();
//######2.1 no_of_years_business_run
@ -321,7 +346,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' => $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);
$score_questions['business']['no_of_years_business_run'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($no_of_years_business_run_L2),'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));
//######2.2 business seasonal
@ -332,7 +357,7 @@ class PDSCORE
$business_seasonality_actual_score = ($l1_business/100) * ($business_seasonality_L2/100) * $business_seasonality[ $score_questions['business']['business_seasonality'] ];
$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' => $business_seasonality_L2,'answer' => $score_questions['business']['business_seasonality'],'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' => $business_seasonality[ $score_questions['business']['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($no_of_years_business_run_actual_score), 'max_score' => round($no_of_years_business_run_max_score,2),'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;
@ -360,7 +385,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' => $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);
$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));
//######2.5 owned_property
@ -370,7 +395,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' => $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'] ]);
$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));
//######2.6 owned_vechile
$owned_vechile_L2 = $business_distribute_level_weightage ? ($owned_vechile_L2 + ($owned_vechile_L2 / (100 - $business_distribute_level_weightage ))) : $owned_vechile_L2 ;
@ -378,7 +403,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' => $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'] ]);
$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));
//######2.11 location_suited_for_busienss
@ -387,7 +412,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' => $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'] ]);
$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));
//######2.11 business_activity_has_seen
@ -396,7 +421,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' => $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'] ]);
$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));
//######2.13 vintage business banking
@ -425,7 +450,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' => $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);
$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' => 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));
/*-----------END OF BUSINESS SECTION -----------*/
@ -451,7 +476,9 @@ class PDSCORE
}
$score_questions['score_summary']['overall_score'] = array('overall_actual_score' => $overall_actual_score, 'overall_max_score' => $overall_max_score,'final_score' => ($overall_actual_score/$overall_max_score) * 100);
//print_r($score_questions);
$score_questions['score_summary']['asset_calculation_details'] = $asset_calculation_details;
//print_r($score_questions);die();
return ($score_questions);

View File

@ -1398,5 +1398,16 @@ class PD_Model extends SPARQ_Model {
return $return_data;
}
public function getScoreableQuestionToDispaly($pdid)
{
$this->db->SELECT('question,key');
$this->db->FROM(QUESTIONKEYMAPPING);
$this->db->WHERE('fk_form_id is null');
$data = $this->db->GET()->result_array();
return $data;
//$this->PD_Model->selectCustomRecords(array('question,key'),array('fk_form_id' =>'is null'),QUESTIONKEYMAPPING);
}
}

View File

@ -1 +1 @@
var page = require('webpage').create();page.viewportSize = { width: 600, height: 350 };page.clipRect = { top: 0, left: 0, width: 600, height: 350 };var score = 69;var url = 'http://localhost:9999/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/chart.png' ;page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});
var page = require('webpage').create();page.viewportSize = { width: 600, height: 350 };page.clipRect = { top: 0, left: 0, width: 600, height: 350 };var score = 72.11;var url = 'http://localhost:9999/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/chart.png' ;page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});

View File

@ -65,28 +65,31 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
/* #########Score Card Table Styles######### */
#customers {
#scorecard_table {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#customers td, #customers th {
#scorecard_table td, #scorecard_table th {
border: 1px solid #ddd;
padding: 8px;
}
#customers tr:nth-child(even){background-color: #f2f2f2;}
#scorecard_table tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
#scorecard_table tr:hover {background-color: #ddd;}
#customers th {
#scorecard_table th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4CAF50;
color: white;
}
.customth { width: 10%; }
/* #########Score Card Table Styles######### */
</style>
@ -138,8 +141,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php
echo "<p>Loan Amount Applied For : </p>";
echo "<table style='border-collapse:collapse;text-align:right;padding:30px;'>
<tr> <td>As Per PD Initiation </td> <td> </td><td> </td><td> </td><td>Rs " . number_format($pd_master_details[0]['loan_amount'],2,',',','). ".</td> </tr>
<tr> <td>As Per Loan Applicants during PD</td> <td> </td><td> </td><td> </td> <td>Rs " . number_format($loan_form['loan_amount'],2,',',','). ".</td> </tr>
<tr> <td>As Per PD Initiation </td> <td> </td><td> </td><td> </td><td>Rs " . number_format($pd_master_details[0]['loan_amount'],2,'.',','). ".</td> </tr>
<tr> <td>As Per Loan Applicants during PD</td> <td> </td><td> </td><td> </td> <td>Rs " . number_format($loan_form['loan_amount'],2,'.',','). ".</td> </tr>
</table>
";
echo "<div class='page_break'></div>";
@ -152,10 +155,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
//print_r($pd_score);
?>
<table>
<tr> <td>General Section Score</td> <td> </td> <td><?php echo number_format($pd_score['score_summary']['general']['actual_score'],2,'.','.')?></td></tr>
<tr> <td>Business Section Score</td> <td> </td> <td><?php echo number_format($pd_score['score_summary']['business']['actual_score'],2,'.','.')?></td></tr>
<tr> <td>Final Remarks Score</td> <td> </td> <td><?php echo number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.','.')?></td></tr>
<tr> <td>Final PD Score</td> <td> </td> <td><?php echo number_format($pd_score['score_summary']['overall_score']['final_score'],2,'.','.')?></td> <td style="font-size:9px;">(Over all Acutal score (<?php echo number_format($pd_score['score_summary']['overall_score']['overall_actual_score'],2,'.','.');?>) / over all Maximum Score (<?php echo number_format($pd_score['score_summary']['overall_score']['overall_max_score'],2,'.','.');?> )) * 100)</td></tr>
<tr> <td>General Section Score</td> <td> </td> <td><?php echo number_format($pd_score['score_summary']['general']['actual_score'],2,'.',',')?></td></tr>
<tr> <td>Business Section Score</td> <td> </td> <td><?php echo number_format($pd_score['score_summary']['business']['actual_score'],2,'.',',')?></td></tr>
<tr> <td>Final Remarks Score</td> <td> </td> <td><?php echo number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.',',')?></td></tr>
<tr> <td>Final PD Score</td> <td> </td> <td><?php echo number_format($pd_score['score_summary']['overall_score']['final_score'],2,'.',',')?></td> <td style="font-size:9px;">(Over all Acutal score (<?php echo number_format($pd_score['score_summary']['overall_score']['overall_actual_score'],2,'.',',');?>) / over all Maximum Score (<?php echo number_format($pd_score['score_summary']['overall_score']['overall_max_score'],2,'.',',');?> )) * 100)</td></tr>
</table>
<?php
if($base64_pdscore_chart_url != "" || $base64_pdscore_chart_url != null)
@ -177,61 +180,103 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php
//print_r($pd_score['business']);
echo '<table id="customers">';
echo "<tr> <th>General Question (". $pd_score['general']['otp_done']['l1_weightage']."%) </th> <th>Answer</th> <th>Score Band</th> <th>Attributed Score</th> <th>Max Score</th></tr>";
echo '<table id="scorecard_table">';
echo "<tr> <th>General Questions L1(". $pd_score['general']['otp_done']['l1_weightage']."%) </th> <th>L2</th> <th>Answer</th> <th>Score</th> <th>Attributed Score</th> <th>Max Score</th></tr>";
foreach($pd_score['general'] as $key => $general)
{
$question = MYUTIL::findQuestionByKey($score_questions_display,$key);
$span = '<span style="font-size:9px">('.$general['l1_weightage'].'% * '. $general['l2_weightage'].'% * '.$general['score_band'].')</span>';
echo '<tr>'.'<td>'.$key.' ('.$general['l2_weightage'].'%)</td><td>'.$general['answer'].
'</td><td>'.$general['score_band'].'</td><td>'.$general['attributed_score'].'<br>'.$span.'</td><td>'.$general['max_score'].'</td></tr>';
$max_span = '<span style="font-size:9px">('.$general['l1_weightage'].'% * '. $general['l2_weightage'].'% * '.$general['max_score_band'].')</span>';
echo '<tr>'.'<td>'.$question.'</td><td>'.$general['l2_weightage'] .'%</td><td>'.$general['answer'].
'</td><td>'.$general['score_band'].'</td><td>'.$general['attributed_score'].'<br>'.$span.'</td><td>'.$general['max_score'].'<br>'.$max_span.'</td></tr>';
}
echo "<tr> <td colspan='4'>General Section Sum of Attributed Score | Sum of Max Score </td> <td>".number_format($pd_score['score_summary']['general']['actual_score'],2,'.',',')."</td> <td>".number_format($pd_score['score_summary']['general']['max_score'],2,'.',',')."</td> </tr>";
echo '</table>';
echo '<br><br>';
echo '<table id="customers">';
echo "<tr> <th>Final Remarks Question (". $pd_score['final_remarks']['pd_officer_recommandations']['l1_weightage']."%)</th> <th>Answer</th> <th>Score Band</th><th>Attributed Score</th> <th>Max Score</th></tr>";
echo '<table id="scorecard_table">';
echo "<tr> <th colspan='2'>Asset Value Calculaitons</th></tr>";
echo "<tr> <td>Actual Value Of Assets(a)</td><td>". number_format($pd_score['score_summary']['asset_calculation_details']['actual_value_of_assets'],2,'.',',')."</td></tr>";
echo "<tr> <td>Loan Amount(b)</td><td>". number_format($pd_score['score_summary']['asset_calculation_details']['loan_amount'],2,'.',',')."</td></tr>";
echo "<tr> <td>Avg Expected Value Of Assets(c)</td><td>". round($pd_score['score_summary']['asset_calculation_details']['avg_expected_value_of_assets'],2)."%</td></tr>";
echo "<tr> <td>Expected Value Of Assets(d = c*b)</td><td>". number_format($pd_score['score_summary']['asset_calculation_details']['expected_value_of_assets'],2,'.',',')."</td></tr>";
echo "<tr> <td>Actual Value Of Assets Percentage(e = (a/b) * 100)</td><td>". round($pd_score['score_summary']['asset_calculation_details']['actual_value_of_assets_percentage'],2)."%</td></tr>";
echo "<tr> <td>Variance(f = ((e-c)/c) * 100)</td><td>". round($pd_score['score_summary']['asset_calculation_details']['variance'],2)."</td></tr>";
echo "<tr> <td>Score As per Grid</td><td>". round($pd_score['score_summary']['asset_calculation_details']['score'],2)."</td></tr>";
echo '</table>';
echo '<br><br><br>';
echo '<table id="scorecard_table">';
echo "<tr> <th>Final Remarks Questions L1(". $pd_score['final_remarks']['pd_officer_recommandations']['l1_weightage']."%)</th> <th>L2</th><th>Answer</th> <th>Score</th><th>Attributed Score</th> <th>Max Score</th></tr>";
foreach($pd_score['final_remarks'] as $key => $final_remark)
{
$question = MYUTIL::findQuestionByKey($score_questions_display,$key);
$span = '<span style="font-size:9px">('.$final_remark['l1_weightage'].'% * '. $final_remark['l2_weightage'].'% * '.$final_remark['score_band'].')</span>';
echo '<tr>'.'<td>'.$key.' ('.$final_remark['l2_weightage'].'%)</td><td>'.$final_remark['answer'].'</td><td>'.$final_remark['score_band'].'</td><td>'.$final_remark['attributed_score'].'<br>'.$span.'</td><td>'.$final_remark['max_score'].'</td></tr>';
$max_span = '<span style="font-size:9px">('.$final_remark['l1_weightage'].'% * '. $final_remark['l2_weightage'].'% * '.$final_remark['max_score_band'].')</span>';
echo '<tr>'.'<td>'.$question.'</td><td>'.$final_remark['l2_weightage'].'%</td><td>'.$final_remark['answer'].'</td><td>'.$final_remark['score_band'].'</td><td>'.$final_remark['attributed_score'].'<br>'.$span.'</td><td>'.$final_remark['max_score'].'<br>'.$max_span.'</td></tr>';
}
echo "<tr> <td colspan='4'>Final Remarks Section Sum of Attributed Score | Sum of Max Score </td> <td>".number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.',',')."</td> <td>".number_format($pd_score['score_summary']['final_remarks']['max_score'],2,'.',',')."</td> </tr>";
echo '</table>';
echo '<br><br><br>';
echo '<br><br>';
echo '<table id="customers">';
echo "<tr> <th>Business Question(". $pd_score['business']['no_of_years_business_run']['l1_weightage']."%)</th> <th>Answer</th> <th>Score Band</th> <th>Attributed Score</th><th>Max Score</th></tr>";
echo '<table id="scorecard_table">';
echo "<tr> <th>Business Questions L1(". $pd_score['business']['no_of_years_business_run']['l1_weightage']."%)</th> <th>L2</th><th>Answer</th> <th>Score</th> <th>Attributed Score</th><th>Max Score</th></tr>";
$certificates = array();
foreach($pd_score['business'] as $key => $business)
{
$span = '<span style="font-size:9px">('.$business['l1_weightage'].'% * '. $business['l2_weightage'].'% * '.$business['score_band'].')</span>';
$question = MYUTIL::findQuestionByKey($score_questions_display,$key);
$span = '<span style="font-size:9px">('.$business['l1_weightage'].'% * '. $business['l2_weightage'].'% * '.$business['score_band'].')</span>';
$max_span = '<span style="font-size:9px">('.$business['l1_weightage'].'% * '. $business['l2_weightage'].'% * '.$business['max_score_band'].')</span>';
if($key != 'cerificates')
{
echo '<tr>'.'<td>'.$key.' ('.$business['l2_weightage'].'%)</td><td>'.$business['answer'].'</td><td>'.$business['score_band'].'</td><td>'.$business['attributed_score'].'<br>'.$span.'</td><td>'.$business['max_score'].'</td></tr>';
echo '<tr>'.'<td>'.$question.'</td><td>'.$business['l2_weightage'].'%</td><td>'.$business['answer'].'</td><td>'.$business['score_band'].'</td><td>'.$business['attributed_score'].'<br>'.$span.'</td><td>'.$business['max_score'].'<br>'.$max_span.'</td></tr>';
}
if($key == 'cerificates')
{
$certificates = $business;
echo '<tr>'.'<td>'.$key.' ('.$business['l2_weightage'].'%)</td><td>'.'Certificates'.'</td><td>'.$business['score_band'].'</td><td>'.$business['attributed_score'].'</td><td>'.$general['max_score'].'</td></tr>';
echo '<tr>'.'<td> Certificates </td><td>'.round($business['l2_weightage'],2).'%</td><td>'.'Refer Cert Table'.'</td><td>'.$business['score_band'].'</td><td>'.$business['attributed_score'].'</td><td>'.$general['max_score'].'</td></tr>';
}
}
echo "<tr> <td colspan='4'>Business Section Sum of Attributed Score | Sum of Max Score </td> <td>".number_format($pd_score['score_summary']['business']['actual_score'],2,'.',',')."</td> <td>".number_format($pd_score['score_summary']['business']['max_score'],2,'.',',')."</td> </tr>";
echo '</table>';
echo '</table>';
echo '<br><br>';
echo '<table id="customers">';
echo "<tr> <th>Business Certificates</th> <th>Answer</th> <th>Score</th> <th>Max Score</th></tr>";
echo '<table id="scorecard_table">';
echo "<tr> <th>Business Certificates</th> <th>Answer</th> <th>Score</th> <th>Attributed Score</th> <th>Max Score</th></tr>";
$index = 0;
foreach($certificates as $key => $cerificate)
{
$index++;
if($index <=7)
{
echo '<tr>'.'<td>'.$key.'</td><td>'.$cerificate['answer'].'</td><td>'.round($cerificate['attributed_score'],3).'</td><td>'.round($cerificate['max_score'],3).'</td></tr>';
$span = '<span style="font-size:9px">('.$cerificate['l1_weightage'].'% * '. $cerificate['l2_weightage'].'% * '.$cerificate['score_band'].')</span>';
$max_span = '<span style="font-size:9px">('.$cerificate['l1_weightage'].'% * '. $cerificate['l2_weightage'].'% * '.$cerificate['max_score_band'].')</span>';
echo '<tr>'.'<td>'.$key.'</td><td>'.$cerificate['answer'].'</td><td>'.$cerificate['score_band'].'</td><td>'.round($cerificate['attributed_score'],3).'<br>'.$span.'</td><td>'.round($cerificate['max_score'],3).'<br>'.$max_span.'</td></tr>';
}
}
echo "<table>";
@ -246,7 +291,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
{
$all_company_details = $general_form['companies'];
}
// echo MYUITIL::findCompanyName($all_company_details,2);
// echo MYUTIL::findCompanyName($all_company_details,2);
//print_r($all_company_details);
//print_r($pd_score['overall_score']['final_score']);
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB