sparqapi/api/application/views/report_templates/JSONTOREPORT.php
2019-03-16 00:41:07 +05:30

260 lines
9.8 KiB
PHP

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
<style type="text/css">
.page_break { page-break-before: always; }
@page {
margin: 100px 50px;
font-family:Helvetica,Arial;
}
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: 30px;
font-size: 10px;
/** Extra personal styles **/
/*background-color: #03a9f4;
color: white;*/
text-align: left;
/*line-height: 35px;*/
}
.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;
}
/* #########Score Card Table Styles######### */
#customers {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#customers td, #customers th {
border: 1px solid #ddd;
padding: 8px;
}
#customers tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
#customers th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4CAF50;
color: white;
}
/* #########Score Card Table Styles######### */
</style>
</head>
<body style="font-size:14px;margin:25px 50px">
<footer>
<hr>
Copyright@Sineedge
</footer>
<header>
<div><img style="width:150;height:50px;opacity: 0.5;" src='http://ssa.sineedge.com/sparqapi/logo/sinelogo.png' /></div>
<hr>
</header>
<!-- Wrap the content of your PDF inside a main tag -->
<?php $loan_form = json_decode($pd_processed_forms[10][0]['processed_json'],true);
?>
<?php
echo "<br><br><br><br><br><br><br><br><br>";
setlocale(LC_MONETARY, 'en_IN');
echo "<div>";
echo "<h1><center>PERSONAL DISCUSSION REPORT</center></h1> ";
echo "<center style='font-size:15px;font-style:italic;font-weight:bold'>for the case of</center>";
echo "<h2><center>".$pd_master_details[0]['title_name'].$pd_master_details[0]['main_applicant']."</center></h2>";
echo "</div>";
echo "<br><br><br><br>";
?>
<table>
<tbody>
<?php
echo "<tr><td>PD Report Date </td> <td> </td> <td>".$pd_master_details[0]['updatedon']."</td>";
echo "<tr><td>PD Vist Date </td> <td> </td> <td> ".$pd_master_details[0]['scheduled_on']."</td></tr>";
echo "<tr><td>PD Initiated by </td> <td> </td> <td>".$pd_master_details[0]['branch_name']." Branch</td></tr>";
echo "<tr><td>Loan Application ID </td> <td> </td> <td> ".$pd_master_details[0]['lender_applicant_id']."</td></tr>";
echo "<tr><td>Product </td> <td> </td> <td>".$pd_master_details[0]['product_name']."</td></tr>";
echo "<tr><td>Customer Segment </td> <td> </td> <td>".$pd_master_details[0]['customer_segment_name']."<td></tr>";
?>
</tbody>
</table>
<?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>
</table>
";
echo "<div class='page_break'></div>";
echo "<br><br>";
echo "<h2>Executive Summary</h2>";
// echo "General Section Score :".number_format($pd_score['score_summary']['general']['score_band'],2,'.','.')."<br>";
// echo "Business Section Score :".number_format($pd_score['score_summary']['business']['score_band'],2,'.','.')."<br>";
// echo "Final Remarks Score :".number_format($pd_score['score_summary']['final_remarks']['score_band'],2,'.','.')."<br>";
// echo "Final PD Score :".number_format($pd_score['score_summary']['overall_score']['final_score'],2,'.','.')."<br>";
//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>
</table>
<?php
if($base64_pdscore_chart_url != "" || $base64_pdscore_chart_url != null)
{
echo "<br><br>";
//####################### CHART #############################
echo '<p style="position:relative;"><img src="'.$base64_pdscore_chart_url.'" style="width:600px;height:350px;"/></p>';
//######################### CHART ###########################
//####################General Section Statred########################
}
else
{ echo "<b>Score Chart Not Generated</b>"; }
echo "<div style='position:relative;'></div>";
echo "<div class='page_break'></div>";
?>
<?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>";
foreach($pd_score['general'] as $key => $general)
{
$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>';
}
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>";
foreach($pd_score['final_remarks'] as $key => $final_remark)
{
$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>';
}
echo '</table>';
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>";
$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>';
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>';
}
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 '</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>";
$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>';
}
}
echo "<table>";
$general_form = json_decode($pd_processed_forms[18][0]['processed_json'],true);
$persons_met = "Default";
$all_company_details = null;
if(array_key_exists('companies',$general_form))
{
$all_company_details = $general_form['companies'];
}
// echo MYUITIL::findCompanyName($all_company_details,2);
//print_r($all_company_details);
//print_r($pd_score['overall_score']['final_score']);
?>
</body>
</html>
<!-- ####################End Of General Section Statred########################-->