PHOTO SCORE SEPERATE

This commit is contained in:
Velz2020 2019-07-19 17:34:23 +05:30
parent b7c47d618d
commit 683571a56e
6 changed files with 605 additions and 214 deletions

View File

@ -206,6 +206,7 @@ $route['saveHTMLReport'] = 'PD_Controller/saveHTMLReport';
$route['(getPDReportHTML/:any/:any)'] = 'PD_Controller/getPDReportHTML';
$route['convertBase64'] = 'PD_Controller/convertImgUrlToBase64';
$route['updateNotificationToken'] = 'PD_Controller/updateNotificationToken';
$route['getPDScore'] = 'PD_Controller/getPDScoreForDisplay';
// $route['savePDFormDetailsJSON'] = 'PD_Controller/savePDFormDetailsJSON';
// $route['getPDFormDetailsJSON'] = 'PD_Controller/getPDFormDetailsJSON';

View File

@ -4193,9 +4193,9 @@ class PD_Controller extends REST_Controller {
$temp_path = $main_applicant_name.'_'.$pdid.'_'.'pd_images.zip';
$this->zip->archive(APPPATH.'docs/'.$temp_path);
$this->zip->archive(APPPATH.'docs/zip/'.$temp_path);
$bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>(APPPATH.'docs/'.$temp_path));
$bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>(APPPATH.'docs/zip/'.$temp_path));
$s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data);
//print_r($s3result);
@ -4205,6 +4205,7 @@ class PD_Controller extends REST_Controller {
$where_condition_array = array("pd_id" => $pdid);
$temp_array['is_zip_created'] = 1;
$id = $this->PD_Model->updateRecords($temp_array,PDTRIGGER,$where_condition_array);
- unlink(APPPATH.'docs/zip/'.$temp_path);
}
@ -6218,6 +6219,8 @@ class PD_Controller extends REST_Controller {
public function calculateScore($pdid)
{
//echo $pdid;die();
//GET JSON FORM DATA
$pd_master_details = $this->PD_Model->getPDMasterDetails($pdid);
//print_r($pd_master_details);
@ -7713,4 +7716,20 @@ class PD_Controller extends REST_Controller {
}
}
public function getPDScoreForDisplay_post()
{
$pdid = $this->post('pd_id');
$score = $this->calculateScore($pdid);
//print_r($score);die();
$score_questions_display = $this->PD_Model->getScoreableQuestionToDispaly($pdid);
$t = $this->load->view('report_templates/scorecard',array('pd_score' => $score,'score_questions_display' => $score_questions_display),true);
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;
$data['records'] = $t;
$this->response($data,REST_Controller::HTTP_OK);
}
}

Binary file not shown.

View File

@ -1,199 +0,0 @@
<?php
class INLINEPHOTOTRANSFORM
{
public static function retransformGeneralFormInlinePhotos($records)
{
if(isset($records['individuals']) && count($records['individuals']))
{
$CI =& get_instance();
$pd_details =$CI->PD_Model->getPDMasterDetails($records['pdid']);
foreach ($records['individuals'] as $key => $value) {
if(isset($value['is_person_met_pic']) && $value['is_person_met_pic'] != "")
{
$base64 = self::addTimestampAndReturnBase64($CI,$value['is_person_met_pic'],$value['applicant_name'],$pd_details,18);
$records['individuals'][$key]['is_person_met_pic'] = $base64;
}
if(isset($value['is_person_met_id_proof']) && $value['is_person_met_id_proof'] != "")
{
$base64 = self::addTimestampAndReturnBase64($CI,$value['is_person_met_id_proof'],($value['applicant_name'].'-id_proof'),$pd_details,18);
$records['individuals'][$key]['is_person_met_id_proof'] = $base64;
}
return $records;
}
}
}
public static function retransformBusinessFormInlinePhotos($records)
{
$CI =&get_instance();
$pd_details =$CI->PD_Model->getPDMasterDetails($records['pdid']);
$busienss_info_location = (isset($records['business_info_location']) ? $records['business_info_location'] : null);
if(isset($records['shop_eat_act_cert']) && $records['shop_eat_act_cert'] == 'yes' && isset($records['shop_eat_act_cert_pic']) && $records['shop_eat_act_cert_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['shop_eat_act_cert_pic'],'shop_eat_act_cert_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['shop_eat_act_cert_pic'] = $base64;
}
if(isset($records['gst_Regn_cert']) && $records['gst_Regn_cert'] == 'yes' && isset($records['gst_Regn_cert_pic']) && $records['gst_Regn_cert_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['gst_Regn_cert_pic'],'gst_Regn_cert_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['gst_Regn_cert_pic'] = $base64;
}
if(isset($records['pf_regn']) && $records['pf_regn'] == 'yes' && isset($records['pf_regn_pic']) && $records['pf_regn_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['pf_regn_pic'],'pf_regn_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['pf_regn_pic'] = $base64;
}
if(isset($records['esic_regn']) && $records['esic_regn'] == 'yes' && isset($records['esic_regn_pic']) && $records['esic_regn_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['esic_regn_pic'],'esic_regn_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['esic_regn_pic'] = $base64;
}
if(isset($records['export_import_cert']) && $records['export_import_cert'] == 'yes' && isset($records['export_import_cert_pic']) && $records['export_import_cert_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['export_import_cert_pic'],'export_import_cert_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['export_import_cert_pic'] = $base64;
}
if(isset($records['factory_cert']) && $records['factory_cert'] == 'yes' && isset($records['factory_cert_pic']) && $records['factory_cert_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['factory_cert_pic'],'factory_cert_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['factory_cert_pic'] = $base64;
}
if(isset($records['practice_cert']) && $records['practice_cert'] == 'yes' && isset($records['practice_cert_pic']) && $records['practice_cert_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$records['practice_cert_pic'],'practice_cert_pic',$pd_details,13,$records['company_id'],$busienss_info_location);
$records['practice_cert_pic'] = $base64;
}
if(isset($records['documents']) && count($records['documents']))
{
foreach ($records['documents'] as $key => $value) {
if($value['document_pic'] != '')
{
$base64 = self::addTimestampAndReturnBase64($CI,$value['document_pic'],$value['document'],$pd_details,13,$records['company_id'],$busienss_info_location);
$records['documents'][$key]['document_pic'] = $base64;
}
}
}
return $records;
}
public static function addTimestampAndReturnBase64($CI,$base64,$doc_name,$pd_details,$form_id,$company_id = null,$location = '')
{
// ##############################################
$temp_base64_string = $base64;
$title = $doc_name;
$output_file = APPPATH."/docs/temp_base64_image.png";
//Generate Random File Name
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < 5; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
$temp_file_name = $randomString.date('Y-m-d-H:i:s').'.png';
$ifp = fopen( $output_file, 'wb' );
$temp_data = explode( ',', $temp_base64_string );
fwrite( $ifp, base64_decode( $temp_data[ 1 ] ) );
fclose( $ifp );
//echo mime_content_type($output_file);
// ################### start img water marking with text
$imagetobewatermark=imagecreatefromstring(file_get_contents(($output_file)));
$location_watermarktext="Location: ".($location != null ? $location: $pd_details[0]['start_location']);
$font=APPPATH."docs/robold.ttf"; //metion font and it's location
$fontsize="12";
$water_mark_text_color = imagecolorallocate($imagetobewatermark, 225, 0, 0);
$x = imagesy($imagetobewatermark);
$y = imagesy($imagetobewatermark);
imagettftext($imagetobewatermark, $fontsize, 0, 120, ($y - 30), $water_mark_text_color, $font, $location_watermarktext);
imagettftext($imagetobewatermark, $fontsize, 0, 120, ($y - 10), $water_mark_text_color, $font, 'DateB: '.date('Y-m-d h:i:s a'));
imagepng($imagetobewatermark,$output_file);//save as png file in ouputfile location
//################# end img water marking with text
//###########image water marking with logo
$pd_logo = imagecreatefromstring(file_get_contents(APPPATH.'docs/icon.png'));
$curret_file = imagecreatefromstring(file_get_contents($output_file));
$sx = imagesx($curret_file);
$sy = imagesy($curret_file);
// imagecopyresized ( resource $dst_image , resource $src_image , int $dst_x , int $dst_y , int $src_x , int $src_y , int $dst_w , int $dst_h , int $src_w , int $src_h ) : bool
imagecopyresized ( $curret_file , $pd_logo , 5 , ($y - 54) , 0 , 0 , 50 , 50 , 50 , 54 );
imagepng($curret_file,$output_file);// save png image in specified location
//###########end of image water marking with logo
self::saveImagesInS3($CI,$pd_details,$output_file,$temp_file_name,$form_id,$title,$company_id);
//convert img to base64
//$path = $output_file;
//$type = pathinfo($path, PATHINFO_EXTENSION);
$data = file_get_contents($output_file);
return 'data:image/png;base64,' . base64_encode($data);
//ENd of convert img to base64
}
public static function saveImagesInS3($CI,$pd_details,$output_file,$temp_file_name,$form_id,$title,$company_id = null)
{
$tempdoc = $output_file;
$tempdocname = $temp_file_name;
$bucketname = LENDER_BUCKET_NAME_PREFIX.$pd_details[0]['fk_lender_id'];
$key = 'pd'.$pd_details[0]['pd_id'].'/'.$tempdocname;
$sourcefile = $tempdoc;
$bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>$sourcefile);
$s3result= $CI->aws_s3->uploadFileToS3Bucket($bucket_data);
if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
{
$record_data = array('fk_pd_id' => $pd_details[0]['pd_id'],'pd_document_title'=>$title,'pd_document_name'=>$tempdocname,'fk_form_id'=>$form_id,'company_id' => $company_id);
$id = $CI->PD_Model->saveRecords($record_data,PDDOCUMENTS);
//if($id != null || $id != "") { $count++;}
}
}
}

View File

@ -14,7 +14,7 @@ public static function getOthersAssetsDetails($values){
foreach ( $fetchVal['name_of_the_owner'] as $o_key => $owner) {
if($owner['id'] == 0)
{
$assest_owners_name .= $fetchVal['other_owner'];
$assest_owners_name .= $fetchVal['other_owner']. ',';
}
else
{
@ -22,19 +22,13 @@ public static function getOthersAssetsDetails($values){
}
}
//echo $assest_owners_name.'-';
if(strrpos($assest_owners_name,',') && count($fetchVal['name_of_the_owner']) >=2)
{
$assest_owners_name = substr_replace($assest_owners_name, 'and', strrpos($assest_owners_name,','),1) ;
}
else if(strrpos($assest_owners_name,','))
{
$assest_owners_name = substr_replace($assest_owners_name, '', strrpos($assest_owners_name,','),1) ;
}
//echo $assest_owners_name.'-';
// if(!strcasecmp(substr($assest_owners_name, 0,3),'and')) {$assest_owners_name = substr_replace($assest_owners_name,'',0,'and',3);}
// echo $assest_owners_name.'-';die();
if(strrpos($assest_owners_name,','))
{
$assest_owners_name = substr_replace($assest_owners_name, 'and', strrpos($assest_owners_name,','),1) ;
}
$storeValue['assets_mode'] = $fetchVal['assets_mode_master'];
$storeValue['name_of_the_owner'] = $assest_owners_name;
$storeValue['purchase_year'] = $fetchVal['vintage_personal'];

View File

@ -0,0 +1,576 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<!-- <html lang="en" id="mydoc" onkeyup="saveEdits(event)"> -->
<html lang="en" id="mydoc">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link href="https://fonts.googleapis.com/css?family=Merriweather" rel="stylesheet">
<style type="text/css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
.page_break { page-break-before: always; }
#page_break { page-break-before: always; }
/*.page { width: 100%; height: 95%; }*/
@page {
margin: 100px 50px;
/*font-family:Helvetica,Arial;*/
font-family:Merriweather;
}
header {
position: fixed;
top: -70px;
left: 0px;
right: 0px;
height: 20px;
/** Extra personal styles **/
/*background-color: #03a9f4;
color: white;*/
text-align: right;
/*line-height: 35px;*/
}
footer {
position: fixed;
bottom: 5px;
left: 0px;
right: 0px;
height: 20px;
font-size: 10px;
/** Extra personal styles **/
/*background-color: #03a9f4;
color: white;*/
text-align: left;
/*line-height: 35px;*/
}
.non-editable{ background-color:#99ff99; }
.table2 {
border: 1px solid black;
width: 100%;
}
.table2 td {
border: 1px solid black;
height: 50px;
text-align: center;
}
.table2 th {
border: 1px solid black;
height: 50px;
text-align: center;
}
.table2 {
border-collapse: collapse;
}
tfoot{
color:#e00201;
}
.simpletable, .simpletable th, .simpletable td {
border: 1px solid black;
border-collapse: collapse;
}
/* ######### Mini Score Card Table Styles######### */
.mini_scorecard_table {
width: 100%;
page-break-inside: avoid;
}
.mini_scorecard_table td, .mini_scorecard_table th {
page-break-inside: avoid;
}
.mini_scorecard_table th {
padding-top: 5px;
padding-bottom: 5px;
text-align: center;
background-color: #0191ed;
color: white;page-break-inside: avoid;
}
/* #########End of Mini Score Card Table Styles######### */
/* #########End of Mini Score Card Div Styles######### */
#rcorners_green {
background: #33cc33;
padding: 3px;
width: 75px;
height: 5px;
}
#rcorners_red {
background: red;
padding: 3px;
width: 75px;
height: 5px;
}
#rcorners_light_green {
background: #99ff66;
padding: 3px;
width: 75px;
height: 5px;
}
#rcorners_amber{
background: #ff9900;
padding: 3px;
width: 75px;
height: 5px;
}
/* #########End of Mini Score Card DIv Styles######### */
/* #########Score Card Table Styles######### */
.scorecard_table {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: 100%;
page-break-inside: avoid;
}
.scorecard_table td, .scorecard_table th {
border: 1px solid #000;
padding: 8px;
page-break-inside: avoid;
}
.scorecard_table tr:nth-child(even){background-color: #f2f2f2;page-break-inside: avoid; }
.scorecard_table tr:hover {background-color: #ddd;}
.scorecard_table th {
padding-top: 8px;
padding-bottom: 8px;
text-align: center;
background-color: #0191ed;
color: white;page-break-inside: avoid;
}
/* #########End of Score Card Table Styles######### */
/* #########Score Card2 Table Styles######### */
.scorecard_table2 {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: 100%;
}
.scorecard_table2 td, .scorecard_table2 th {
border: 1px solid #000;
padding: 8px;
}
.scorecard_table2 tr:nth-child(even){background-color: #f2f2f2;}
.scorecard_table2 tr:hover {background-color: #ddd;}
.scorecard_table2 th {
padding-top: 8px;
padding-bottom: 8px;
text-align: center;
background-color: #0191ed;
color: white;
}
/* #########End of Score Card2 Table Styles######### */
.customth { width: 10%; }
/* #########billwise Table Styles######### */
.customtd { text-align:center; }
.customtd_leftalign { text-align:left; }
.customtd_rightalign { text-align:right; }
.billwise_table {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: auto;
}
.billwise_table td, .billwise_table th {
border: 1px solid #000;
padding: 4px;
}
.billwise_table tr:nth-child(even){background-color: #f2f2f2;}
.billwise_table tr:hover {background-color: #ddd;}
.billwise_table th {
padding-top: 4px;
padding-bottom: 4px;
text-align: center;
background-color: #0191ed;
color: white;
}
/* #########billwise Table Styles######### */
/* #########Annexure table ######### */
.annexure_table {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: auto;
}
.annexure_table td, .annexure_table th {
border: 1px solid #000;
}
.annexure_table tr:nth-child(even){background-color: #f2f2f2;}
.annexure_table tr:hover {background-color: #ddd;}
.annexure_table th {
/*padding-top: 4px;*/
/*padding-bottom: 4px;*/
text-align: center;
background-color: #0191ed;
color: white;
}
/* #########Annexure######### */
.customtd { text-align:center; }
.customtd_leftalign { text-align:left; }
.customtd_rightalign { text-align:right; }
#boxstyle1 {
box-sizing: border-box;
width: 60px;
height: 20px;
padding: 5px;
border: 2px outset black;
}
#boxstyle2 {
box-sizing: border-box;
width: 200px;
height: 20px;
padding: 5px;
border: 2px outset black;
text-align:center;
}
#boxstyle3 {
box-sizing: border-box;
width: 120px;
height: 20px;
padding: 5px;
border: 2px outset black;
}
#billwise {
box-sizing: content-box;
/*disply:inline;*/
width: 100%;
height: auto;
padding: 10px;
border: 1px solid #0191ed;
}
#first_div {
width: 150px;
height: 25px;
border: 2px outset #000;
overflow: hidden;
text-align: center;
border-color:red;
color:red;
/*padding-left: 20px;*/
}
#tick_div {
position: relative;
width: 40px;
height: 25px;
margin-left: 100%;
margin-top: -29px;
border: 2px outset #000;
text-align: center;
border-color:red;
color:red;
}
#tick_div_other {
position: relative;
width: 40px;
height: 25px;
margin-left: 93%;
margin-top: -29px;
border: 2px outset #000;
text-align: center;
border-color:red;
color:red;
}
/* #########Person met card css######### */
.chip {
padding: 0 25px;
height: 100px;
width: 600px;
font-size: 14px;
border-radius: 50px;
background-color: #f1f1f1;
}
.chip #img1 {
float: left;
margin: 0 10px 0 -25px;
height: 100px;
width: 100px;
border-radius: 50%;
}
.chip #img2 {
float: right;
margin: 0 -25px 0px -125px;
height: 100px;
width: 100px;
border-radius: 50%;
}
/* #########Person met card css######### */
/* #########Doc sighted gallary css######### ;*/
.gallery {
margin: 5px;
border: 1px solid #ccc;
width: 100%;
}
.gallery:hover {
border: 1px solid #777;
}
.desc {
padding: 8px;
text-align: center;
color:green
}
/* #########Doc sighted gallary css######### */
/* ######### TOOLTIP CSS START ######### */
.tooltip {
position: relative;
display: inline;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: black;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
/* Position the tooltip */
position: absolute;
z-index: 1;
}
.tooltip:hover .tooltiptext {
visibility: visible;
}
/* ######### TOOLTIP CSS END ######### */
</style>
<!-- <script type="text/javascript">
function saveEdits(e)
{
var editElem = document.getElementById("mydoc");
var userVersion = editElem.innerHTML;
//localStorage.removeItem('userEdits')
//save the content to local storage
localStorage.userEdits = userVersion;
}
</script> -->
</head>
<body style="font-family:Merriweather;font-size:12px;margin:15px 30px">
<?php
$show_detailed_scorecard = 1;
if($show_detailed_scorecard)
{
echo '<div id="page_break"></div>';
echo "<h3>Detailed Score Card Section</h3>" ;
// *** General Section Questions Score Table
echo '<table class="scorecard_table2">';
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>';
$max_span = '<span style="font-size:9px">('.$general['l1_weightage'].'% * '. $general['l2_weightage'].'% * '.$general['max_score_band'].')</span>';
echo '<tr>'.'<td>'.$question.'</td><td class="customtd">'.$general['l2_weightage'] .'%</td><td class="customtd">'.$general['answer'].
'</td><td class="customtd">'.$general['score_band'].'</td><td class="customtd">'.$general['attributed_score'].'<br>'.$span.'</td><td class="customtd">'.$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 class="customtd">'.number_format($pd_score['score_summary']['general']['actual_score'],2,'.',',').'</td> <td class="customtd">'.number_format($pd_score['score_summary']['general']['max_score'],2,'.',',').'</td> </tr>';
echo '</table>';
echo '<br><br>';
// *** Asset Caculation Score Table
echo '<table class="scorecard_table2">';
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>';
// *** Final Remarks Questions Score Table
echo '<table class="scorecard_table2">';
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>';
$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 class="customtd">'.$final_remark['l2_weightage'].'%</td><td class="customtd">'.$final_remark['answer'].'</td><td class="customtd">'.$final_remark['score_band'].'</td><td class="customtd">'.$final_remark['attributed_score'].'<br>'.$span.'</td><td class="customtd">'.$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 class="customtd">'.number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.',',').'</td> <td class="customtd">'.number_format($pd_score['score_summary']['final_remarks']['max_score'],2,'.',',').'</td> </tr>';
echo '</table>';
echo '<br><br><br>';
//print_r($pd_score['business']);
echo '<table class="scorecard_table2">';
// *** Business Section Questions Score 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)
{
$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') && ($key != 'location_suited_for_busienss'))
{
echo '<tr>'.'<td>'.$question.'</td><td class="customtd">'.$business['l2_weightage'].'%</td><td class="customtd">'.$business['answer'].'</td><td class="customtd">'.$business['score_band'].'</td><td class="customtd">'.$business['attributed_score'].'<br>'.$span.'</td><td class="customtd">'.$business['max_score'].'<br>'.$max_span.'</td></tr>';
}
if($key == 'location_suited_for_busienss')
{
echo '<tr>'.'<td>'.$question.'</td><td class="customtd">'.$business['l2_weightage'].'%</td><td class="customtd">'.$address_type_remarks_caption[ $business['answer'] ].'</td><td class="customtd">'.$business['score_band'].'</td><td class="customtd">'.$business['attributed_score'].'<br>'.$span.'</td><td class="customtd">'.$business['max_score'].'<br>'.$max_span.'</td></tr>';
}
if($key == 'cerificates')
{
$certificates = $business;
echo '<tr>'.'<td> Certificates </td><td class="customtd">'.round($business['l2_weightage'],2).'%</td><td class="customtd">'.'Refer Cert Table'.'</td><td class="customtd">'.$business['score_band'].'</td><td class="customtd">'.$business['attributed_score'].'</td><td class="customtd">'.$business['max_score'].'</td></tr>';
}
}
echo '<tr> <td colspan="4">Business Section Sum of Attributed Score | Sum of Max Score </td> <td class="customtd">'.number_format($pd_score['score_summary']['business']['actual_score'],2,'.',',').'</td> <td class="customtd">'.number_format($pd_score['score_summary']['business']['max_score'],2,'.',',').'</td> </tr>';
echo '</table>';
// *** Business Certificates Score Table
echo '<br><br>';
echo "<table class='scorecard_table2'>";
echo "<tr> <th>Business Certificates</th> <th>Answer</th> <th>Score</th> <th>Attributed Score</th> <th>Max Score</th></tr>";
$index = 0;
// print_r($certificates);
foreach($certificates as $key => $cerificate)
{
$index++;
if($index <=7)
{
$question = MYUTIL::findQuestionByKey($score_questions_display,$key);
$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>'.$question.'</td><td class="customtd">'.$cerificate['answer'].'</td><td class="customtd">'.$cerificate['score_band'].'</td><td class="customtd">'.round($cerificate['attributed_score'],3).'<br>'.$span.'</td><td class="customtd">'.round($cerificate['max_score'],3).'<br>'.$max_span.'</td></tr>';
}
}
echo "</table>";
}
// ########################### End Of Score Card Section #########################################
?>
</body>
</html>