CFPL Issues Fixes : ps

This commit is contained in:
Sanjeev 2021-03-22 15:37:03 +05:30
parent d4485cc330
commit e47494b2d7
6 changed files with 607 additions and 15 deletions

View File

@ -1575,7 +1575,7 @@ public function filterSalesPDList_post() {
// print_r($view_data);
// 25 "product_abbr": "NBFC/MFI",
if($view_data['pd_master_details'][0]['product_abbr'] == "NBFC/MFI"){
$html_content = $this->load->view('smc_creditpd_reports/MWISE2',$view_data,true);
$html_content = $this->load->view('smc_creditpd_reports/NBFC',$view_data,true);
}else{
$html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true);
}

View File

@ -1,10 +1,9 @@
<?php
class Loanform
{
public static function getanchordetails($loan_form){
$anchor_details_display = array();
$rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>";
$facility_amt = MYUTIL::customIndianNumberFormat($loan_form['facility_amount']);
$monthly_business_anchor_amt = MYUTIL::customIndianNumberFormat($loan_form['monthly_business_anchor']);
$average_invoicevalue_amt = MYUTIL::customIndianNumberFormat($loan_form['average_invoicevalue']);
@ -31,17 +30,17 @@ public static function getanchordetails($loan_form){
// else if($mnt != '' && $yr == ''){ $yrandmnt = $mnt; }
// else{ $yrandmnt = '-';}
$anchor_details_display[] = array('particulars' => "Facility Amount Applied For (₹)",'details' => "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".$facility_amt.' ('.MYUTIL::numtowords($loan_form['facility_amount']).')');
$anchor_details_display[] = array('particulars' => "Facility Amount Applied For (₹)",'details' => $rupee_symbol." ".$facility_amt.' ('.MYUTIL::numtowords($loan_form['facility_amount']).')');
$anchor_details_display[] = array('particulars' => "Name of Anchor",'details' => $loan_form['anchor_name']);
$anchor_details_display[] = array('particulars' => "Applicant's association vintage with the Anchor Year",'details' => $loan_form['vintage_anchor_year']);
$anchor_details_display[] = array('particulars' => "Applicant's association vintage with the Anchor Month",'details' => $loan_form['vintage_anchor_month']);
// $anchor_details_display[] = array('particulars' => "Applicant's association vintage with the Anchor Year and Month",'details' => $yrandmnt );
$anchor_details_display[] = array('particulars' => "Monthly business (sale/purchase) with the Anchor (₹)",'details' => "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".$monthly_business_anchor_amt.' ('.MYUTIL::numtowords($loan_form['monthly_business_anchor']).')');
$anchor_details_display[] = array('particulars' => "Monthly business (sale/purchase) with the Anchor (₹)",'details' => $rupee_symbol." ".$monthly_business_anchor_amt.' ('.MYUTIL::numtowords($loan_form['monthly_business_anchor']).')');
$anchor_details_display[] = array('particulars' => "Business concentration with Anchor",'details' => $loan_form['business_concentration'].' %');
$anchor_details_display[] = array('particulars' => "Credit period with the Anchor (Days)",'details' => $loan_form['credit_period_days']);
$anchor_details_display[] = array('particulars' => "Payment Mechanism",
'details' => $payment_mechanism_arr[$loan_form['payment_mechanism']]);
$anchor_details_display[] = array('particulars' => "Average Invoice Value (₹)",'details' => "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".$average_invoicevalue_amt.' ('.MYUTIL::numtowords($loan_form['average_invoicevalue']).')');
$anchor_details_display[] = array('particulars' => "Average Invoice Value (₹)",'details' => $rupee_symbol." ".$average_invoicevalue_amt.' ('.MYUTIL::numtowords($loan_form['average_invoicevalue']).')');
$anchor_details_display[] = array('particulars' => "Are there peak seasons for the business with Anchor",'details' => ucfirst($loan_form['peakseasons_anchor']));
if($loan_form['peakseasons_anchor']=='yes')
{
@ -52,7 +51,7 @@ public static function getanchordetails($loan_form){
if($loan_form['anchor_notes']=='yes'){
$anchor_details_display[] = array('particulars' => "Reason for such debit/credit notes",'details' => ucfirst($loan_form['debitcredit_notes']) );
}
$anchor_details_display[] = array('particulars' => "Value of stock related to Anchor (₹)",'details' => "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".$stock_related_amt.' ('.MYUTIL::numtowords($loan_form['stock_related_anchor']).')');
$anchor_details_display[] = array('particulars' => "Value of stock related to Anchor (₹)",'details' => $rupee_symbol." ".$stock_related_amt.' ('.MYUTIL::numtowords($loan_form['stock_related_anchor']).')');
$anchor_details_display[] = array('particulars' => "Observations on Sample Invoices",'details' => $loan_form['sample_invoices'] );
return $anchor_details_display;
// print_r($anchor_details_display);

View File

@ -1308,11 +1308,10 @@ if ( isset($pdf) ) {
$loan_table_dispaly_rows[] = array('particulars' => 'Source of Own Contribution','details' => $source_of_own_contribution );
}
}
if($pd_master_details[0]['lender_short_name'] != 'UDAAN' || $pd_master_details[0]['lender_short_name'] != 'CFPL')
{
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => is_numeric($loan_form['emi_level']) && $loan_form['emi_level'] != 0? ($rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')') : "Not Provided" );
}
if(!($pd_master_details[0]['lender_short_name'] == 'UDAAN' || $pd_master_details[0]['lender_short_name'] == 'CFPL')){
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => is_numeric($loan_form['emi_level']) && $loan_form['emi_level'] != 0? ($rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')') : "Not Provided" );
}
if(!$is_current_product_bl && !$is_current_product_laep)
{

View File

@ -1306,7 +1306,7 @@ if ( isset($pdf) ) {
}
}
if($pd_master_details[0]['lender_short_name'] != 'UDAAN' || $pd_master_details[0]['lender_short_name'] != 'CFPL')
if(!($pd_master_details[0]['lender_short_name'] == 'UDAAN' || $pd_master_details[0]['lender_short_name'] == 'CFPL'))
{
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => is_numeric($loan_form['emi_level']) && $loan_form['emi_level'] != 0? ($rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')') : "Not Provided" );
}

View File

@ -1312,8 +1312,8 @@ if ( isset($pdf) ) {
$loan_table_dispaly_rows[] = array('particulars' => 'Source of Own Contribution','details' => $source_of_own_contribution );
}
}
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => is_numeric($loan_form['emi_level']) && $loan_form['emi_level'] != 0? ($rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')') : "Not Provided" );
if(!($pd_master_details[0]['lender_short_name'] == 'UDAAN' || $pd_master_details[0]['lender_short_name'] == 'CFPL')){
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => is_numeric($loan_form['emi_level']) && $loan_form['emi_level'] != 0? ($rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')') : "Not Provided" );}
if(!$is_current_product_bl && !$is_current_product_laep)
{

View File

@ -0,0 +1,594 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$uparrow = '<span style="color:green;">↑</span>';
$downarrow = '<span style="color:red;">↓</span>';
$dash = '<span style="color:black;"> </span>';
// $product_name = $master[0]['abbr'];
$rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>";
//print_r($master[0]['abbr']);die();
?><!DOCTYPE html>
<html lang="en">
<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;*/
}
/* #########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: inline;
}
.scorecard_table td, .scorecard_table th {
border: 1px solid #000;
padding: 8px;
page-break-inside: inline;
}
.scorecard_table tr:nth-child(even){background-color: #f2f2f2;page-break-inside: inline; }
.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: inline;
}
/* #########End of Score Card Table Styles######### */
/* ######### 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 Card2 Table Styles######### */
.scorecard_table2 {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: 100%;
page-break-inside: avoid;
}
.scorecard_table2 td, .scorecard_table2 th {
border: 1px solid #000;
padding: 8px;
page-break-inside: avoid;
}
.scorecard_table2 tr:nth-child(even){background-color: #f2f2f2;page-break-inside: avoid; }
.scorecard_table2 tr:hover {background-color: #ddd;}
.scorecard_table2 th {
padding-top: 8px;
padding-bottom: 8px;
text-align: center;
background-color: #0191ed;
color: white;page-break-inside: avoid;
}
/* #########End of Score Card 2 Table Styles######### */
.tdcenteralign{ text-align: center; }
.thlargefont{ font-size: 20px; }
</style>
</head>
<body style="font-family:Merriweather;font-size:12px;margin:15px 30px">
<footer>
<hr>
<img style="width:100px;height:50px;opacity: 0.5;padding-top: 5px;" src='https://pdgenie.com/logo/sineedge_red.png'/> Powered By PD Genie
</footer>
<header>
<div><img style="width:100px;height:50px;opacity: 0.5;" src='https://www.smcfinance.com/images/logo-small.jpg'/></div>
<hr>
</header>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="10" >Personal Discussion Sheet - <?php echo $pd_master_details[0]['product_abbr']?> </th>
</tr>
<tr>
<td colspan="3"> Application ID</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $pd_master_details[0]['lender_applicant_id'] ? $pd_master_details[0]['lender_applicant_id'] : 'Not Provided'?> </td>
</tr>
<tr>
<td colspan="3"> Name of the Company/Firm</td>
<td class = "tdcenteralign" colspan="7"> <?php echo isset($applicant_details[0]['company_name']) ? $applicant_details[0]['company_name'] : $pd_master_details[0]['main_applicant']?></td>
</tr>
<?php if(isset($pd_section_data[1]['person_met']) && $pd_section_data[1]['person_met'] != ''){?>
<tr>
<td colspan="3"> Name of Person Met During Visit and Contact Number</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $pd_section_data[1]['person_met']?> </td>
</tr>
<?php }?>
<!-- <tr>
<td colspan="3"><?php if($master[0]['sales_pd_type'] == 1){echo 'Name of Person Met during visit'; }else{ echo 'Name of the Person Contacted'; } ?></td>
<td class = "tdcenteralign" colspan="7"><?php echo $section1['person_met_during_visit']?></td>
</tr> -->
<tr>
<td colspan="3" rowspan="2" ><?php echo 'Address visited for PD'; ?></td>
<td class = "tdcenteralign" colspan="7"><?php echo $pd_master_details[0]['addressline1']?></td>
</tr>
<tr>
<td>City</td>
<td class = "tdcenteralign"><?php echo$pd_master_details[0]['city_name']?></td>
<td>State</td>
<td class = "tdcenteralign"><?php echo $pd_master_details[0]['state_name']?></td>
<td>PIN</td>
<td class = "tdcenteralign" colspan="2"><?php if(isset($pd_master_details[0]['pincode_others'])){ echo $pd_master_details[0]['pincode_others']; } else { echo $pd_master_details[0]['pincode']; }?></td>
</tr>
<?php
if(isset($pd_section_data[2]))
{
if(isset($pd_section_data[2]['alternative_address']) && $pd_section_data[2]['alternative_address'] != '')
{
echo '<tr> <td colspan="3">Actual PD Address</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['alternative_address'].'</td></tr>';
}
$ownership_type = '';
if( isset($pd_section_data[8]['business_ownership_type']) && (strtolower($pd_section_data[8]['business_ownership_type'])) == 'owned')
{
$ownership_type = '( Owned )';
}
else if(isset($pd_section_data[8]['business_ownership_type']) && (strtolower($pd_section_data[8]['business_ownership_type'])) == 'rented')
{
$ownership_type = ' ( Rented ) - Rent paid '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[8]['business_monthly_rented_amt']);
}
echo '<tr> <td colspan="3">Address Type / Ownership</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['address_type']['address_type'].$ownership_type.'</td></tr>';
if(isset($pd_section_data[8]['is_business_address']) && strtolower($pd_section_data[8]['is_business_address']) == 'yes')
{
echo '<tr> <td colspan="3">Period for which business has been <br>in operation from this address </td> <td class = "tdcenteralign" colspan="7">'.($pd_section_data[8]['business_years'].' Year(s)'.(isset($pd_section_data[8]['business_months']) && $pd_section_data[8]['business_months'] != '' ? ' & ' . $pd_section_data[8]['business_months'] .' Month(s)': '')).'</td> </tr>';
}
echo '<tr> <td colspan="3">PD locality</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['pd_locality']['locality_name'].'</td></tr>';
echo '<tr> <td colspan="3">Location Approach</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['pd_location']['description'].'</td></tr>';
echo '<tr> <td colspan="3">Comment On Locality</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['comment_locality']['rating'].'</td></tr>';
echo '<tr> <td colspan="3">Estimated Area of Business Premise </td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['business_estimated_area'].' '.$pd_section_data[2]['uom'].'</td></tr>';
}
?>
</tbody>
</table>
<!-- <div id="page_break"></div> -->
<br><br>
<br><table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Satellite Image of PD Location</th></tr></table><br>
<p><b>GPS Coordinates of location where PD Visit was done : <?php echo $pd_master_details[0]['start_location'] ? $pd_master_details[0]['start_location'] : '-'; ?></b></p>
<?php if($pd_master_details[0]['start_location']) { ?>
<img style="border:3px solid #0191ed;" src = "<?php echo 'data:image/gif;base64,'.$satellite[0]['img']; ?>" alt = "PD Visted Location Satellite Image " height="270px" width="630px">
<?php
}else{ echo '<p>Location access Not Available</p>';}
?>
<div id="page_break"> </div>
<br>
<table class="scorecard_table">
<tr>
<th class="thlargefont" colspan="4">General Section</th>
</tr>
<?php if(isset($pd_section_data['21']) && count($pd_section_data['21']) && ($pd_section_data['21']['name'] != '') && ($pd_section_data['21']['loan_amount'] != '' )){?>
<tr>
<th colspan="1">Name</th><th colspan="1">Loan Amount</th><th colspan="1">Product</th><th colspan="1">Location</th>
</tr>
<?php
echo '<tr><td colspan="1" class = "tdcenteralign">'.$pd_section_data['21']['name'].'</td><td colspan="1" class = "tdcenteralign">'.$pd_section_data['21']['loan_amount'].'</td><td colspan="1" class = "tdcenteralign">'.$pd_section_data['21']['product'].'</td><td colspan="1" class = "tdcenteralign">'.$pd_section_data['21']['location'].'</td></tr>';
}
else {
echo '<tr> <td colspan="4" class="tdcenteralign"> General Section Not Available</td> </tr>';
}
?>
<tbody>
</tbody>
</table>
<br><br>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Profile</th></tr>
<?php if(isset($pd_section_data['22']) && count($pd_section_data['22']) && ($pd_section_data['22']['history_vintage'] != '') && ($pd_section_data['22']['primary_partners'] != '' )){
echo '</table><br><p><b>History &  Vintage and  Lineage </b></p>
<p align="justify">'.$pd_section_data['22']['history_vintage'].'</p>
<br><p class="parasubtitle"><b>Primary shareholding , promoters  and major   equity  partners</b></p>
<p align="justify">'.$pd_section_data['22']['capital_details'].'</p>
<br><p class="parasubtitle"><b>The  capital  structure and details of  the  various  investments vehicles</b></p>
<p align="justify">'.$pd_section_data['22']['history_vintage'].'</p>';
}
else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Profile Not Available</td> </tr></tbody></table>';
}
?>
<br><br>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Size and Geographical Reach</th></tr>
<?php if(isset($pd_section_data['23']) && count($pd_section_data['23']) && ($pd_section_data['23']['aum_book'] != '') && ($pd_section_data['23']['geographical_details'] != '' )){
echo '</table><br><p><b>AUM  (  off book  &  on book  ) &e. Trend of Disbursement in last 2 quarters</b></p>
<p align="justify">'.$pd_section_data['23']['aum_book'].'</p>
<br><p><b>States  and geographical  regions & Branches  &  geographical  customer base</b></p>
<p align="justify">'.$pd_section_data['23']['geographical_details'].'</p>
<br><p><b>Branches /employees / structure</b></p>
<p align="justify">'.$pd_section_data['23']['branches_employees'].'</p>
<br><p><b>Portfolio concentration and Cuts to be discussed</b></p>
<p align="justify">'.$pd_section_data['23']['portfolio_concentration'].'</p>
<br><p><b>Who are the competitors to the business</b></p>
<p align="justify">'.$pd_section_data['23']['business_competitors'].'</p>
<br><p><b>Estimated Market Size of the Business& Market share</b></p>
<p align="justify">'.$pd_section_data['23']['estimated_market'].'</p>';
}
else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Size and Geographical Reach Not Available</td> </tr></tbody></table>';
}
?>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Product  &  Processes</th></tr>
<?php if(isset($pd_section_data['24']) && count($pd_section_data['24']) && ($pd_section_data['24']['products'] != '') && ($pd_section_data['24']['policies'] != '' )){
echo '</table><br><p><b>Products</b></p>
<p align="justify">'.$pd_section_data['24']['products'].'</p>
<br><p><b>Policies</b></p>
<p align="justify">'.$pd_section_data['24']['policies'].'</p>
<br><p><b>Credit  appraisal mechanism</b></p>
<p align="justify">'.$pd_section_data['24']['credit_appraisal'].'</p>
<br><p><b>Technology and  usage  for    acquisition and  credit</b></p>
<p align="justify">'.$pd_section_data['24']['technology_credit'].'</p>
<br><p><b>Collection policy and   mechanism -Collection efficiency trends in last 12 months (CC/CD, TC/CD,TC/TD) any deviation to be discussed in detail</b></p>
<p align="justify">'.$pd_section_data['24']['collection_policy'].'</p>
<br><p><b>Provisioning policy</b></p>
<p align="justify">'.$pd_section_data['24']['provisioning_policy'].'</p>
<br><p><b>Restructuring policy</b></p>
<p align="justify">'.$pd_section_data['24']['restructuring_policy'].'</p>
<br><p><b>Covid  impact and policy</b></p>
<p align="justify">'.$pd_section_data['24']['covid_policy'].'</p>';
}else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Product  &  Processes Not Available</td> </tr></tbody></table>';
}
?>
<br>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Portfolio Health</th></tr>
<?php if(isset($pd_section_data['25']) && count($pd_section_data['25']) && ($pd_section_data['25']['par_book'] != '') && ($pd_section_data['25']['provisioning_resolution'] != '' )){
echo '</table><br><p><b>Par  own book /Par off  book -d</b></p>
<p align="justify">'.$pd_section_data['25']['par_book'].'</p>
<p><b>NPAs/Provisioning & resolution strategy</b></p>
<p align="justify">'.$pd_section_data['25']['provisioning_resolution'].'</p>
<p><b>Strategy to manage flow as well as  post moratorium stress</b></p>
<p align="justify">'.$pd_section_data['25']['post_morotorium'].'</p>
<p><b>Strategy  for non-paying customers</b></p>
<p align="justify">'.$pd_section_data['25'][' non-paying_customers'].'</p>
<p><b>PAR (Productwise)/Net NPAs/Write offs Movement of Bucket ,PAR 90+</b></p>
<p align="justify">'.$pd_section_data['25']['par'].'</p>';
}
else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Portfolio Health Not Available</td> </tr></tbody></table>';
}
?>
<br>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Total Overall Debt/Equity Profile</th></tr>
<?php if(isset($pd_section_data['26']) && count($pd_section_data['26'])&& ($pd_section_data['26']['dept_structures'] != '') && ($pd_section_data['26']['future_plan'] != '' )){
echo '</table><br><p><b>Types of debt structures and  major debt providers</b></p>
<p align="justify">'.$pd_section_data['26']['dept_structures'].'</p>
<p><b>Future plan for additional funding</b></p>
<p align="justify">'.$pd_section_data['26']['future_plan'].'</p>
<p><b>Funding received during covid times including liquidity  support  from  DFIs & Banks</b></p>
<p align="justify">'.$pd_section_data['26']['dfi_banks'].'</p>
<p><b>Fresh sanctions lined up in the  present month and coming quarters</b></p>
<p align="justify">'.$pd_section_data['26']['fresh_sanctions'].'</p>';
}
else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Total Overall Debt/Equity Profile Not Available</td> </tr></tbody></table>';
}
?>
<br>
<div id="page_break"> </div>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="6">Financial  analysis</th>
</tr>
<?php if(isset($pd_section_data['27']) && count($pd_section_data['27'])&& ($pd_section_data['27']['car_type'] != '') && ($pd_section_data['27']['leverage'] != '' )){?>
<tr>
<th colspan="1">CAR (Tier-1)/CAR (Tier-1 + Tier-2)</th>
<th colspan="1">Leverage (D/E) (excluding Managed)</th>
<th colspan="1">ALM</th>
<th colspan="1">Opex</th>
<th colspan="1">NIM (%) - as per Audited B/S</th>
<th colspan="1">Opex (% of Avg. Book)</th>
</tr>
<?php
echo '<tr><td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['car_type'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['leverage'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['alm'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['opex'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['nim'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['opex_average'].'</td></tr>';?>
<tr>
<th colspan="1">Opex (% of NII)</th>
<th colspan="1">Return on Assets</th>
<th colspan="1">Return on Equity</th>
<th colspan="1">IRR (Derived)</th>
<th colspan="1">Avg. Borrowing Cost (Derived)</th>
<th colspan="1">Spread (Derived)</th>
</tr>
<?php
echo '<tr>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['opex_nii'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['return_asset'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['return_equity'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['irr'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['avg_borrowing'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['spread'].'</td></tr>';
}
else {
echo '<tr> <td colspan="6" class="tdcenteralign"> Financial  analysis Not Available</td> </tr>';
}
?>
</tbody>
</table>
<br>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Overall Plan of Action</th></tr>
<?php if(isset($pd_section_data['28']) && count($pd_section_data['28'])&& ($pd_section_data['28']['future_plan'] != '')){
echo '</table><br><p><b>Future plan on  expansion  geographies wise , products and regions . Equity  and debt structuring as well as  dilution in future. Target book for the present quarter and  YOY   projections</b></p>
<p align="justify">'.$pd_section_data['28']['future_plan'].'</p>';
}
else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Overall Plan of Action Not Available</td> </tr></tbody></table>';
}
?>
<br>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Validation Points vide Systems and Books at HQ & Branches</th></tr></table>
<?php if(isset($pd_section_data['29']) && count($pd_section_data['29']) && ($pd_section_data['29']['stock_validated'] != '') && ($pd_section_data['29']['collateral_coverage'] != '' )){
echo '<br><p><b>Stock to be validated from system</b></p>
<p align="justify">'.$pd_section_data['29']['stock_validated'].'</p>
<p><b>Collateral coverage for existing borrowing ( System Mapping to be checked)</b></p>
<p align="justify">'.$pd_section_data['29']['collateral_coverage'].'</p>
<p><b>Collection efficiency and system flagging to be counterchecked and same with PAR cuts</b></p>
<p align="justify">'.$pd_section_data['29']['collection_efficiency'].'</p>
<p><b>Sample check of loan dox, application form along with PAN for Active loan accounts</b></p>
<p align="justify">'.$pd_section_data['29']['loan_dox'].'</p>
<p><b>Disbursement no to be checked from system</b></p>
<p align="justify">'.$pd_section_data['29']['disbursement'].'</p>
<p><b>Top 20 exposure to be checked with data submitted</b></p>
<p align="justify">'.$pd_section_data['29']['top20_exposure'].'</p>
<p><b>Sample Sanction letters to validate collateral cover stipulated for existing Borrowing</b></p>
<p align="justify">'.$pd_section_data['29']['sanction_letters'].'</p>
<p><b>Provisioning /Write-off/NPA flagging to be counter checked</b></p>
<p align="justify">'.$pd_section_data['29']['provisioning'].'</p>
<p><b>Restructuring of Loans in system on sample basis</b></p>
<p align="justify">'.$pd_section_data['29']['restructuring_loan'].'</p>
<p><b>EMI cycle date in system</b></p>
<p align="justify">'.$pd_section_data['29']['emi_date'].'</p>
<p><b>Cash and Bank ledger to be checked</b></p>
<p align="justify">'.$pd_section_data['29']['cash_checked'].'</p>
<p><b>Free FD details to be taken and validated from Accounting system</b></p>
<p align="justify">'.$pd_section_data['29']['fd_details'].'</p>
<p><b>Application/Systems used for Boarding /Loan management</b></p>
<p align="justify">'.$pd_section_data['29']['loan_management'].'</p>';
}
else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Validation Points vide Systems and Books at HQ & Branches Not Available</td> </tr></tbody></table>';
}
?>
</tbody>
</table>
<div id="page_break"> </div>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="8">Final Remarks of PD officer</th>
</tr>
<?php
if(isset($pd_section_data['19']) && count($pd_section_data['19'])&& ($pd_section_data[19]['pd_officer_recommendation'] != '') && ($pd_section_data[19]['customer_behaviour'] != '' )){
$customer_behaviour = array('1' => 'Others','2' => 'Rude','3' => 'Polite');
$over_all = array('2' => 'Positive','3' => 'Negative');
?>
<tr><td colspan="4">Customer Behaviour
[Polite / Rude / Others (Please specify)]</td><td colspan="4"><?php echo isset($pd_section_data[19]['customer_behaviour_other']) ? $pd_section_data[19]['customer_behaviour_other'] : $customer_behaviour [ $pd_section_data[19]['customer_behaviour'] ];?></td></tr>
<tr><td colspan="4">PD Officer's overall assessment
(Positive / Negative)</td><td colspan="4"><?php echo $over_all [ $pd_section_data[19]['pd_officer_recommendation'] ];?></td></tr>
<?php
$reason = '';
foreach($pd_section_data[19]['pd_officer_recommendation_remarks'] as $key => $val)
{ $reason .= ($key + 1).' '.$val['reason'].'<br>'; }
?>
<tr><td colspan="4">PD Officer's key points considered while arriving at the aforementioned status</td><td colspan="4"><?php echo $reason;?></td></tr>
<?php if(isset($pd_section_data[19]['final_form_remarks']) && !empty($pd_section_data[19]['final_form_remarks'])){
echo '<tr><td colspan="4">Remarks</td><td colspan="4">'.$pd_section_data[19]['final_form_remarks'] .'</td></tr>';
} } else{
echo '<tr> <td class="tdcenteralign" colspan="8">Final Remarks of PD officer Not Available</td> </tr>';
}?>
</tbody></table>
<?php
$iter = 0;
$photo_names = array('person_met' => 'Selfie with person met','person_met_id_proof' => 'Person met ID Proof','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','supplier_image' => 'Supplier Bills','client_image' => 'Client Bills','machinary_image' => 'Machinary Image');
// if($master[0]['sales_pd_type'] == 2){ $photo_names['selfie_with_person_met'] = 'Selfie of the person contacted';}
// echo count($smc_images);die();
//print_r(array_keys($section9));die();
$tot_rows = ceil(count($smc_images) / 3);
if(count($smc_images))
{
echo '<div id="page_break"></div>';
echo '<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Photograph`s</th></tr></table><br><table ><tbody>';
$add_factor = 0;
for($row = 0;$row < $tot_rows; $row++)
{
echo '<tr>';
$from = $row == 0 ? $row : ($row+$add_factor);
$to = ($from + 2);
$add_factor = $add_factor + 2;
for($i = $from ; $i <= $to; $i++)
{
if(isset($smc_images[$i]))
{
echo '<td style="text-align:center;border:1px solid;"> <img src="'.$smc_images[$i]['img'].'" height = "200" width="200" alt="'.$smc_images[$i]['img_name'].'"/><br>'.$photo_names [ $smc_images[$i]['img_name'] ].'</td>';
}
//unset($p_key);
}
echo '</tr>';
}
echo '</tbody></table>';
}?>
<br><br>
<table class="scorecard_table">
<tbody>
<tr>
<td colspan="3" >Name of Credit Manager </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['updatedby']?></td>
</tr>
<!-- <tr>
<td colspan="3" >Designation of Sales Team Member </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['updatedby_designation']?></td>
</tr> -->
<tr>
<td colspan="3" >Date of PD Visit </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['pd_visit_date']?></td>
</tr>
</tbody>
</table>
</body>
</html>