diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 13431bd9..612e09ae 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1480,35 +1480,35 @@ public function filterSalesPDList_post() { //print_r(count($view_data['smc_images']));die(); //score card part - $score_card_questions = $this->seperateScorecardQuestions($view_data); - $view_data['pd_score'] = SMCPDSCORE::genericDIPDScoreCalculate($score_card_questions,$view_data['pd_master_details']); - $final_score = round($view_data['pd_score']['score_summary']['overall_score']['final_score'],1); - // echo $final_score;die(); - //GET phantom script from DB - $phantom_script = $this->PD_Model->selectCustomRecords(array('*'),array('script_name' => PHANTOMJSSCRIPT_LOCATION),SCRIPTS); + // $score_card_questions = $this->seperateScorecardQuestions($view_data); + // $view_data['pd_score'] = SMCPDSCORE::genericDIPDScoreCalculate($score_card_questions,$view_data['pd_master_details']); + // $final_score = round($view_data['pd_score']['score_summary']['overall_score']['final_score'],1); + // // echo $final_score;die(); + // //GET phantom script from DB + // $phantom_script = $this->PD_Model->selectCustomRecords(array('*'),array('script_name' => PHANTOMJSSCRIPT_LOCATION),SCRIPTS); - $exact_script = $phantom_script[0]['script_content']; - // print_r($exact_script);die(); - $apppath = str_replace('\\','/',$this->external_path.'/pd_reports/'.$records['pd_id']); - $exact_script = str_replace('{{APPPATH}}',$apppath,$exact_script); - $exact_script = str_replace('{{place_score_here}}',$final_score,$exact_script); - //print_r($exact_script);die(); + // $exact_script = $phantom_script[0]['script_content']; + // // print_r($exact_script);die(); + // $apppath = str_replace('\\','/',$this->external_path.'/pd_reports/'.$records['pd_id']); + // $exact_script = str_replace('{{APPPATH}}',$apppath,$exact_script); + // $exact_script = str_replace('{{place_score_here}}',$final_score,$exact_script); + // //print_r($exact_script);die(); - //GENERATE CHART PART - file_put_contents(APPPATH.'/views/js/phantomchart.js',$exact_script,LOCK_EX); + // //GENERATE CHART PART + // file_put_contents(APPPATH.'/views/js/phantomchart.js',$exact_script,LOCK_EX); - $str = 'phantomjs '.APPPATH.'/views/js/phantomchart.js'; - exec($str,$ou); - exec('phantom.exit();'); + // $str = 'phantomjs '.APPPATH.'/views/js/phantomchart.js'; + // exec($str,$ou); + // exec('phantom.exit();'); - //print_r($ou); + // //print_r($ou); - $chart_img_path = $this->external_path.'/pd_reports/'.$records['pd_id'].'/chart.png'; - $type = pathinfo($chart_img_path, PATHINFO_EXTENSION); - $chart_img_content = file_get_contents($chart_img_path); - $base64_pdscore_chart_url = 'data:image/' . $type . ';base64,' . base64_encode($chart_img_content); - $view_data['base64_pdscore_chart_url'] = $base64_pdscore_chart_url; + // $chart_img_path = $this->external_path.'/pd_reports/'.$records['pd_id'].'/chart.png'; + // $type = pathinfo($chart_img_path, PATHINFO_EXTENSION); + // $chart_img_content = file_get_contents($chart_img_path); + // $base64_pdscore_chart_url = 'data:image/' . $type . ';base64,' . base64_encode($chart_img_content); + // $view_data['base64_pdscore_chart_url'] = $base64_pdscore_chart_url; // echo $base64_pdscore_chart_url; // die(); //score card part @@ -1519,7 +1519,7 @@ public function filterSalesPDList_post() { //End of PDF Gen using DOM PDF $output_file = $this->external_path ."/pd_reports/" . $records['pd_id'] . "/temp.pdf"; $bytes = file_put_contents($output_file, $pdf_doc); - // echo $bytes;die(); + //echo $bytes;die(); $bucket_name = LENDER_BUCKET_NAME_PREFIX.(ENVIRONMENT == 'production' ? 7 : 35); $key = 'pd'.$records['pd_id'].'/pd_reports/'.$pdf_name.'.pdf'; $bucket_data = array('bucket_name'=>$bucket_name,'key'=>$key,'sourcefile'=>$output_file); diff --git a/api/application/helpers/readexceldata_helper.php b/api/application/helpers/readexceldata_helper.php index bcbfbab5..f9ea7ad9 100644 --- a/api/application/helpers/readexceldata_helper.php +++ b/api/application/helpers/readexceldata_helper.php @@ -276,7 +276,8 @@ class readexceldata $return_data = array(); foreach ($arr as $key => $value) { - if($value) + if(is_string($value) || is_numeric($value)) + // if($value) { $return_data[$key] = $value; } diff --git a/api/application/helpers/smc_creditpd_helper.php b/api/application/helpers/smc_creditpd_helper.php index 61c2ae08..45813168 100644 --- a/api/application/helpers/smc_creditpd_helper.php +++ b/api/application/helpers/smc_creditpd_helper.php @@ -70,24 +70,35 @@ class smc_creditpd $json = json_decode($section['json'],true); $person_met = ''; + $mobile_numbers_array = array(); foreach ($json['borrower_details'] as $key => $value) { $mobile_numbers = ''; + if(isset($value['mobile_numbers']) && count($value['mobile_numbers'])) { foreach ($value['mobile_numbers'] as $k => $smn) { if((count($value['mobile_numbers']) - 1) == $k){$mobile_numbers .= ($smn['mobile_no']); break;} - $mobile_numbers .= ($smn['mobile_no'].','); + $mobile_numbers .= ($smn['mobile_no'].',
'); } $json['borrower_details'][ $key ] ['mobile_numbers'] = $mobile_numbers; + if($mobile_numbers) + { + $mobile_numbers_array[('##'.$k.'##')] = '( ' . str_replace('
', '', $mobile_numbers) . ' ) '; + } } if(isset($value['borrower_met']) && !strcasecmp($value['borrower_met'],'yes')) { - $temp_person_met = $value['borrower_name']; - $temp_person_met .= ($mobile_numbers != '' ? '(' .$mobile_numbers. ') ,': ','); + $temp_person_met = $value['borrower_name'].', '; + if(isset($value['mobile_numbers']) && count($value['mobile_numbers'])) + { + $temp_person_met = $value['borrower_name'].'##'.$k.'## , '; + } + + //$temp_person_met .= ($mobile_numbers != '' ? '(' .$mobile_numbers. ') ,': ','); $person_met .= $temp_person_met; } $mobile_numbers = ''; @@ -107,6 +118,12 @@ class smc_creditpd } } + // print_r($person_met); + // print_r($mobile_numbers_array); + foreach ($mobile_numbers_array as $key => $value) + { + $person_met = str_replace($key, $value, $person_met); + } $json['person_met'] = $person_met; return $json; diff --git a/api/application/views/smc_creditpd_reports/MWISE.php b/api/application/views/smc_creditpd_reports/MWISE.php index 8615da73..b057c639 100644 --- a/api/application/views/smc_creditpd_reports/MWISE.php +++ b/api/application/views/smc_creditpd_reports/MWISE.php @@ -298,11 +298,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); '; - echo '

PD Score Summary

'; + // echo '
'; + // echo '

PD Score Summary

'; ?> - +
"; + // if(isset($base64_pdscore_chart_url)) + // { + // echo "

"; - echo '

'; - echo '
'; + // echo '

'; + // echo '
'; - $business_captions = array("no_of_years_business_run" => "Business Vintage >>", "location_suited_for_busienss" => "Business Location suitability >>", "business_seasonality" => "Seasonality >>", "employees_total" => "Employee Strength >>", "cerificates" => "Business Certifications Sighted >>","owned_property" => "Business Premise Ownership >>", "owned_vechile" => "Vehicle Ownership >>", "business_activity_has_seen" => "Business Activity Observed >>", "minimum_supplier_info" => "Supplier Information Provided >>", "minimum_client_info" => "Client Information Provided >>","stock_visited" => "RM/FG Stock Sufficiency >>", "stock_finished_goods_enough" => "Finished/Traded Stock Sufficiency >>", "vintage_of_business_account" => "Main Business Banking Account Vintage >>"); + //$business_captions = array("no_of_years_business_run" => "Business Vintage >>", "location_suited_for_busienss" => "Business Location suitability >>", "business_seasonality" => "Seasonality >>", "employees_total" => "Employee Strength >>", "cerificates" => "Business Certifications Sighted >>","owned_property" => "Business Premise Ownership >>", "owned_vechile" => "Vehicle Ownership >>", "business_activity_has_seen" => "Business Activity Observed >>", "minimum_supplier_info" => "Supplier Information Provided >>", "minimum_client_info" => "Client Information Provided >>","stock_visited" => "RM/FG Stock Sufficiency >>", "stock_finished_goods_enough" => "Finished/Traded Stock Sufficiency >>", "vintage_of_business_account" => "Main Business Banking Account Vintage >>"); - $general_captions = array("otp_done" => "OTP authentication done >>","person_met_is_applicant" => "Is person Met, a loan applicant >>","qualification" => "Qualification of Loan Applicants >>","comment_locality" => "Comment on Locality >>","approcah_to_pd_location" => "Approach to PD location >>","customer_behaviour" => "Customer Behaviour >>","neighbourhood_status" => "Neighbourhood check >>","name_board_seen" => "Business Board Sighted >>","value_of_other_assets" => "Asset Value by Loan Amount % >>"); + //$general_captions = array("otp_done" => "OTP authentication done >>","person_met_is_applicant" => "Is person Met, a loan applicant >>","qualification" => "Qualification of Loan Applicants >>","comment_locality" => "Comment on Locality >>","approcah_to_pd_location" => "Approach to PD location >>","customer_behaviour" => "Customer Behaviour >>","neighbourhood_status" => "Neighbourhood check >>","name_board_seen" => "Business Board Sighted >>","value_of_other_assets" => "Asset Value by Loan Amount % >>"); // echo '
'; - echo '
'; - echo ''; + // echo '
Business Related Parameters Impacting Score Response
'; + // echo ''; - echo ''; - foreach($pd_score['business'] as $bsk => $business_score) - { + // echo ''; + // foreach($pd_score['business'] as $bsk => $business_score) + // { - $class = null; - $answer = null; - $per = $business_score['attributed_score'] > 0 && $business_score['max_score'] > 0 ? ( ($business_score['attributed_score'] / $business_score['max_score']) * 100) : 0; + // $class = null; + // $answer = null; + // $per = $business_score['attributed_score'] > 0 && $business_score['max_score'] > 0 ? ( ($business_score['attributed_score'] / $business_score['max_score']) * 100) : 0; - $class = ( $per >= 80 ? 'rcorners_green' : ($per >= 65 && $per < 80 ? 'rcorners_light_green' : ($per >= 50 && $per < 65 ? 'rcorners_amber' : 'rcorners_red'))); + // $class = ( $per >= 80 ? 'rcorners_green' : ($per >= 65 && $per < 80 ? 'rcorners_light_green' : ($per >= 50 && $per < 65 ? 'rcorners_amber' : 'rcorners_red'))); - if($bsk == 'location_suited_for_busienss') - { - //$answer = $address_type_remarks_caption[ $business_score['answer'] ]; - $answer = $business_score['answer']; - } - else if($bsk == 'no_of_years_business_run') - { - $answer = isset($business_score['answer']) ? $business_score['answer'].' Yrs' : ''; - } - else if($bsk == 'business_seasonality') - { - $answer = isset($business_score['answer']) ? ((!strcasecmp($business_score['answer'], 'yes')) ? 'Seasonal': 'Not Seasonal') : ''; - } - else - { - $answer = isset($business_score['answer']) ? $business_score['answer'] : ''; - } + // if($bsk == 'location_suited_for_busienss') + // { + // //$answer = $address_type_remarks_caption[ $business_score['answer'] ]; + // $answer = $business_score['answer']; + // } + // else if($bsk == 'no_of_years_business_run') + // { + // $answer = isset($business_score['answer']) ? $business_score['answer'].' Yrs' : ''; + // } + // else if($bsk == 'business_seasonality') + // { + // $answer = isset($business_score['answer']) ? ((!strcasecmp($business_score['answer'], 'yes')) ? 'Seasonal': 'Not Seasonal') : ''; + // } + // else + // { + // $answer = isset($business_score['answer']) ? $business_score['answer'] : ''; + // } - if(strcasecmp($answer,'Not Applicable')) - { - echo ''; - } - } - echo ''; - echo '
Business Related Parameters Impacting Score Response
'. $business_captions[$bsk] .' '. '
'. ucfirst($answer).'
'; - echo '


'; + // if(strcasecmp($answer,'Not Applicable')) + // { + // echo ' '. $business_captions[$bsk] .' '. '
'. ucfirst($answer).' '; + // } + // } + // echo ''; + // echo ''; + // echo '


'; - echo ''; - echo ''; + // echo '
Other Parameters Impacting ScoreResponse
'; + // echo ''; - echo ''; - foreach($pd_score['general'] as $gsk => $general_score) - { - $class = null; - $per = $general_score['attributed_score'] > 0 && $general_score['max_score'] > 0 ? ( ($general_score['attributed_score'] / $general_score['max_score']) * 100) : 0; + // echo ''; + // foreach($pd_score['general'] as $gsk => $general_score) + // { + // $class = null; + // $per = $general_score['attributed_score'] > 0 && $general_score['max_score'] > 0 ? ( ($general_score['attributed_score'] / $general_score['max_score']) * 100) : 0; - $class = ( $per >= 80 ? 'rcorners_green' : ($per >= 65 && $per < 80 ? 'rcorners_light_green' : ($per >= 50 && $per < 65 ? 'rcorners_amber' : 'rcorners_red'))); + // $class = ( $per >= 80 ? 'rcorners_green' : ($per >= 65 && $per < 80 ? 'rcorners_light_green' : ($per >= 50 && $per < 65 ? 'rcorners_amber' : 'rcorners_red'))); - $answer = ucfirst($general_score['answer']); - if(strcasecmp($answer,'Not Applicable')) - { - echo ''; - } - } - echo ''; - echo '
Other Parameters Impacting ScoreResponse
'. $general_captions[$gsk] .' '. '
'. $answer.'
'; + // $answer = ucfirst($general_score['answer']); + // if(strcasecmp($answer,'Not Applicable')) + // { + // echo ' '. $general_captions[$gsk] .' '. '
'. $answer.' '; + // } + // } + // echo ''; + // echo ''; // echo '
'; - }?> + //}?> +