sparqapi/api/application/views/smc_creditpd_reports/MWISE.php

1562 lines
71 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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>";
// echo $pd_master_details[0]['main_applicant'];
// echo $applicant_details[0]['company_name'];die();
// $pd_type = "";
// if($master[0]['sales_pd_type'] == 1){$pd_type = "Physical "; }else if($master[0]['sales_pd_type'] == 2){$pd_type = "Telephonic ";}
// $company = array();
// $arr = $pd_section_data[1]['borrower_details'];
// if(!empty($arr)){
// for($i=0;$i<count($arr);$i++){
// $entity_type = $arr[$i]['entity_type'];
// if($entity_type != "Individual"){
// $company[$i+1] =$arr[$i]['borrower_name'];
// }
// }
// }
?><!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;
}
.table_loan td, .table_loan th{
padding: 3px !important;
}
.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://pdgenie.com/logo/smc_logo.png'/></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> -->
<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']) && (strlen($applicant_details[0]['company_name']) != 0) ? $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 colspan="3" rowspan="2" ><?php if($pd_section_data[2]['is_pd_done_on_initiated_address'] == "No"){echo 'Address at which PD was initiated'; }else{ 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>Due to location access not provided by loan applicant Geo coordinates on photographs and Satellite image of PD location is not shown</p>';}
?>
<div id="page_break"> </div>
<table class="scorecard_table">
<tr>
<th class="thlargefont" colspan="8">Borrower`s Details</th>
</tr>
<tr>
<th colspan="1">Borrower<br> Type</th>
<th colspan="1">Name</th>
<th colspan="1">Entity<br> Type</th>
<th colspan="1">Designation</th>
<th colspan="1">Relation</th>
<th colspan="1">Realtion<br> to</th>
<th colspan="1">Age/<br>Business vintage</th>
<th colspan="1">Borrower's<br>vintage<br>in the<br>business<br>(Yrs)</th>
</tr>
<?php
foreach ($pd_section_data[1]['borrower_details'] as $key1 => $value1)
{
echo '<tr><td colspan="1" class = "tdcenteralign">'.$value1['borrower_type'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['borrower_name'].(isset($value1['mobile_numbers']) && $value1['mobile_numbers'] != '' ? ('<br>('. $value1['mobile_numbers'] .')'): '').'</td> <td colspan="1" class = "tdcenteralign">'.$value1['entity_type'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['designation'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['relationship'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['relationship_to'].'</td> <td colspan="1" class = "tdcenteralign">'.(isset($value1['borrower_age']) && !empty($value1['borrower_age']) ? $value1['borrower_age'] : ( (strcasecmp($value1['entity_type'],'Individual')) ? $value1['numbers_of_years_business_running'] : 'NA')).'</td> <td colspan="1" class = "tdcenteralign">'.(isset($value1['numbers_of_years_business_running']) && !empty($value1['numbers_of_years_business_running']) && (!strcasecmp($value1['entity_type'],'Individual'))? $value1['numbers_of_years_business_running'] : 'NA').'</td></tr>';
}
?>
<tr>
<td colspan="2" >Remarks</td>
<td class = "tdcenteralign" colspan="6" ><?php echo $pd_section_data[1]['common_remarks']?></td>
</tr>
<tbody>
</tbody>
</table>
<?php
// echo '<div id="page_break"> </div>';
// echo '<h2 contenteditable="true">PD Score Summary</h2>';
?>
<!-- <table class="scorecard_table">
<tr> <th> </th> <th>Actual Score</th> <th>Max Score</th> <th>Score %</th> </tr>
<tr> <td>General Section Score</td> <td class="customtd"> <?php echo number_format($pd_score['score_summary']['general']['actual_score'],2,'.',',')?></td> <td class="customtd"><?php echo number_format($pd_score['score_summary']['general']['max_score'],2,'.',',')?></td> <td class="customtd"> <?php echo round($pd_score['score_summary']['general']['score_per'],1).'%'?></td></tr>
<tr> <td>Business Section Score</td> <td class="customtd"> <?php echo number_format($pd_score['score_summary']['business']['actual_score'],2,'.',',')?></td> <td class="customtd"><?php echo number_format($pd_score['score_summary']['business']['max_score'],2,'.',',')?></td> <td class="customtd"> <?php echo round($pd_score['score_summary']['business']['score_per'],1).'%'?></td></tr>
<tr> <td>Final Remarks Score</td> <td class="customtd"> <?php echo number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.',',')?></td> <td class="customtd"><?php echo number_format($pd_score['score_summary']['final_remarks']['max_score'],2,'.',',')?></td><td class="customtd"> <?php echo round($pd_score['score_summary']['final_remarks']['score_per'],1).'%'?></td></tr>
<tr> <td>Final PD Score</td> <td class="customtd"> <?php echo number_format($pd_score['score_summary']['overall_score']['overall_actual_score'],2,'.',',')?></td> <td class="customtd"><?php echo number_format($pd_score['score_summary']['overall_score']['overall_max_score'],2,'.',',')?></td> <td class="customtd"> <?php echo round($pd_score['score_summary']['overall_score']['final_score'],1).'%'?></td></tr>
</table> -->
<?php
//####################### CHART #############################
// if(isset($base64_pdscore_chart_url))
// {
// echo "<br><br>";
// echo '<p><img src="'.$base64_pdscore_chart_url.'" style="width:600px;height:350px;"/></p>';
// echo '<div id="page_break"> </div>';
//$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 % >>");
// echo '<div id="page_break"> </div>';
// echo '<table class="mini_scorecard_table">';
// echo '<tr> <th style="width:70%;font-size:16px;" colspan="2">Business Related Parameters Impacting Score</th> <th style="width:30%;font-size:16px;">Response</th> </tr>';
// echo '<tbody>';
// 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 = ( $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(strcasecmp($answer,'Not Applicable'))
// {
// echo '<tr> <td style="width:70%;">'. $business_captions[$bsk] .'</td> <td style="width:30%;">'. '<div id="'. $class .'"></div></td> <td class="customtd">'. ucfirst($answer).'</td> </tr>';
// }
// }
// echo '</tbody>';
// echo '</table>';
// echo '<br><br><br>';
// echo '<table class="mini_scorecard_table">';
// echo '<tr> <th style="width:70%;font-size:16px;" colspan="2">Other Parameters Impacting Score</th><th style="width:30%;font-size:16px;">Response</th> </tr>';
// echo '<tbody>';
// 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')));
// $answer = ucfirst($general_score['answer']);
// if(strcasecmp($answer,'Not Applicable'))
// {
// echo '<tr> <td style="width:70%;">'. $general_captions[$gsk] .'</td> <td style="width:30%;">'. '<div id="'. $class .'"></div></td> <td class="customtd">'. $answer.'</td> </tr>';
// }
// }
// echo '</tbody>';
// echo '</table>';
// echo '<div id="page_break"> </div>';
//}?>
<div id="page_break"> </div>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="10">Fund Requirement</th>
</tr>
<tr>
<td colspan="3" >Loan Amount Applied for (<?php echo $rupee_symbol?>)</td>
<td class = "tdcenteralign" colspan="3" ><?php echo ( isset($pd_section_data[3]['loan_amount']) && $pd_section_data[3]['loan_amount'] != '' ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[3]['loan_amount']) : '-')?></td>
<td colspan="2">Total Fund Requirement (<?php echo $rupee_symbol?>)</td>
<td class = "tdcenteralign" colspan="2"> <?php echo ( isset($pd_section_data[3]['total_fund_requirement']) ? $rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[3]['total_fund_requirement']): '-')?></td>
</tr>
<?php if(isset($pd_section_data[3]['remarks_fund_source_balance'])){?>
<tr>
<td colspan="3" >Remarks of funds for balance Amount required</td>
<td class = "tdcenteralign" colspan="7" ><?php echo $pd_section_data[3]['remarks_fund_source_balance']?></td>
</tr>
<?php } ?>
<tr>
<td colspan="3" >Loan tenure</td>
<td class = "tdcenteralign" colspan="7" ><?php echo (isset($pd_section_data[3]['loan_tenure']) ? $pd_section_data[3]['loan_tenure'] : '-')?></td>
</tr>
<tr>
<td colspan="3" >End use of Loan</td>
<td class = "tdcenteralign" colspan="7" ><?php echo ( isset($pd_section_data[3]['end_use']) ? $pd_section_data[3]['end_use'] : '-')?></td>
</tr>
<?php if($pd_master_details[0]['product_abbr'] == 'LFMP'){ ?>
<tr>
<td colspan="3" >Is There any Balance Transfer</td>
<td class = "tdcenteralign" colspan="7" ><?php echo isset($pd_section_data[3]['is_transfer']) ? $pd_section_data[3]['is_transfer'] : '-'?></td>
</tr>
<?php if(isset($pd_section_data[3]['is_transfer']) && strtolower($pd_section_data[3]['is_transfer']) == 'yes'){?>
<tr>
<td colspan="3" >Balance Transfer Amount</td>
<td class = "tdcenteralign" colspan="3" ><?php echo $rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[3]['balance_transfer_amount'])?></td>
<td colspan="2" >Top up amount</td>
<td class = "tdcenteralign" colspan="2" ><?php echo $rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[3]['topup_amount'])?></td>
</tr>
<tr>
<td colspan="3" >Lender from where BT done</td>
<td class = "tdcenteralign" colspan="7" ><?php echo $pd_section_data[3]['lender']['lender_name']?></td>
</tr>
<?php } ?>
<tr>
<td colspan="3" >Type of Property being Mortaged</td>
<td class = "tdcenteralign" colspan="7" ><?php echo isset($pd_section_data[3]['property_type']) ? $pd_section_data[3]['property_type'] : '-'?></td>
</tr>
<tr>
<td colspan="3" >Name of The Owner</td>
<td class = "tdcenteralign" colspan="7" ><?php echo isset($pd_section_data[3]['owner_name']) ? $pd_section_data[3]['owner_name'] : '-'?></td>
</tr>
<tr>
<td colspan="3" >Estimated Market Value as per Customer</td>
<td class = "tdcenteralign" colspan="3" ><?php echo isset($pd_section_data[3]['emv_per_customer']) ? $rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[3]['emv_per_customer']) : '-'?></td>
<td colspan="2" >Market Value considered for LTV</td>
<td class = "tdcenteralign" colspan="2" ><?php echo isset($pd_section_data[3]['ltv_market_value_calculation']) ? $rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[3]['ltv_market_value_calculation']) : ''?></td>
</tr>
<tr>
<td colspan="3" >Addess of property</td>
<!-- <td class = "tdcenteralign" colspan="3" ><?php echo isset($pd_section_data[3]['address']) ? $pd_section_data[3]['address'].', '.$pd_section_data[3]['city']['name'].', '.$pd_section_data[3]['state']['name'].', '.$pd_section_data[3]['pincode'] : ''?></td> -->
<td class = "tdcenteralign" colspan="3" ><?php echo isset($pd_section_data[3]['address']) ? $pd_section_data[3]['address'] : ''?></td>
<td colspan="2" >Stage of construction</td>
<td class = "tdcenteralign" colspan="2" ><?php echo isset($pd_section_data[3]['construction_stage']) ? $pd_section_data[3]['construction_stage'] : ''?></td>
</tr>
<tr>
<td colspan="3" >Property usage</td>
<td class = "tdcenteralign" colspan="3" ><?php echo isset($pd_section_data[3]['property_usage']) ? $pd_section_data[3]['property_usage'] : ''?></td>
<td colspan="2" >Structure type</td>
<td class = "tdcenteralign" colspan="2" ><?php echo isset($pd_section_data[3]['structure_type']) ? $pd_section_data[3]['structure_type'] : ''?></td>
</tr>
<?php }?>
<?php if(isset($pd_section_data[3]['common_remarks']) && !empty($pd_section_data[3]['common_remarks'])){?>
<tr>
<td colspan="3" >Remarks</td>
<td class = "tdcenteralign" colspan="7" ><?php echo $pd_section_data[3]['common_remarks']?></td>
</tr>
<?php }?>
</tbody>
</table>
<br><br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="17">Details of Key Stakeholders in the Business</th>
</tr>
<tr>
<th colspan="3">Name</th>
<th colspan="2" >Share Holding</th>
<th colspan="2" >Year(s) in Current Business</th>
<th colspan="2">Total Work Exp(Yrs)</th>
<th colspan="2" >Previous Experience Details</th>
<th colspan="2" >Started Business</th>
<th colspan="4">Name of the Company</th>
</tr>
<?php
if(isset($pd_section_data[5]))
{
foreach ($pd_section_data[5]['key_stakeholders'] as $section5_key => $section5_value)
{
echo '<tr><td class="tdcenteralign" colspan="3">'.$section5_value['stakeholder_name'] .'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section5_value['share_holding'].'%</td>'.
'<td class="tdcenteralign" colspan="2">'.$section5_value['vintage_in_current_biz'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section5_value['total_work_exp'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.( isset ($section5_value['previous_experience_details']) && $section5_value['previous_experience_details'] ? $section5_value['previous_experience_details'] : 'NA' ).'</td>'.
'<td class="tdcenteralign" colspan="2" style="text-align: center">'.$section5_value['started_biz'].'</td>'.
'<td class="tdcenteralign" colspan="4">'.( isset ($section5_value['company_name']) ? $company[$section5_value['company_name']] : 'NA' ).'</td>'.
'</tr>';
}
}
?>
<tr>
<td colspan="5" >Remarks</td>
<td class = "tdcenteralign" colspan="12" ><?php echo $pd_section_data[5]['common_remarks']?></td>
</tr>
</tbody></table>
<div id="page_break"> </div>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="15">Other Family Members involved in the Business</th>
</tr>
<?php if(isset($pd_section_data[16]['family_details'])) {?>
<tr>
<th colspan="5">Name</th>
<th colspan="3" >Relationship</th>
<th colspan="2" >Relation to Individual Stakeholders</th>
<th colspan="3">Relation to Company / Firm</th>
<th colspan="2" >Started Biz (Yes / No)</th>
<!-- <th colspan="2" >Started Business</th> -->
</tr>
<?php } ?>
<?php
if(isset($pd_section_data[16]['family_details']) && count($pd_section_data[16]['family_details']))
{
foreach ($pd_section_data[16]['family_details'] as $sectio16_key => $section16_value)
{
echo '<tr><td class="tdcenteralign" colspan="5">'.$section16_value['member_name'] .'</td>'.
'<td class="tdcenteralign" colspan="3">'.$section16_value['relationship']['name'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section16_value['stakeholder_relation'].'</td>'.
'<td class="tdcenteralign" colspan="3">'.$section16_value['company_relation']['name'].'</td>'.
// '<td class="tdcenteralign" colspan="2">'.( isset ($section5_value['previous_experience_details']) && $section5_value['previous_experience_details'] ? $section5_value['previous_experience_details'] : 'NA' ).'</td>'.
'<td class="tdcenteralign" colspan="2" style="text-align: center">'.$section16_value['started_biz'].'</td>'.
'</tr>';
}
}
else
{
echo '<tr><td colspan="15" class="tdcenteralign">No Other Family Members are involved in the Business.</td></tr>';
}
if(isset($pd_section_data[16]['common_remarks']) && !empty($pd_section_data[16]['common_remarks']))
{
echo '<tr><th class="tdcenteralign" colspan="5">Remarks</th><td class="tdcenteralign" colspan="10">'.$pd_section_data[16]['common_remarks'] .'</td>';
}
?>
</tbody></table>
<br>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="8">General Business Information</th>
</tr>
<!-- <?php print_r($pd_section_data[4]); ?> -->
<?php if(isset($pd_section_data[4]['business_entity']) && is_array($pd_section_data[4]['business_entity']) && count($pd_section_data[4]['business_entity'])) {
foreach ($pd_section_data[4]['business_entity'] as $key => $value) {
echo "<tr>".
"<th colspan='4' >Name of the Company</th>".
"<th colspan='4' >".$company[$value['company_name']]."</th>".
"</tr>";
echo "<tr>".
"<td colspan='4' >Business Entity Type</td>".
"<td colspan='4' >".$value['business_entity_type']."</td>".
"</tr>";
echo "<tr>".
"<td colspan='4' >Business Activity</td>".
"<td colspan='4' >".$value['select_business_activity_type']."</td>".
"</tr>";
echo "<tr>".
"<td colspan='4' >Area of Sale</td>".
"<td colspan='4' >".$value['area_of_sale']."</td>".
"</tr>";
}
} ?>
</tbody></table>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="10">Brief of the Business / Service</th>
</tr>
<tr>
<th colspan="3">Product/Service Name</th>
<th colspan="2">Contribution Business Product</th>
<th colspan="2">Name of the Company</th>
<th colspan="3">Remarks</th>
</tr>
<?php
// print_r($pd_section_data[6]);
if(isset($pd_section_data[6]))
{
foreach ($pd_section_data[6]['key_products_contribution'] as $section6_key => $section6_value)
{
// print_r($section6_value);
echo '<tr><td class="tdcenteralign" colspan="3">'.$section6_value['product_name'] .'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section6_value['contribution_business_product'].'%</td>'.
'<td class="tdcenteralign" colspan="2">'.$company[$section6_value['company_name']].'</td>'.
'<td class="tdcenteralign" colspan="3">'.$section6_value['remarks'].'</td>'.'</tr>';
// '<td class="tdcenteralign" colspan="2">'.$section5_value['total_work_exp'].'</td>'.
// '<td class="tdcenteralign" colspan="2">'.( isset ($section5_value['previous_experience_details']) && $section5_value['previous_experience_details'] ? $section5_value['previous_experience_details'] : 'NA' ).'</td>'.
// '<td class="tdcenteralign" colspan="2" style="text-align: center">'.$section5_value['started_biz'].'</td>'.
}
// if(isset($pd_section_data[6]['business_process']))
// {
// echo '<tr><th class="tdcenteralign" colspan="3">Remarks</th><td class="tdcenteralign" colspan="8">'.$pd_section_data[6]['business_process'] .'</td>';
// }
if(isset($pd_section_data[6]['common_remarks']) && !empty($pd_section_data[6]['common_remarks']))
{
echo '<tr><th class="tdcenteralign" colspan="3">Remarks</th><td class="tdcenteralign" colspan="7">'.$pd_section_data[6]['common_remarks'] .'</td>';
}
}
?>
</tbody></table>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<?php
echo '<tr><th class="thlargefont">Business Brief</th></tr><tr><td class="tdcenteralign">'.$pd_section_data[6]['business_process'] .'</td></tr>';?>
</tbody>
</table>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr><th class="thlargefont">Activity Observed during Visit (Yes / No)</th></tr>
<?php
$business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_remark']) && $pd_section_data[8]['business_pd_visited_remark'] != '' ? ( ' ( ' . $pd_section_data[8]['business_pd_visited_remark']. ' ) ' ) : 'Not Available');
?>
<tr><td class = "tdcenteralign"><?php echo (isset($pd_section_data[8]['business_is_pd_visited']) ? $pd_section_data[8]['business_is_pd_visited'].$business_pd_visited_remark : '')?> </td> </tr>
</tbody></table>
<br>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="12">Employee Strength</th>
</tr>
<tr>
<td colspan="4" >No of Employees as per person met</td>
<td colspan="4" >No fo Employees Sighted during the Visit</td>
<td colspan="4" >Approx Salary Paid per month (<?php echo $rupee_symbol?>)</td>
</tr>
<tr>
<td colspan="2" >Permanent >></td>
<td colspan="2" ><?php echo $pd_section_data[7]['permanant_employees_person_met'];?></td>
<td colspan="2" >Permanent >></td>
<td colspan="2" ><?php echo $pd_section_data[7]['permanant_employees_cm'];?></td><td colspan="2" >Permanent >></td>
<td colspan="2" ><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[7]['permanant_employees_salary']);?></td>
</tr>
<tr>
<td colspan="2" >Temporary >></td>
<td colspan="2" ><?php echo $pd_section_data[7]['temporary_employees_person_met'];?></td>
<td colspan="2" >Temporary >></td>
<td colspan="2" ><?php echo $pd_section_data[7]['temporary_employees_cm'];?></td><td colspan="2" >Temporary >></td>
<td colspan="2" ><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[7]['temporary_employees_salary']);?></td>
</tr>
<?php if($pd_section_data[7]['common_remarks']){?>
<tr>
<td colspan="2">Remark</td> <td class="tdcenteralign" colspan="10"><?php echo $pd_section_data[7]['common_remarks']?></th>
</tr>
<?php } ?>
</tbody>
</table>
<br>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="8">Seasonality of the Business</th>
</tr>
<?php if(isset($pd_section_data[4]['business_entity']) && is_array($pd_section_data[4]['business_entity']) && count($pd_section_data[4]['business_entity'])) {
foreach ($pd_section_data[4]['business_entity'] as $key => $value) {
$low_month = '';
if(isset($value['low_sale_month']) && is_array($value['low_sale_month']) && count($value['low_sale_month'])){foreach($value['low_sale_month'] as $low){ $low_month .= $low.' ,';}}
if($low_month != ''){$low_month = substr_replace($low_month, '', -1);}else{$low_month = '-';}
echo "<tr><th colspan='4' >Name of the Company</th><th colspan='4' >".$company[$value['company_name']]."</th></tr>";
echo "<tr><td colspan='4' >Business Seasonal (Yes / No)</td><td colspan='4' >".$value['seasonality']."</td></tr>";
echo "<tr><td colspan='4' >If Seasonal Please mention the Lean Months</td><td colspan='4' >".$low_month."</td></tr>";
if(isset($value['low_sale_month_reason'])){
echo "<tr><td colspan='4' >Reason</td><td colspan='4' >".$value['low_sale_month_reason']."</td></tr>";
}
}
}
?>
<?php if(isset($pd_section_data[4]['common_remarks']) && !empty($pd_section_data[4]['common_remarks']))
{
echo '<tr> <td class = "tdcenteralign" colspan="8">Remarks - '.$pd_section_data[4]['common_remarks'].' </td></tr>';
}?>
</tbody></table>
<?php if(isset($pd_section_data[8]['is_business_address']) && strtolower($pd_section_data[8]['is_business_address']) == 'yes'){ ?><!--
<table class="scorecard_table">
<tr><th class="thlargefont" colspan="2">Business Asset</th></tr>
<tr> <td>Business asset address</td><td class = "tdcenteralign"><?php echo $pd_section_data[8]['initiated_address']?></td> </tr>
<tr> <td>Business operating duration<br>in visited premises </td> <td class = "tdcenteralign"><?php echo ($pd_section_data[8]['business_years'].'Yr(s)'.(isset($pd_section_data[8]['business_months']) && $pd_section_data[8]['business_months'] != '' ? ' & ' . $pd_section_data[8]['business_months'] .'Mnt(s)': ''))?></td> </tr>
<?php
$business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_remark']) && $pd_section_data[8]['business_pd_visited_remark'] != '' ? ( '(' . $pd_section_data[8]['business_pd_visited_remark']. ' ) ' ) : '');
?>
<tr><td>Business activities seen </td> <td class = "tdcenteralign"><?php echo ($pd_section_data[8]['business_is_pd_visited'].$business_pd_visited_remark)?> </td> </tr>
<tr><td>Business ownership type </td> <td class = "tdcenteralign"><?php echo ($pd_section_data[8]['business_ownership_type'].( isset($pd_section_data[8]['business_monthly_rented_amt']) ? ( '(' . $rupee_symbol.''.MYUTIL::customIndianNumberFormat($pd_section_data[8]['business_monthly_rented_amt']) . ')' ) : '' ))?> </td> </tr>
<?php if( strtolower($pd_section_data[8]['business_ownership_type']) == 'owned'){?>
<tr><td>Asset approximate market value </td> <td class = "tdcenteralign"><?php echo $rupee_symbol.''.MYUTIL::customIndianNumberFormat($pd_section_data[8]['business_approximate_market_value'])?> </td> </tr>
<tr><td>Age of asset </td> <td class = "tdcenteralign"><?php echo $pd_section_data[8]['business_vintage'].' Yr(s) ( Purchased at ' .$pd_section_data[8]['business_purchase_year'].')'?> </td> </tr>
<tr><td>Owner(s) Name </td> <td class = "tdcenteralign"><?php $owners_name = applicantname_grabber::getMultipleApplicantsNameById($pd_section_data[8]['business_name_of_the_owner'],$applicant_details); echo $owners_name;?> </td> </tr>
<tr><td>Loan Existing against asset</td> <td class = "tdcenteralign"><?php echo ($pd_section_data[8]['business_emi'])?> </td> </tr>
<?php } ?>
</table> -->
<?php } ?>
<!-- <table class="scorecard_table">
</table -->
<div id="page_break"> </div>
<table class="scorecard_table">
<thead><tr><th class="thlargefont" colspan="11">Business Assets</th></tr>
<!-- </table>
<table class="scorecard_table"> -->
<?php if(isset($pd_section_data[8]['business_assets_details']) && is_array($pd_section_data[8]['business_assets_details']) && count($pd_section_data[8]['business_assets_details'])){?>
<tr> <th colspan="2">Asset Type</th> <th colspan="3">Asset Description</th> <th colspan="1">Asset Ownership</th> <th colspan="1">Owner's Name</th> <th colspan="1">Market Value</th> <th colspan="1">Age of the Asset (Yrs)</th> <th colspan="1">Loan Agst Asset (Yes/ No)</th><th colspan="1">Name of the Company</th> </tr>
</thead>
<tbody>
<?php //echo $pd_section_data[8]['display_data']['first_row']
//echo $pd_section_data[8]['display_data']['second_row']
//echo $pd_section_data[8]['display_data']['third_row']
//echo $pd_section_data[8]['display_data']['fourth_row']
//echo $pd_section_data[8]['display_data']['five_row']
//echo $pd_section_data[8]['display_data']['siz_row']
//echo $pd_section_data[8]['display_data']['seven_row']
$applicant_details = applicantname_grabber::getLatestApplicantsName($pd_master_details[0]['pd_id']);
$asset_type = array('2' => 'Property','3' => 'Vehicle','4' => 'Equipments and machinery','5' => 'Jewellery','6' => 'Life Insurance Policy','7' => 'Investments','1' => 'Others');
$address_type = array('2' => 'Clinic','3' => 'Factory','4' => 'Warehouse / Godown','5' => 'Shop','6' => 'Residence','7' => 'Residence cum Office','1' => 'Others','8' => 'Industrial Shed','9'=> 'Workshop','10'=> 'Business Centre','11'=> 'Shared Office','12'=> 'Office');
$vehicle_type = array('2' => 'Car/Jeep','3' => 'Truck/ Bus','4' => 'Rickshaw/Tempo','5' => 'Tractor','6' => 'Two Wheeler','1' => 'Others');
foreach ($pd_section_data[8]['business_assets_details'] as $asset_key => $b_asset)
{
$description = $b_asset['other_asset_description'];
if(isset($b_asset['property_type']))
{
if($b_asset['property_type'] == 1){ $description .= '('. $b_asset['property_type_others'] .')'; }
else{ $description .= '('. $address_type[ $b_asset['property_type'] ] .')'; }
}
if(isset($b_asset['vehicle_type']))
{
if($b_asset['vehicle_type'] == 1){ $description .= '('. $b_asset['vehicle_type_others'] .')'; }
else{$description .= '('. $vehicle_type[ $b_asset['vehicle_type'] ] .')';}
}
if(isset($b_asset['business_purchase_year']))
{
$description .= ' purchased at '.$b_asset['business_purchase_year'];
}
if(isset($b_asset['property_address']))
{
$description .= ' is in '. $b_asset['property_address'];
}
$business_ownership_type = $b_asset['business_ownership_type'] . (isset($b_asset['business_monthly_rented_amt']) ? ' ( '. $rupee_symbol .' '. MYUTIL::customIndianNumberFormat($b_asset['business_monthly_rented_amt']) .' ) ' : '');
$business_name_of_the_owner = (isset($b_asset['business_name_of_the_owner']) ? (applicantname_grabber::getMultipleApplicantsNameById($b_asset['business_name_of_the_owner'],$applicant_details)): 'NA');
echo '<tr> <td colspan="2">'.( $b_asset['business_assets_mode'] == 1 ? $b_asset['other_asset_description'] : $asset_type [ $b_asset['business_assets_mode'] ]).'</td> <td colspan="3"> '. $description .'</td> <td colspan="1">'. $business_ownership_type .'</td> <td colspan="1">'. $business_name_of_the_owner .'</td> <td colspan="1">'.(isset($b_asset['business_approximate_market_value']) ? ( $rupee_symbol .' '. MYUTIL::customIndianNumberFormat($b_asset['business_approximate_market_value'])) : 'NA').'</td> <td>'.(isset($b_asset['business_purchase_year']) ? $b_asset['business_purchase_year'] : 'NA').'</td><td colspan="1">'.(isset($b_asset['business_emi']) ? $b_asset['business_emi'] : 'NA').'</td><td colspan="1">'.(isset($b_asset['company_name']) ? $company[$b_asset['company_name']] : 'NA').'</td></tr>';
}
?>
<?php }else
{
echo '<tr> <td class = "tdcenteralign" colspan="11">There is no other business asset available</td> </tr>';
}
?>
<?php if(isset($pd_section_data[8]['common_remarks']) && !empty($pd_section_data[8]['common_remarks']))
{
//echo '<br><br><table class="scorecard_table"><tr> <td class = "tdcenteralign" colspan="1">Business Assets Remarks - '.$pd_section_data[8]['common_remarks'].' </td></tr></table>';
echo '<tr> <td class = "tdcenteralign" colspan="11">Business Assets Remarks - '.$pd_section_data[8]['common_remarks'].' </td></tr>';
}?>
</tbody>
</table>
<?php if(true){ ?>
<div id="page_break"></div>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="10" >Financial Information</th>
</tr>
<?php if(isset($pd_section_data[10]) && strtolower($pd_section_data[10]['financial_info_available']) == 'yes') { ?>
<tr>
<td colspan="6" >Name of the Company / Firm whose financials are noted </td>
<td class = "tdcenteralign" colspan="4" ><?php echo (isset($pd_section_data[10]['company_name'] ) ? ($company[$pd_section_data[10]['company_name']]) : (isset($applicant_details[0]['company_name']) && (strlen($applicant_details[0]['company_name']) != 0) ? $applicant_details[0]['company_name'] : $pd_master_details[0]['main_applicant'])) ?></td>
</tr>
</tbody></table>
<table class="scorecard_table"><tbody>
<tr>
<th colspan="7">Particulars of Financials as per books of Accounts</th>
<?php
// $sales_pd_created_date = date('Y-m-d',strtotime($master[0]['createdon']));
// $last_four_finyrs = MYUTIL::getFinYears($sales_pd_created_date,1);
// $ordered_finyrs_data = MYUTIL::reOrderFinYrsData($section5,$last_four_finyrs);
//print_r($section5);die();
// $totol = 0;
$pd_section_data[10]['financial_info'] = array_reverse($pd_section_data[10]['financial_info']);
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
// if(is_numeric($fy_key))
// {
// $totol++;
echo '<th colspan="1" >FY - '.($fy_value['fy']).'</th>';
// }
}
?>
</tr>
<tr>
<td colspan="7">Sales / Revenue (<?php echo $rupee_symbol?>) </td>
<?php
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
echo '<td colspan="1" class="tdcenteralign">'. $rupee_symbol.' '.MYUTIL::customIndianNumberFormat(($fy_value['sales_revenue'])).'</td>';
}
}
?>
</tr>
<tr>
<td colspan="7" >Net Profit / (Net Loss) (<?php echo $rupee_symbol?>) </td>
<?php
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
echo '<td colspan="1" class="tdcenteralign">'.($fy_value['net_profit'] != '' ? $rupee_symbol.' '. MYUTIL::customIndianNumberFormat($fy_value['net_profit']) : '-').'</td>';
}
}
?>
</tr>
<tr>
<td colspan="7" >Net Profit or (Net Loss) to Sales % </td>
<?php
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
// echo '<td colspan="1" class="tdcenteralign">'.round((($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 ),2).'%</td>';
echo '<td colspan="1" class="tdcenteralign">'.($fy_value['net_profit_sales_percent'] != '' ? $fy_value['net_profit_sales_percent'] : '-').'</td>';
}
}
?>
</tr>
<tr>
<td colspan="7" >% <?php echo '( '.$uparrow.'/'.$downarrow.' )'?> in Sales over PY </td>
<?php
// $pre_year_sales = 0;
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
// echo '<td colspan="1" class="tdcenteralign">'.($fy_value['sales_py']).'</td>';
if($fy_key == (count($pd_section_data[10]['financial_info']) - 1))
{
echo '<td colspan="1" class="tdcenteralign">NA</td>';
}
else
{
// //echo $pre_year_sales;
// $sales_over_py = round( ((($fy_value['sales_revenue'] - $pre_year_sales) / $pre_year_sales ) * 100),2);
$sales_over_py = $fy_value['sales_py'];
echo '<td colspan="1"class="tdcenteralign" >'. ((($sales_over_py == 0 ) ? $dash :( $sales_over_py > 0 ? $uparrow : $downarrow))).'' . abs($sales_over_py). ' %</td>';
}
// $pre_year_sales = $fy_value['sales_revenue'];
}
}
?>
</tr>
<tr>
<td colspan="7" >% <?php echo '( '.$uparrow.'/'.$downarrow.' )'?> in Net Profit over PY </td>
<?php
$pre_year_net_profit = 0;
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
if($fy_key == (count($pd_section_data[10]['financial_info']) - 1))
{
echo '<td colspan="1" class="tdcenteralign">NA</td>';
}
else
{
// $net_profit_over_py = round( ((($fy_value['net_profit'] - $pre_year_net_profit) / $pre_year_net_profit ) * 100),2);
$net_profit_over_py = $fy_value['netprofit_py'];
echo '<td colspan="1" class="tdcenteralign">'. ((($net_profit_over_py == 0 ) ? $dash :( $net_profit_over_py > 0 ? $uparrow : $downarrow))).' ' . abs($net_profit_over_py). '% </td>';
}
// $pre_year_net_profit = $fy_value['net_profit'];
}
}
?>
</tr>
<tr>
<td colspan="7" >% <?php echo '( '.$uparrow.'/'.$downarrow.' )'?> in Net Profit % over PY </td>
<?php
$pre_year_net_pro_loss_per = 0;
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
if($fy_key == (count($pd_section_data[10]['financial_info']) - 1))
{
echo '<td colspan="1" class="tdcenteralign">NA</td>';
}
else
{
// $year_net_pro_loss_per_over_py = round( ((( (($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 ) - $pre_year_net_pro_loss_per) / $pre_year_net_pro_loss_per ) * 100),2);
$year_net_pro_loss_per_over_py = $fy_value['netprofit_py_percent'];
echo '<td colspan="1" class="tdcenteralign">'. ((($year_net_pro_loss_per_over_py == 0 ) ? $dash :( $year_net_pro_loss_per_over_py > 0 ? $uparrow : $downarrow))).' ' . abs($year_net_pro_loss_per_over_py). '% </td>';
// // echo '<td colspan="1" >'. (($year_net_pro_loss_per_over_py > 0 )? '<span style="color:green;">↑</span>' : '<span style="color:red;">↓</span>').' ( ' . $year_net_pro_loss_per_over_py. ' )</td>'; //(($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 )
}
// $pre_year_net_pro_loss_per = (($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 );
}
}
?>
</tr>
<tr>
<td colspan="7">Debtor days </td>
<?php
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
echo '<td colspan="1" class="tdcenteralign">'.($fy_value['debtor_days_cet'] != '' ? number_format($fy_value['debtor_days_cet'],2,'.','') : '-') .'</td>';
}
}
?>
</tr>
<tr>
<td colspan="7">Creditor Days </td>
<?php
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
echo '<td colspan="1" class="tdcenteralign">'.($fy_value['creditor_days_cet'] != '' ? number_format($fy_value['creditor_days_cet'],2,'.','') : '-') .'</td>';
}
}
?>
</tr>
<tr>
<td colspan="7">Inventory days </td>
<?php
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
echo '<td colspan="1" class="tdcenteralign">'.( $fy_value['inventory_days_cet'] != '' ? number_format($fy_value['inventory_days_cet'],2,'.','') : '-') .'</td>';
}
}
?>
</tr>
</tbody></table>
<br>
<table class="scorecard_table">
<tr><th>Particulars of Financials for Latest Year as per person met during PD visit</th></tr>
</table>
<table class="scorecard_table">
<tbody>
<?php echo '<tr> <td>Sales / Revenue ('.$rupee_symbol.') </td><td class="tdcenteralign">'.(isset($pd_section_data[10]['sales_amount']) && $pd_section_data[10]['sales_amount'] != '' ? $rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[10]['sales_amount']) : '-') .'</td> </tr>'?>
<?php echo '<tr> <td>Net Profit or (Net Loss) to Sales % </td><td class="tdcenteralign">'. ( isset($pd_section_data[10]['net_profit_to_sales_percent']) && $pd_section_data[10]['net_profit_to_sales_percent'] != ''? $pd_section_data[10]['net_profit_to_sales_percent'] : '-').'</td> </tr>'?>
<?php echo '<tr> <td>Net Profit / (Net Loss) ('.$rupee_symbol.') </td><td class="tdcenteralign">'.(isset($pd_section_data[10]['net_profit_rs']) && $pd_section_data[10]['net_profit_rs'] != '' ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[10]['net_profit_rs']) : '-') .'</td> </tr>'?>
</tbody>
</table><br>
<table class="scorecard_table">
<tr><th colspan="12" >Working Capital Cycle (As per Person Met during PD)</th></tr>
<!-- </table>
<table class="scorecard_table">-->
<tbody>
<?php echo '<tr>
<td class="tdcenteralign" colspan="2">Debtor Days</td>
<td colspan="2" class="tdcenteralign">'.(isset($pd_section_data[10]['debtor_days_cm']) ? $pd_section_data[10]['debtor_days_cm'] : '-').'</td>'.
'<td colspan="2" class="tdcenteralign">Creditor Days</td>
<td colspan="2" class="tdcenteralign">'.( isset($pd_section_data[10]['creditor_days_cm']) ? $pd_section_data[10]['creditor_days_cm'] : '-').'</td>
<td colspan="2" class="tdcenteralign">Stock Days</td>
<td colspan="2" class="tdcenteralign">'.(isset($pd_section_data[10]['inventory_days_cm']) ? $pd_section_data[10]['inventory_days_cm'] : '-').'</td>
</tr>'?>
<?php echo '<tr> <td colspan="8" class="tdcenteralign">Does the business have any working capital facility from any lender other than Moneywise? (Yes / No)</td> <td colspan="4" class="tdcenteralign">'.(isset($pd_section_data[10]['is_any_other_working_captial_facility'] ) && $pd_section_data[10]['is_any_other_working_captial_facility'] != '' ? $pd_section_data[10]['is_any_other_working_captial_facility'] : '-').'</td></tr>'?>
<?php
if(isset($pd_section_data[10]['facility_details_specify']))
{
echo '<tr><td colspan="8" class="tdcenteralign">If Yes, then details of the same to be captured</td> <td colspan="4" class="tdcenteralign">'.(isset($pd_section_data[10]['facility_details_specify']) ? $pd_section_data[10]['facility_details_specify'] : '').'<br>('.(isset($pd_section_data[10]['facility_details_other']) ? $pd_section_data[10]['facility_details_other'] : $pd_section_data[10]['facility_details_other_lender']).')'.'</td></tr>';
}
?>
<?php echo '<tr> <td class="tdcenteralign" colspan="2">Broken Period starting from</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['broken_period_from_month'].'</td><td colspan="2" class="tdcenteralign">Broken Period starting to</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['broken_period_to_month'].'</td> <td colspan="2" class="tdcenteralign">No of Months</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['broken_period_no_of_months'].'</td> </tr>'?>
<?php echo '<tr> <td class="tdcenteralign" colspan="2">Turn Over for Broken Period in CY</td> <td colspan="2" class="tdcenteralign">'.$rupee_symbol.''. MYUTIL::customIndianNumberFormat($pd_section_data[10]['broken_period_turnover_cy']).'</td><td colspan="2" class="tdcenteralign">Turn Over for Broken Period in PY</td> <td colspan="2" class="tdcenteralign">'.$rupee_symbol.''.MYUTIL::customIndianNumberFormat($pd_section_data[10]['broken_period_turnover_py']).'</td> <td colspan="2" class="tdcenteralign">('.$uparrow.'/'. $downarrow.')in Turnover for Broken Period</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['broken_period_turnover_percent'].'%</td> </tr>'?>
<?php
}
else // if finance data not available . this condiiton opens at near by finace section heading
{
echo '<tr> <td class="tdcenteralign" colspan="12">Finance Data Not Available</td></tr>';
}
if(isset($pd_section_data[10]['common_remarks']) && !empty($pd_section_data[10]['common_remarks']))
{
echo '<tr> <td class="tdcenteralign" colspan="4">Remarks on Financials </td> <td colspan="8" class="tdcenteralign">'.$pd_section_data[10]['common_remarks'].'</td> </tr>';
}
?>
</tbody>
</table>
<?php } ?>
<div id="page_break"> </div>
<table class="scorecard_table">
<tr><th class="thlargefont">Supplier Details</th></tr>
</table>
<table class="scorecard_table">
<?php if(isset($pd_section_data[11]['supplier_details']) && is_array($pd_section_data[11]['supplier_details']) && count($pd_section_data[11]['supplier_details'])) { ?>
<thead>
<?php echo $pd_section_data[11]['display_data']['header_row']?>
</thead>
<tbody>
<?php echo $pd_section_data[11]['display_data']['first_row']?>
<?php echo $pd_section_data[11]['display_data']['second_row']?>
<?php echo $pd_section_data[11]['display_data']['third_row']?>
<?php echo $pd_section_data[11]['display_data']['fourth_row']?>
<?php echo $pd_section_data[11]['display_data']['five_row']?>
<?php echo $pd_section_data[11]['display_data']['siz_row']?>
<?php echo $pd_section_data[11]['display_data']['seven_row']?>
<?php echo $pd_section_data[11]['display_data']['eigth_row']?>
<?php echo $pd_section_data[11]['display_data']['ninth_row']?>
<?php }
else if(isset($pd_section_data[11]['supplier_not_available_reason']) && $pd_section_data[11]['supplier_not_available_reason'] != ''){
echo '<tr><td class="tdcenteralign" colspan='.(count($pd_section_data[11]['supplier_details']) + 1).'>Supplier Information Not available. Reason - '.$pd_section_data[11]['supplier_not_available_reason'] .'</td></tr>';}
else
{
echo '<tr><td class="tdcenteralign">Supplier Information Not available</td></tr>';
}
if(isset($pd_section_data[11]['common_remarks']) && !empty($pd_section_data[11]['common_remarks'])){
echo '<tr><td class="tdcenteralign" colspan='.(count($pd_section_data[11]['supplier_details']) + 1).' >Remarks - '.$pd_section_data[11]['common_remarks'] .'</td></tr>';}
?>
</tbody>
</table>
<br>
<table class="scorecard_table">
<tr><th class="thlargefont">Client Details</th></tr>
</table>
<table class="scorecard_table">
<?php if(isset($pd_section_data[12]['client_details']) && is_array($pd_section_data[12]['client_details']) && count($pd_section_data[12]['client_details'])) { ?>
<thead>
<?php echo $pd_section_data[12]['display_data']['header_row']?>
</thead>
<tbody>
<?php echo $pd_section_data[12]['display_data']['first_row']?>
<?php echo $pd_section_data[12]['display_data']['second_row']?>
<?php echo $pd_section_data[12]['display_data']['third_row']?>
<?php echo $pd_section_data[12]['display_data']['fourth_row']?>
<?php echo $pd_section_data[12]['display_data']['five_row']?>
<?php echo $pd_section_data[12]['display_data']['siz_row']?>
<?php echo $pd_section_data[12]['display_data']['seven_row']?>
<?php echo $pd_section_data[12]['display_data']['eight_row']?>
<?php echo $pd_section_data[12]['display_data']['ninth_row']?>
</tbody>
<?php }
else if(isset($pd_section_data[12]['client_not_available_reason']) && $pd_section_data[12]['client_not_available_reason'] != ''){
echo '<tr><td class="tdcenteralign">Client Information Not available. Reason - '.$pd_section_data[12]['client_not_available_reason'] .'</td></tr>';}
else
{
echo '<tr><td class="tdcenteralign">Client Information Not available</td></tr>';
}
if(isset($pd_section_data[12]['common_remarks']) && !empty($pd_section_data[12]['common_remarks'])){
echo '<tr><td class="tdcenteralign" colspan='.(count($pd_section_data[12]['client_details']) + 1).'>Remarks - '.$pd_section_data[12]['common_remarks'] .'</td></tr>';
}
?>
</table><br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="10">Details of Stock Sighted during the PD visit</th>
</tr>
<?php if(isset($pd_section_data[13]['stock_details']) && is_array($pd_section_data[13]['stock_details']) && count($pd_section_data[13]['stock_details']) ){?>
<tr>
<th colspan="1">Sr. No.</th>
<th colspan="1">Type of Stock (RM / FG)</th>
<th colspan="3">Stock Item</th>
<th colspan="2">Approx Stock Value (<?php echo $rupee_symbol?>)</th>
<th colspan="1">Approx Stock Quantity</th>
<th colspan="2">Name of the Company</th>
</tr>
<?php
foreach ($pd_section_data[13]['stock_details'] as $section13_key => $section13_value)
{
echo '<tr><td class="tdcenteralign" colspan="1">'.($section13_key + 1) .'</td>'.
// '<td class="tdcenteralign" colspan="2">'.$section13_value['provider_name'].'</td>'.
'<td class="tdcenteralign" colspan="1">'.$section13_value['stock_type'].'</td>'.
'<td class="tdcenteralign" colspan="3">'.$section13_value['provider_name'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.(isset($section13_value['estimated_stock_value']) ? $rupee_symbol.''.MYUTIL::customIndianNumberFormat($section13_value['estimated_stock_value']) : 'NA').'</td>'.
'<td class="tdcenteralign" colspan="1">'.(isset($section13_value['estimated_quantity']) ? $section13_value['estimated_quantity'].' '.$section13_value['estimated_uom'] : 'NA').'</td>'.
'<td class="tdcenteralign" colspan="2">'.(isset($section13_value['company_name']) ? $company[$section13_value['company_name']] : 'NA').'</td>'.'</tr>';
// '<td class="tdcenteralign" colspan="1">'.(isset($section13_value['company_name']) ? MYUTIL::getCompanyNameById($section13_value['company_name']) : 'NA').'</td>'.'</tr>';
}
if(isset($pd_section_data[13]['estimated_uom']))
{
echo '<tr><td class="tdcenteralign" colspan="5">Does stock sighted justify the business operations ? (Yes / No)</td>';
echo '<td class="tdcenteralign" colspan="5">'.( ucfirst($pd_section_data[13]['estimated_uom']) ) .'</td></tr>';
}
}
else if(isset($pd_section_data[13]['stock_not_available_reason']) && $pd_section_data[13]['stock_not_available_reason'] != '')
{
echo '<tr><td class="tdcenteralign" colspan="10">Stock Information Not available. Reason - '.$pd_section_data[13]['stock_not_available_reason'] .'</td></tr>';
}
else
{
echo '<tr><td class="tdcenteralign" colspan="10">Stock Information Not available.</td></tr>';
}
if(isset($pd_section_data[13]['common_remarks']) && !empty($pd_section_data[13]['common_remarks'])){
echo '<tr><td class="tdcenteralign" colspan="10">Remarks - '.$pd_section_data[13]['common_remarks'] .'</td></tr>';}
?>
</tbody></table>
<div id="page_break"> </div>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="8">Future Plans & Business Environment</th>
</tr>
<tr><td colspan="4">USP of the business (How applicants business is different from others in the business)</td><td colspan="4"><?php echo $pd_section_data[14]['usp_of_business'];?></td></tr>
<tr><td colspan="4">Future plan for business expansion</td><td colspan="4"><?php echo $pd_section_data[14]['future_business_expansion'];?></td></tr>
<tr><td colspan="4">Key competitors in the business</td><td colspan="4"><?php echo $pd_section_data[14]['key_competitors'];?></td></tr>
<tr><td colspan="4">Succession Plan for business</td><td colspan="4"><?php echo $pd_section_data[14]['sucession_plan'];?></td></tr>
<tr><td colspan="4">Brief of other group concerns/
Business run by the applicant</td><td colspan="4"><?php echo $pd_section_data[14]['other_group_business_applicants'];?></td></tr>
<?php
if(isset($pd_section_data[14]['common_remarks']) && !empty($pd_section_data[14]['common_remarks']))
{
echo '<tr><td colspan="4">Remarks</td><td colspan="4">'.$pd_section_data[14]['common_remarks'].'</td></tr>';
}
?>
</tbody></table>
<br>
<?php if(true){ ?>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="8">Business Banking & Personal Banking</th>
</tr>
<?php if(isset($pd_section_data[9]['banking_details']) && count($pd_section_data[9]['banking_details']) && ($pd_section_data[9]['banking_details'][0]['applicant_name'] != '' && $pd_section_data[9]['banking_details'][0]['bank_name'] != '') ){?>
<tr>
<th colspan="1">Sr. No.</th>
<th colspan="2">Account Holder's Name</th>
<th colspan="3">Bank Name</th>
<th colspan="1">Account Type</th>
<th colspan="1">OD / CC Limit</th>
<!-- <th colspan="1">Vintage</th> -->
</tr>
<?php
if(isset($pd_section_data[9]))
{
foreach ($pd_section_data[9]['banking_details'] as $section9_key => $section9_value)
{
// $vintage = $section9_value['vintage_year'].'Yr(s)';
// $vintage .= (isset($section9_value['vintage_month']) && $section9_value['vintage_month'] != 0 ? (' & '.$section9_value['vintage_month'].'Mt(s)') : '');
echo '<tr><td class="tdcenteralign" colspan="1">'.($section9_key + 1) .'</td>'.
// '<td class="tdcenteralign" colspan="2">'.$section13_value['provider_name'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section9_value['applicant_name'].'</td>'.
'<td class="tdcenteralign" colspan="3">'.(isset($section9_value['bank_name']) ? $section9_value['bank_name'] : 'NA').'</td>'.
'<td class="tdcenteralign" colspan="1">'.(isset($section9_value['account_type']) ? $section9_value['account_type'] : 'NA').'</td>'.
// '<td class="tdcenteralign" colspan="1">'.(isset($section14_value['estimated_quantity']) ? $section14_value['estimated_quantity'].' '.$section14_value['estimated_uom'] : 'NA').'</td>'.
'<td class="tdcenteralign" colspan="1">'.(isset($section9_value['cc_limit']) ? ($rupee_symbol.''.MYUTIL::customIndianNumberFormat($section9_value['cc_limit'])) : '-').'</td>'.'</tr>';
}
// if(isset($pd_section_data[13]['estimated_uom']))
// {
// echo '<tr><td class="tdcenteralign" colspan="4">Does stock sighted justify the business operations ? (Yes / No)</td>';
// echo '<td class="tdcenteralign" colspan="4">'.( ucfirst($pd_section_data[13]['estimated_uom']) ) .'</td></tr>';
// }
}
echo '<tr><td colspan="3" >Remarks</td><td class = "tdcenteralign" colspan="5">'.$pd_section_data[9]['common_remarks'].'</td></tr>';
}
else//if no count
{
echo '<tr><td class="tdcenteralign" colspan="8"> Banking Details Not Available</td>';
}
?>
</tbody></table>
<?php } ?>
<br>
<!-- <table class="scorecard_table">
<tr><th class="thlargefont" colspan="<?php echo (count($pd_section_data[15]['existing_loan_details']) + 1 )?>">Existing Loan Obligations</th></tr>
</table>
<br>
<table class="scorecard_table">
<thead>
<?php echo $pd_section_data[15]['display_data']['header_row']?>
</thead>
<tbody>
<?php echo $pd_section_data[15]['display_data']['first_row']?>
<?php echo $pd_section_data[15]['display_data']['second_row']?>
<?php echo $pd_section_data[15]['display_data']['third_row']?>
<?php echo $pd_section_data[15]['display_data']['fourth_row']?>
<?php echo $pd_section_data[15]['display_data']['five_row']?>
<?php echo $pd_section_data[15]['display_data']['install_fre_row']?>
<?php echo $pd_section_data[15]['display_data']['siz_row']?>
<?php echo $pd_section_data[15]['display_data']['seven_row']?>
<?php echo $pd_section_data[15]['display_data']['eight_row']?>
</tbody>
</table> -->
<!-- <table class="scorecard_table">
<tr>
<th>Existing Loan Obligations</th>
</tr>
< /table>-->
<?php if(true){ ?>
<div id="page_break"> </div>
<table class="scorecard_table table_loan">
<thead>
<tr>
<th colspan="10" class="thlargefont">Existing Loan Obligations</th>
</tr>
<?php if(isset($pd_section_data[15]['existing_loan_details']) && count($pd_section_data[15]['existing_loan_details']) && ($pd_section_data[15]['existing_loan_details'][0]['loan_type'] != '' && $pd_section_data[15]['existing_loan_details'][0]['loan_amount'] != '')){?>
<tr>
<th colspan="1">Sr. No.</th>
<th colspan="1">Loan<br>Type</th>
<th colspan="1">Loan Amount </th>
<th colspan="1">Availed From </th>
<th colspan="1">Borrower`s Name </th>
<th colspan="1">Instalment Amount (<?php echo $rupee_symbol?>) </th>
<th colspan="1">Instalment Frequency (<?php echo $rupee_symbol?>) </th>
<th colspan="1">Original Tenure (Mnts) </th>
<th colspan="1">Elapsed Tenure (Mnts) </th>
<th colspan="1">Balance Tenure (Mnts)</th>
<!-- <th colspan="1">Vintage</th> -->
</tr>
</thead>
<tbody>
<?php
foreach ($pd_section_data[15]['existing_loan_details'] as $key15 => $value15)
{
echo '<tr><td class="tdcenteralign">'. ($key15 + 1) .'</td><td>'. $value15['loan_type'] .'</td><td>'.$rupee_symbol.MYUTIL::customIndianNumberFormat($value15['loan_amount']).'</td><td class="tdcenteralign">'.($value15['lender_name'] != '' ? $value15['lender_name'] : 'NA').'</td><td>'.$value15['loan_taken_by'].'</td><td class="tdcenteralign">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($value15['instalment_amount']).'</td><td class="tdcenteralign">'.$value15['instalment_frequency'].'</td><td class="tdcenteralign">'.($value15['original_tenure_months'] != '' ? $value15['original_tenure_months'] : 'NA').'</td><td class="tdcenteralign">'.($value15['current_tenure_months'] != '' ? $value15['current_tenure_months'] : 'NA').'</td><td class="tdcenteralign">'.($value15['elapsed_tenure_months'] != '' ? $value15['elapsed_tenure_months'] : 'NA') .'</td></tr>';
}
}
else// if no count
{
echo '<tr> <td colspan="10" class="tdcenteralign"> Existing Loan Obligations Not Available</td> </tr>';
}
if(isset($pd_section_data[15]['common_remarks']) && $pd_section_data[15]['common_remarks'])
{
echo '<tr> <td colspan="2">Remarks</td> <td class="tdcenteralign"colspan="8">'. $pd_section_data[15]['common_remarks'] .'</td> </tr>';
}
?>
</tbody>
</table>
<?php } ?>
<div id="page_break"> </div>
<!-- <table class="scorecard_table">
<tr><th class="thlargefont">Neighbourhood Check Details</th></tr>
</table>
<table class="scorecard_table"> -->
<!-- <thead>
<?php //echo $pd_section_data[12]['display_data']['header_row']?>
</thead> -->
<!-- <tbody> -->
<?php //echo $pd_section_data[17]['display_data']['first_row']?>
<?php //echo $pd_section_data[17]['display_data']['second_row']?>
<?php //echo $pd_section_data[17]['display_data']['third_row']?>
<?php //echo $pd_section_data[17]['display_data']['owner_row']?>
<?php //echo $pd_section_data[17]['display_data']['five_row']?>
<?php //if($pd_section_data[17]['neighbourhood_remarks']) { echo $pd_section_data[17]['display_data']['fourth_row']; }?>
<!-- <?php //echo $pd_section_data[17]['display_data']['siz_row']?>
<?php //echo $pd_section_data[17]['display_data']['seven_row']?> -->
<!-- </tbody> -->
<!-- </table> -->
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="2">Credit Manager Specific Queries</th>
</tr>
<?php
if(isset($pd_section_data[18]) && (count($pd_section_data[18]['cm_queries']) && $pd_section_data[18]['cm_queries'][0]['question'] != ''))
{
echo '<tr><th colspan="1">Question</th><th colspan="1">Answer</th></tr>';
foreach ($pd_section_data[18]['cm_queries'] as $section18_key => $section18_value)
{
echo '<tr><td class="tdcenteralign" colspan="1">'.$section18_value['question'] .'</td>'.
// '<td class="tdcenteralign" colspan="2">'.$section13_value['provider_name'].'</td>'.
'<td class="tdcenteralign" colspan="1">'.$section18_value['answer'].'</td>'.'</tr>';
}
}
else
{
echo '<tr><td colspan="2" class="tdcenteralign">There are no credit manager queires</td></tr>';
}
if(isset($pd_section_data[18]['common_remarks']) && !empty($pd_section_data[18]['common_remarks']))
{
echo '<tr><td colspan="2" class="tdcenteralign">Remarks - '.$pd_section_data[18]['common_remarks'].'</td></tr>';
}
?>
</tbody></table>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="8">Final Remarks of PD officer</th>
</tr>
<?php
$customer_behaviour = array('1' => 'Others','2' => 'Rude','3' => 'Polite');
$over_all = array('1' => 'Others','2' => 'Positive','3' => 'Negative','4' => 'Refer to Credit');
?>
<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">Suitability of Business Location
[Well Suited / Fairly Suited / Not Suited]</td><td colspan="4"><?php echo $pd_section_data[19]['business_location_suited'];?></td></tr>
<tr><td colspan="4">PD Officer's overall assessment
[Positive / Negative / Refer to Credit / Others (Please specify)]</td><td colspan="4"><?php echo isset($pd_section_data[19]['pd_officer_recommendation_other']) ? $pd_section_data[19]['pd_officer_recommendation_other'] : $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>'; }
if($pd_section_data[19]['pd_officer_recommendation'] != '1'){
?>
<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>';
}?>
</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' => 'Machinery Image','additional_photograph'=>'Additional Photographs','property_images'=>'Property 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" >Employee ID </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['smc_emp_code']?></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>
<?php if($report_attachments){
echo $report_attachments;
}
?>
</body>
</html>