sparqapi/api/application/views/report_templates/JSONTOREPORT_CLIX.php
2019-12-27 18:12:24 +05:30

4810 lines
202 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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');
?><!DOCTYPE html>
<html lang="en" id="mydoc" onkeyup="saveEdits(event)">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link href="https://fonts.googleapis.com/css?family=Merriweather" rel="stylesheet">
<style type="text/css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
.page_break { page-break-before: always; }
#page_break { page-break-before: always; }
/*.page { width: 100%; height: 95%; }*/
@page {
margin: 100px 50px;
/*font-family:Helvetica,Arial;*/
font-family:Merriweather;
}
header {
position: fixed;
top: -70px;
left: 0px;
right: 0px;
height: 20px;
/** Extra personal styles **/
/*background-color: #03a9f4;
color: white;*/
text-align: right;
/*line-height: 35px;*/
}
footer {
position: fixed;
bottom: 5px;
left: 0px;
right: 0px;
height: 20px;
font-size: 10px;
/** Extra personal styles **/
/*background-color: #03a9f4;
color: white;*/
text-align: left;
/*line-height: 35px;*/
}
.non-editable{ background-color:#99ff99; }
.table2 {
border: 1px solid black;
width: 100%;
}
.table2 td {
border: 1px solid black;
height: 50px;
text-align: center;
}
.table2 th {
border: 1px solid black;
height: 50px;
text-align: center;
}
.table2 {
border-collapse: collapse;
}
tfoot{
color:#e00201;
}
.simpletable, .simpletable th, .simpletable td {
border: 1px solid black;
border-collapse: collapse;
}
/* ######### Mini Score Card Table Styles######### */
.mini_scorecard_table {
width: 100%;
page-break-inside: avoid;
}
.mini_scorecard_table td, .mini_scorecard_table th {
page-break-inside: avoid;
}
.mini_scorecard_table th {
padding-top: 5px;
padding-bottom: 5px;
text-align: center;
background-color: #0191ed;
color: white;page-break-inside: avoid;
}
/* #########End of Mini Score Card Table Styles######### */
/* #########Score Card for personal assest section table getting overlapped ######### */
.scorecard_table_resonal_assest {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: 100%;
}
.scorecard_table_resonal_assest td, .scorecard_table_resonal_assest th {
border: 1px solid #000;
padding: 8px;
}
.scorecard_table_resonal_assest tr:nth-child(even){background-color: #f2f2f2; }
.scorecard_table_resonal_assest tr:hover {background-color: #ddd;}
.scorecard_table_resonal_assest th {
padding-top: 8px;
padding-bottom: 8px;
text-align: center;
background-color: #0191ed;
color: white;
}
/* #########End of Score Card Table Styles######### */
/* #########End of Mini Score Card Div Styles######### */
#rcorners_green {
background: #33cc33;
padding: 3px;
width: 75px;
height: 5px;
}
#rcorners_red {
background: red;
padding: 3px;
width: 75px;
height: 5px;
}
#rcorners_light_green {
background: #99ff66;
padding: 3px;
width: 75px;
height: 5px;
}
#rcorners_amber{
background: #ff9900;
padding: 3px;
width: 75px;
height: 5px;
}
/* #########End of Mini Score Card DIv Styles######### */
/* #########Score Card Table Styles######### */
.scorecard_table {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: 100%;
page-break-inside: avoid;
}
.scorecard_table td, .scorecard_table th {
border: 1px solid #000;
padding: 8px;
page-break-inside: avoid;
}
.scorecard_table tr:nth-child(even){background-color: #f2f2f2;page-break-inside: avoid; }
.scorecard_table tr:hover {background-color: #ddd;}
.scorecard_table th {
padding-top: 8px;
padding-bottom: 8px;
text-align: center;
background-color: #0191ed;
color: white;page-break-inside: avoid;
}
/* #########End of Score Card Table Styles######### */
/* #########Score Card2 Table Styles######### */
.scorecard_table2 {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: 100%;
}
.scorecard_table2 td, .scorecard_table2 th {
border: 1px solid #000;
padding: 8px;
}
.scorecard_table2 tr:nth-child(even){background-color: #f2f2f2;}
.scorecard_table2 tr:hover {background-color: #ddd;}
.scorecard_table2 th {
padding-top: 8px;
padding-bottom: 8px;
text-align: center;
background-color: #0191ed;
color: white;
}
/* #########End of Score Card2 Table Styles######### */
.customth { width: 10%; }
/* #########billwise Table Styles######### */
.customtd { text-align:center; }
.customtd_leftalign { text-align:left; }
.customtd_rightalign { text-align:right; }
.billwise_table {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: auto;
}
.billwise_table td, .billwise_table th {
border: 1px solid #000;
padding: 4px;
}
.billwise_table tr:nth-child(even){background-color: #f2f2f2;}
.billwise_table tr:hover {background-color: #ddd;}
.billwise_table th {
padding-top: 4px;
padding-bottom: 4px;
text-align: center;
background-color: #0191ed;
color: white;
}
/* #########billwise Table Styles######### */
/* #########Annexure table ######### */
.annexure_table {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: auto;
}
.annexure_table td, .annexure_table th {
border: 1px solid #000;
}
.annexure_table tr:nth-child(even){background-color: #f2f2f2;}
.annexure_table tr:hover {background-color: #ddd;}
.annexure_table th {
/*padding-top: 4px;*/
/*padding-bottom: 4px;*/
text-align: center;
background-color: #0191ed;
color: white;
}
/* #########Annexure######### */
.customtd { text-align:center; }
.customtd_leftalign { text-align:left; }
.customtd_rightalign { text-align:right; }
#boxstyle1 {
box-sizing: border-box;
width: 60px;
height: 20px;
padding: 5px;
border: 2px outset black;
}
#boxstyle2 {
box-sizing: border-box;
width: 200px;
height: 20px;
padding: 5px;
border: 2px outset black;
text-align:center;
}
#boxstyle3 {
box-sizing: border-box;
width: 120px;
height: 20px;
padding: 5px;
border: 2px outset black;
}
#billwise {
box-sizing: content-box;
/*disply:inline;*/
width: 100%;
height: auto;
padding: 10px;
border: 1px solid #0191ed;
}
#first_div {
width: 150px;
height: 25px;
border: 2px outset #000;
overflow: hidden;
text-align: center;
border-color:red;
color:red;
/*padding-left: 20px;*/
}
#tick_div {
position: relative;
width: 40px;
height: 25px;
margin-left: 100%;
margin-top: -29px;
border: 2px outset #000;
text-align: center;
border-color:red;
color:red;
}
#tick_div_other {
position: relative;
width: 40px;
height: 25px;
margin-left: 93%;
margin-top: -29px;
border: 2px outset #000;
text-align: center;
border-color:red;
color:red;
}
/* #########Person met card css######### */
.chip {
padding: 0 25px;
height: 100px;
width: 600px;
font-size: 14px;
border-radius: 50px;
background-color: #f1f1f1;
}
.chip #img1 {
float: left;
margin: 0 10px 0 -25px;
height: 100px;
width: 100px;
border-radius: 50%;
}
.chip #img2 {
float: right;
margin: 0 -25px 0px -125px;
height: 100px;
width: 100px;
border-radius: 50%;
}
/* #########Person met card css######### */
/* #########Doc sighted gallary css######### ;*/
.gallery {
margin: 5px;
border: 1px solid #ccc;
width: 100%;
}
.gallery:hover {
border: 1px solid #777;
}
.desc {
padding: 8px;
text-align: center;
color:green
}
/* #########Doc sighted gallary css######### */
/* ######### TOOLTIP CSS START ######### */
.tooltip {
position: relative;
display: inline;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: black;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
/* Position the tooltip */
position: absolute;
z-index: 1;
}
.tooltip:hover .tooltiptext {
visibility: visible;
}
#ini_table{
table-layout: fixed;
width:80%;
}
#ini_table td{
word-wrap:break-word
width:50%;
}
.intelligence{
/*background-color: lightgrey;*/
width: auto;
border: 5px solid #0191ed;
padding: 5px;
/*margin: 10px;*/
}
/* ######### TOOLTIP CSS END ######### */
</style>
<script type="text/javascript">
function saveEdits(e)
{
var editElem = document.getElementById("mydoc");
var userVersion = editElem.innerHTML;
//localStorage.removeItem('userEdits')
//save the content to local storage
localStorage.userEdits = userVersion;
}
</script>
</head>
<body style="font-family:Merriweather;font-size:12px;margin:15px 30px">
<footer>
<hr>
Powered by PDGenie
</footer>
<header>
<div><img style="width:50px;height:50px;opacity: 0.5;" src='https://pdgenie.com/logo/sineedge_red.png'/></div>
<hr>
</header>
<!-- Wrap the content of your PDF inside a main tag -->
<?php $loan_form = json_decode($pd_processed_forms[10][0]['processed_json'],true);
$main_applicant_name = $pd_master_details[0]['title_name'].' '.$pd_master_details[0]['main_applicant'];
$rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>";
$general_form = json_decode($pd_processed_forms[18][0]['processed_json'],true);
?>
<?php
echo "<br><br>";
echo "<div>";
echo "<h1><center>PERSONAL DISCUSSION REPORT </center></h1> ";
echo "<center style='font-size:15px;font-style:italic;font-weight:bold'>for the case of</center>";
echo "<h2><center>".$general_form['companies'][0]['company_name']."</center></h2>";
echo "</div>";
echo "<br><br><br><br>";
?>
<table align="center" id="ini_table" border="0">
<tbody>
<?php
echo '<tr><td>PD Initiated Date </td> <td style="width:2%;">:</td> <td> '.$pd_master_details[0]['createdon'].'</td></tr>';
echo '<tr><td>PD Visit Date </td> <td style="width:2%;">:</td> <td> '.$pd_master_details[0]['pd_visit_date'].'</td></tr>';
echo '<tr><td>PD Report Date </td> <td style="width:2%;">:</td> <td>'.$pd_master_details[0]['pd_report_generated_date'].'</td></tr>';
echo '<tr><td>PD Initiated by </td> <td style="width:2%;">:</td> <td>'.$pd_master_details[0]['branch_name'].' Branch</td></tr>';
echo '<tr><td>Loan Application ID </td> <td style="width:2%;">:</td> <td> '.$pd_master_details[0]['lender_applicant_id'].'</td></tr>';
echo '<tr><td>Product </td> <td style="width:2%;">:</td> <td>'.$pd_master_details[0]['product_name'].'</td></tr>';
echo '<tr><td>Customer Segment </td> <td style="width:2%;">:</td> <td>'.(explode('-',$pd_master_details[0]['customer_segment_name'])[0]).'</td></tr>';
?>
<?php
//echo "<p>Loan Amount Applied For : </p>";
//echo '<table align="center">
echo '<tr> <td >Loan Amount<br>(As Per PD Initiation) </td> <td style="width:2%;">:</td> <td><span style="font-family: DejaVu Sans; sans-serif;font-size:10px">₹</span>' .' '. MYUTIL::customIndianNumberFormat($pd_master_details[0]['loan_amount']). '<br><span style="font-size:10px;">('. MYUTIL::numtowords($pd_master_details[0]['loan_amount']) .')</span></td> </tr><tr> <td>Loan Amount<br>(As Per Loan Applicants during PD)</td> <td style="width:2%;">:</td> <td><span style="font-family: DejaVu Sans; sans-serif;font-size:10px;word-wrap:break-word">₹</span>' .' '. MYUTIL::customIndianNumberFormat($loan_form['loan_amount']). '<br><span style="font-size:10px;">('. MYUTIL::numtowords($loan_form['loan_amount']) .')</span></td> </tr>';
// $front_page_business_names = '';
// if(isset($general_form['companies']) && count($general_form['companies']))
// {
// foreach ($general_form['companies'] as $comp_key => $ind_company) {
// $front_page_business_names .= $ind_company['company_name'] .',';
// }
// }
// $front_page_business_names = substr_replace($front_page_business_names,'',-1);
// $front_page_business_names = strripos($front_page_business_names, ',') ? substr_replace($front_page_business_names,'and',strripos($front_page_business_names, ','),1 ) : $front_page_business_names;
// echo '<tr><td>Business Name(s) </td> <td style="width:2%;">:</td> <td>'.($front_page_business_names).'</td></tr>';
echo '</tbody></table>';
//echo "<div class='page_break'></div>";
echo "<br><br>";
echo "<br><br>";
echo "<br><br>";
echo "<br><br>";
echo "<br><br>";
echo "<p></p>";
if(isset($lender_disclaimer[0]['disclaimer']) && $lender_disclaimer[0]['disclaimer'] != '')
{
echo '<p align="justify"><i><strong>Disclaimer: </strong>'. $lender_disclaimer[0]['disclaimer'] .'</i></p>';
}
echo '<p align="justify"><i><strong>Registered / Corporate Office:</strong> SineEdge Consulting Private Limited. A-211, Pioneer Urban Square, Golf Course Extension Road, Sector 62, Gurgaon, Haryana - 122002</i></p>';
?>
<!-- GENERAL INFORMATIN -->
<?php
$total_no_of_business = count($general_form['companies']);
$persons_met = "Default";
$all_company_details = null;
if(array_key_exists('companies',$general_form))
{
$all_company_details = $general_form['companies'];
}
$all_applicant_details = $applicants_details;
?>
<!--<p>Person(s) Met: </p>
<table class="simpletable">
<tbody>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <tr><td> --><?php
//print_r($pd_images[18]);
$person_met_data = array();
foreach($general_form['individuals'] as $ind_key => $individual)
{
//print_r($individual);die();
if($individual['is_person_met'] == true)
{
//array_push($person_met_images);
$temp_person_met = array();
$applicant_name = $individual['applicant_name'];
//$applicant_name = array_key_exists('pd_co_applicant_id_master',$individual) ? $individual['pd_co_applicant_id_master'] : "Not Available" ;
//echo '<br>'.$individual['applicant_title_name_master'] .' '. $applicant_name.'<br>' ;
$temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name;
$temp_person_met['photo'] = '';
$temp_person_met['id_proof'] = '';
foreach($pd_images[18] as $pm_Key => $pm_value)
{
//echo $applicant_name.'-'.$pm_value['pd_document_title'];
if( !strcasecmp(trim($applicant_name),trim($pm_value['pd_document_title'])) )
{
$temp_person_met['photo'] = $pm_value['doc_url'] ;
}
$id = trim($applicant_name).'-id_proof';
if(!strcasecmp($id,trim($pm_value['pd_document_title'])))
{
$temp_person_met['id_proof'] = $pm_value['doc_url'] ;
}
}
$company_relationship_data = null;
foreach($general_form['company_with_relationships'] as $company_with_relationship)
{
if($individual['pd_co_applicant_id'] == $company_with_relationship['applicant_name'])
{
//FInd Company Name from JSON
$company_relationship_data .= $company_with_relationship['company_relationship_master'].' '.$company_with_relationship['company_name'];
//$company_relationship_data.='<br><center>and</center><br>';
$company_relationship_data.=', ';
}
}
//$temp_person_met['name'] =
//print_r($general_form['persons_with_relationships']);
$personal_relationship_data = null;
foreach($general_form['persons_with_relationships'] as $persons_with_relationship)
{
if($individual['pd_co_applicant_id'] == $persons_with_relationship['pd_co_applicant_id'] && isset($persons_with_relationship['relationship']))
{
if(isset($persons_with_relationship['relation_to_master']))
{
//? $persons_with_relationship['relation_to_master'] : " Could Not Find";
$RSNA = $persons_with_relationship['relation_to_master'];
if(isset($persons_with_relationship['relationship_master']))
{
$personal_relationship_data .= $persons_with_relationship['relationship_master'] .' Of '. $RSNA;
//$personal_relationship_data.='<br><center>and</center><br>';
$personal_relationship_data.=', ';
}
}
}
}
$company_relationship_data .= $personal_relationship_data;
$temp_person_met['relations'] = $company_relationship_data;
array_push($person_met_data,$temp_person_met);
}
}
//print_r($person_met_data);die();
echo '<div id="page_break"></div>';
echo '<p><strong>Person(s) Met:</strong> </p>';
echo '<div style="border: 1px solid #0191ed;">';
foreach($person_met_data as $pk => $person)
{
$display_for_person_met =$person['relations'] != "" ? substr_replace($person['relations'],'.',strrpos($person['relations'],','),1) : '';
$person_met_details = $person['name'];
if( strcasecmp($pd_master_details[0]['customer_segment_abbr'],'SEP_INDV'))
{
$person_met_details .= ($display_for_person_met != "" ? ' - ' . $display_for_person_met :'');
}
echo '<p>'.$person_met_details.'</p>';
//if($display_for_person_met != "" || $display_for_person_met != null){
echo '<br><br>';
//}
if($person['photo'])
{
echo '<img src="'.$person['photo'].'" width="300" height="200" alt=""/>';
}
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
if($person['id_proof'])
{
echo '<img src="'.$person['id_proof'].'" width="300" height="200" alt=""/>';
}
//echo count($person_met_data) != ($pk+1)? '<hr>':'';
}
echo '</div>';
echo '<br>';
?>
<br>
<p contenteditable="true"><b>Loan Applicants:</b></p>
<table class="scorecard_table">
<tr> <th>Name</th> <th>Age<br>(Yrs/Mns)</th> <th>Qualification / Type of Entity</th> <th>Relationships</th> </tr>
<tbody>
<?php
//print_r($general_form);die();
if(isset($general_form['companies']) && count($general_form['companies']))
{
$business_entity_type_master = array(1 => 'Others', 2 => 'Public Ltd Company', 3 => 'Sole proprietorship', 4 => 'HUF (Hindu Undivided Family)', 5 => 'Partnership',6 => 'Cooperative',7 => 'Limited Liability Partnership(LLP)',8 => 'OPC (One Person Company)',9 => 'Society',10 => 'Trust',11 => 'Private Limited Company');
foreach ($general_form['companies'] as $comp_key => $ind_company) {
if($ind_company['is_company_applicant'] != null)
{
echo '<tr><td class="customtd">'. $ind_company['company_name'] .'</td><td class="customtd">'. $ind_company['business_years']. (isset($ind_company['business_month']) ? ' . ' . $ind_company['business_month']: null) .'</td><td class="customtd">'. ( $ind_company['business_entity_type'] == 1 ? $ind_company['business_entity_type_other'] : $business_entity_type_master[ $ind_company['business_entity_type'] ] ).'</td><td class="customtd"> Not Applicable </td></tr>';
}
}
}
//print_r($general_form['individuals']) ;die();
foreach($general_form['individuals'] as $ind_key => $individual)
{
if($individual['is_applicant'] == true)
{
$education_qualification = $individual['qualification_master'];
$education_qualification = $individual['course_name'] != "" || $individual['course_name'] != null ? $education_qualification.'<br>('.$individual['course_name'].')' : $education_qualification;
$applicant_name = array_key_exists('pd_co_applicant_id_master',$individual) ? $individual['pd_co_applicant_id_master'] : " Could Not Find" ;
//echo $applicant_name.'**************************';
$title = isset($individual['applicant_title_name_master']) && $individual['applicant_title_name_master'] != "" ? $individual['applicant_title_name_master'] : '';
$applicant_name = $title.' '.$applicant_name;
if($ind_key == 0 && array_key_exists('is_kyc', $general_form) && $general_form['is_kyc'] == 'no')
{
$applicant_name = 'As per the request received applicant name is '.$applicant_name.'<br> but as per KYC name is '.$general_form['kyc_and_captur_the_name'];
//$kyc_data = "<br><br>Name noticed as per KYC is ". $general_form['kyc_and_captur_the_name'];
}
echo '<tr><td class="customtd">'.$applicant_name.'</td><td class="customtd">'.$individual['age'].'</td><td class="customtd">'.$education_qualification.'</td><td class="customtd">';
$company_relationship_data = null;
//print_r($general_form['company_with_relationships']);
foreach($general_form['company_with_relationships'] as $company_with_relationship)
{
//print_r($company_with_relationship);
if($individual['pd_co_applicant_id'] == $company_with_relationship['applicant_name'])
{
//FInd Company Name from JSON
//echo "ONCE";
$company_relationship_data = ($company_with_relationship['company_relationship_master'] .' '.$company_with_relationship['company_name']);
$company_relationship_data.='<br><center>and</center><br>';
}
}
$personal_relationship_data = null;
foreach($general_form['persons_with_relationships'] as $persons_with_relationship)
{
if(($individual['pd_co_applicant_id'] == $persons_with_relationship['pd_co_applicant_id'] || !strcasecmp($applicant_name,$persons_with_relationship['applicant_name']))&& isset($persons_with_relationship['relationship']))
{
if( isset($persons_with_relationship['relation_to_master']))
{
$RSNA = $persons_with_relationship['relation_to_master'];
if(isset($persons_with_relationship['relationship_master']))
{
$personal_relationship_data .= $persons_with_relationship['relationship_master'] .' of '. $RSNA;
$personal_relationship_data.='<br><center>and</center><br>';
}
}
}
}
$company_relationship_data .= $personal_relationship_data;
echo substr_replace($company_relationship_data, '', strrpos($company_relationship_data, '<br><center>and</center><br>'),strlen($company_relationship_data));
echo "</td></tr>";
}
}
?>
</tbody>
</table>
<?php
//
if($general_form['general_remark'] != "") { ?>
<!-- <p>PD Officers Note (About General Section) :</p> -->
<?php
echo '<p>'.$general_form['general_remark'].'</p>';
}
?>
<!-- ########################### End of Cover Page Section ####################################-->
<!-- ########################### Score Card Section ############################################### -->
<?php
//print_r($pd_score);die();
$address_type_remarks_caption = array('well_suited' => 'well suited','fairly_suited' => 'fairly suited','not_suited' => 'not suited');
if( isset($pd_score) && count($pd_score))
{
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>';
}
// else
// { echo "<b>Score Chart Not Generated</b>"; }
//######################### CHART ###########################
// if(isset($dsc_cards['base64_dsc_business']))
// {
// echo "<br><br>";
// echo '<p><img src="'.$dsc_cards['base64_dsc_business'].'" style="width:600px;height:350px;"/></p>';
// }
// else
// {
// //echo "<b>Score Chart Not Generated</b>";
// }
// if(isset($dsc_cards['base64_dsc_general']))
// {
// echo "<br><br>";
// echo '<p><img src="'.$dsc_cards['base64_dsc_general'].'" style="width:600px;height:350px;"/></p>';
// }
// else
// {
// //echo "<b>Score Chart Not Generated</b>";
// }
echo "<div id='page_break'></div>";
//######################### CHART ###########################
$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_raw_material_enough" => "Raw Materials 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 >>","pd_location_approach" => "Approach to PD location >>","customer_behaviour" => "Customer Behaviour >>","neibourhood_check_as_per_pd_officer" => "Neighbourhood check >>","was_the_company_name_board_sighted" => "Business Board Sighted >>","value_of_other_assets" => "Asset Value by Loan Amount % >>");
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 == 'business_seasonality')
// {
// echo "BUSINESS";
// echo $per;
// echo $class;
// echo $per >= 80 ? 'rcorners_green' : 'SOME';
// die();
// }
if($bsk == 'location_suited_for_busienss')
{
$answer = $address_type_remarks_caption[ $business_score['answer'] ];
}
else if($bsk == 'cerificates')
{
$answer = $per > 0 ? 'Yes' : 'No';
}
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 if($bsk == 'vintage_of_business_account')
{
$answer = isset($business_score['answer']) && $business_score['answer'] != '' ? $business_score['answer'] : 'No';
}
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($gsk == 'value_of_other_assets')
{
//print_r($general_score);die();
$answer = round((($answer/$loan_form['loan_amount']) * 100),2) .' %';
}
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>';
//
} //end of is score card enabled for this pd
?>
<!-- ####################### Address Details Section Statred ############################-->
<?php
$address_form = json_decode($pd_processed_forms[5][0]['processed_json'],true);
//print_r($address_form);
$final_remark_data = json_decode($pd_processed_forms[20][0]['processed_json'],true) ;
$business_assets_details = json_decode($pd_processed_forms[22][0]['processed_json'],true);
//print_r($business_assets_details);die();
$address_images = $pd_images[5];
//print_r($address_images);die();
$pd_location_approach_img_url = '';
$pd_location_approach_img_location = '';
$pd_location_approach_img_date = '';
foreach ($address_images as $address_image_key => $address_image_value) {
if($address_image_value['is_show_report'] == 1)
{
$pd_location_approach_img_url = isset($address_image_value['doc_url']) ? $address_image_value['doc_url']: '';
//$pd_location_approach_img_location = $address_image_value['location'];
//$pd_location_approach_img_date = date('Y/m/d h:s:i A',$address_image_value['createdon']);
break;
}
}
$name_board_seen_img_url = '';
if(isset($pd_processed_forms[13][0]))
{
$first_business_form = json_decode($pd_processed_forms[13][0]['processed_json'],true);
//if($first_business_form['was_the_company_name_board_sighted']=='yes')
//{
//echo 'YES';die();
foreach ($pd_images[13] as $image_key => $image_value) {
if($image_value['pd_document_title'] == 'Name Board Seen')
{
$name_board_seen_img_url = $image_value['doc_url'];
break;
}
}
//}
}
//echo $name_board_seen_img_url;die();
//print_r($address_images);die();
?>
<div id="page_break"></div>
<p><b>PD LOCATION</b></p>
<p><?php
$pd_address = $address_form['addresses'][0];
$pd_alternative_address = array();
$pincode = isset($pd_address['pincode_others']) && ($pd_address['pincode_others'] != "" || $pd_address['pincode_others'] != null) ? $pd_address['pincode_others'] : $pd_address['pincode_master'];
$is_change_address = 0;
if(isset($address_form['is_pd_done_on_initiated_address']) && (!$address_form['is_pd_done_on_initiated_address']))
{
$is_change_address = 1;
$pd_alternative_address = $address_form['alternative_addresses'][0];
$alter_native_pincode = isset($pd_alternative_address['pincode_others']) && ($pd_alternative_address['pincode_others'] != "" || $pd_alternative_address['pincode_others'] != null) ? $pd_alternative_address['alternate_pincode_others'] : $pd_alternative_address['pincode_master'];
echo '<b>Address at which PD was initiated: </b>'.$pd_address['address'].', '.$pd_address['city_master'].', '.$pd_address['state_master'].' - '.$pincode.'.';
echo '<br><b>Address at which PD Visit actually done: </b>'.$pd_alternative_address['alternative_address'].', '.$pd_alternative_address['city_master'].', '.$pd_alternative_address['state_master'].' - '.$alter_native_pincode.'.';
echo '<br><b>Reasaon for change in PD address:</b>'.$pd_alternative_address['reason_for_alternative_address'];
}
else
{
echo '<b>PD Location Address : </b>'.$pd_address['address'].', '.$pd_address['city_master'].', '.$pd_address['state_master'].' - '.$pincode.'.';
}
echo '<br><br><b> GPS Coordinates of location where PD Visit was done : </b>'.$pd_master_details[0]['start_location'];
echo '<br><br>';
?>
<?php
$satellite_url = '';
if(isset($pd_images['common_images']) && count($pd_images['common_images']))
{
foreach($pd_images['common_images'] as $com_key => $com_value)
{
if($com_value['pd_document_title'] == 'satellite')
{
$satellite_url = $com_value['doc_url'];break;
}
}
}
?>
<img border="3" src = "<?php echo $satellite_url;?>" alt=" Satellite Image of location of Where PD was Done" style="width:100%;height:300px;border-color:#0191ed" /><br><br><br>
<?php if($pd_location_approach_img_url != "" || $name_board_seen_img_url != "") {?>
<table>
<thead>
<tr> <th>PD Location Approach</th> <th>Name Board of Business/Entrance</th> </tr>
</thead>
<tr><td>
<img border="3" src ="<?php echo $pd_location_approach_img_url;?>" style="width:50%;height:300px;border-color:#0191ed" alt="Location Approach Image Not Available"/>
</td><td>
<img border="3" src ="<?php echo $name_board_seen_img_url;?>" alt="Name Board" style="width:50%;height:300px;border-color:#0191ed" alt="Name Board Seen Image Not Available"/> </td>
</tr>
<tr> <td><?php echo $pd_location_approach_img_location .'<br>'.$pd_location_approach_img_date; ?></td> <td> </td> </tr>
</table>
<?php } ?>
<div id="page_break"></div>
<br><p><b>Location Summary</b></p>
<?php
$pd_address = $is_change_address ? $pd_alternative_address : $pd_address;
$address_type = $pd_address['address_type'] == 1? $pd_address['address_type_others'] : $pd_address['address_type_master'];
$locality = $pd_address['locality'] == 1 ? $pd_address['locality_others']: $pd_address['locality_master'];
$locality = preg_match("/^[aeiouAEIOU]/U", $locality) ? 'an '.$locality : 'a '.$locality;
$comment_locality_master = preg_match("/^[aeiouAEIOU]/U", $pd_address['comment_locality_master']) ? 'an '.$pd_address['comment_locality_master'] : 'a '.$pd_address['comment_locality_master'];
$property_owner_type = $business_assets_details['business_assets_for_address'][0]['business_ownership_type'];
if($property_owner_type == 'rented') { $property_owner_type ='Rented (Rent '.$rupee_symbol.' '.$business_assets_details['business_assets_for_address'][0]['business_monthly_rented_amt'].' Per Month)'; }else{$property_owner_type = 'Owned'; }
$yrs_being_run = $business_assets_details['business_assets_for_address'][0]['business_years'].' Years';
if($business_assets_details['business_assets_for_address'][0]['business_month'] != ""){ $yrs_being_run.= ' and '.$business_assets_details['business_assets_for_address'][0]['business_month'].' Months';}
echo '<p style="text-align:justify;">';
echo '<span contenteditable="true">The PD visit was done at </span><span class="tooltip">'. $address_type. '<span class="tooltiptext">Address Form - Type of Address </span></span><span contenteditable="true"> of the loan applicants. </span>';
echo '<span contenteditable="true">The </span><span class="tooltip">'.$address_type.'<span class="tooltiptext">Address Form - Type of Address </span></span><span contenteditable="true"> is </span><span class="tooltip">'.$property_owner_type.'<span class="tooltiptext">Business Assest Form - Owner of the Property </span></span><span contenteditable="true"> and the business has been in operation from here for the last</span> <span class="tooltip">'.$yrs_being_run.'<span class="tooltiptext">Business Assest Form - Business running Yrs in this premise </span></span><span contenteditable="true">.</span>';
echo '<br><br><span contenteditable="true">The</span> <span class="tooltip">'.$address_type.'<span class="tooltiptext">Address Form - Type of Address </span></span> <span contenteditable="true">is located in </span><span class="tooltip">'.$locality.'<span class="tooltiptext">Address Form - Locality of Address </span></span> <span contenteditable="true">.</span>';
echo '<br><br><span contenteditable="true">The PD location was </span><span class="tooltip">'. $pd_address['pd_location_master'].'<span class="tooltiptext">Address Form - Approach to PD location </span></span>. ' . '<span contenteditable="true">As Per PD Officer, the</span> <span class="tooltip">'.$address_type .'<span class="tooltiptext">Address Form - Type of Address </span></span> <span contenteditable="true">is situated in</span><span class="tooltip"> '.$comment_locality_master .'<span class="tooltiptext">Address Form - Comment on locality </span></span> <span contenteditable="true">Locality.</span>';
echo '<br><br><span contenteditable="true">The PD officer also made the following observations:</span>' ;
echo '<br><ul>';
echo '<li><span contenteditable="true"> The location of the</span><span class="tooltip"> '.$address_type.'<span class="tooltiptext">Address Form - Type of Address </span></span> <span contenteditable="true">is</span> <span class="tooltip">'.$address_type_remarks_caption [ $final_remark_data['is_service_provided'] ].'<span class="tooltiptext">Final Remarks Form - The location of the busienss suitability for Business </span></span> <span contenteditable="true">to the nature of business. </span></li>';
if($first_business_form['was_the_company_name_board_sighted'] == 'yes')
{
echo '<li><span class="tooltip">The Business Name board was seen at the visited address.<span class="tooltiptext">Business Form</span></span></li>';
}
else
{
echo '<li><span class="tooltip">The Business Name board was not seen at the visited address.<span class="tooltiptext">Business Form</span></span></li>';
}
if($business_assets_details['business_assets_for_address'][0]['business_is_pd_visited'] == 'yes')
{
echo '<li><span class="tooltip">Business Activity was seen during visit.<span class="tooltiptext">Business Assest Form - Busienss activity seen during PD visit </span></span></li>';
}
else{
echo '<li><span class="tooltip">No business activity was seen during the PD visit.<span class="tooltiptext">Business Assest Form - Busienss activity seen during PD visit </span></span></li>';
}
if(isset($business_assets_details['business_assets_for_address'][0]['business_pd_visited_remark']) && $business_assets_details['business_assets_for_address'][0]['business_pd_visited_remark'] != ""){
echo '<li><span class="tooltip">'.$business_assets_details['business_assets_for_address'][0]['business_pd_visited_remark'] .'<span class="tooltiptext">Business Assest Form - Busienss Assest Form Remarks </span></span></li>';}
if(isset($final_remark_data['is_competition']))
{
if($final_remark_data['is_competition'] == 'yes')
{
echo '<li>'.$final_remark_data['appx_outlet_or_stores'].' Units with similar business were sighted in the locality</li>';
}
else
{
echo '<li>PD officer did not observe any similar business units in the locality.</li>';
}
}
if(isset($final_remark_data['demolition_activity']))
{
if($final_remark_data['demolition_activity'] == 'yes')
{
echo '<li>'.$final_remark_data['comment_of_demolition_activity'] .'</li>';
echo '<br><img border="3" src ="'. $final_remark_data['demolition_activity_pic'] .'" style="width:50%;height:200px;border-color:#0191ed" alt="Demolition Image Not Available"/>';
}
else
{
echo '<li>No demolition activity was observed in the locality.</li>';
}
}
if(isset($final_remark_data['sealing_activity']))
{
if($final_remark_data['sealing_activity'] == 'yes')
{
echo '<li>'.$final_remark_data['comment_of_sealing_activity'] .'</li>';
echo '<br><img border="3" src ="'. $final_remark_data['sealing_activity_pic'] .'" style="width:50%;height:200px;border-color:#0191ed" alt="Demolition Image Not Available"/>';
}
else
{
echo '<li>No sealing activity was observed in the locality.</li>';
}
}
if(isset($final_remark_data['outlet_location']))
{
if($final_remark_data['outlet_location'] == 'heavy_footfall')
{
echo '<li>Heavy Footfall ( Lots of customer in the locality / market place )</li>';
}
else if($final_remark_data['outlet_location'] == 'medium_footfall')
{
echo '<li>Medium Footfall ( Meduim no of customer in the locality / market place )</li>';
}
else if($final_remark_data['outlet_location'] == 'low_footfall')
{
echo '<li>LOw Footfall ( Few customer in the locality / market place )</li>';
}
}
echo "</ul>";
if($address_form['address_form_remark'])
{
echo '<span class="tooltip">'.$address_form['address_form_remark'].'<span class="tooltiptext">Address Form - Address Form Remarks </span></span>';}
echo "</p>";
// echo "<div id='page_break'></div>";
//die();
//
?>
<!-- ####################### End of Address Details Section ############################-->
<!-- ####################### Loan Details Details Section ############################-->
<p contenteditable="true"><b>LOAN DETAILS:</b></p>
<?php
$loan_amount = MYUTIL::customIndianNumberFormat( $loan_form['loan_amount']);
echo '<span>During the PD visit, person met provide the following information about loan applied for:</span>';
$is_current_product_bl = $pd_master_details[0]['product_abbr'] == "BL" ? true: false;
$is_current_product_lab = $pd_master_details[0]['product_abbr'] == "LAP" ? true: false;
$is_current_product_laep = $pd_master_details[0]['product_abbr'] == "LAEP" ? true: false;
// echo $pd_master_details[0]['product_abbr'];
// echo '-bl-'. $is_current_product_bl;
// echo '-lap-'.$is_current_product_lab;
// die();
$loan_table_dispaly_rows = array();
$loan_table_dispaly_rows[] = array('particulars' => 'Total Loan Amount applied for','details' => "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".$loan_amount.' ('.MYUTIL::numtowords($loan_form['loan_amount']).')');
if($is_current_product_bl || $is_current_product_laep)
{
$to_dispaly = !strcasecmp($loan_form['is_there_total_fund'], 'yes disclose') ? ('Disclosed '."<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".MYUTIL::customIndianNumberFormat($loan_form['fund_amt']).' ('.MYUTIL::numtowords($loan_form['fund_amt']).')'):'Not Disclosed';
$loan_table_dispaly_rows[] = array('particulars' => 'Total Fund Requirement','details' => $to_dispaly);
}
$loan_table_dispaly_rows[] = array('particulars' => 'Loan Tenure expected','details' => $loan_form['loan_tenure'].' Months');
$end_use = '';
$to_remove_for = false;
foreach($loan_form['end_use_master'] as $enduse)
{
if(strpos(strval($enduse), 'Others') === false) { $end_use.= $enduse.' and ';}
else {
$to_remove_for = true;
$end_use.=$loan_form['end_use_other'].' and';
}
}
$end_use = substr_replace($end_use, '', strrpos($end_use, 'and'),strlen($end_use));
//echo substr($end_use,0,3);
if(strcasecmp(substr($end_use,0,3),'for'))
{
if(!(count($loan_form['end_use_master']) == 1 && $to_remove_for))
{
$end_use = 'For '.$end_use;
}
}
$loan_table_dispaly_rows[] = array('particulars' => 'Loan Purpose','details' => $end_use);
// if(strcasecmp($loan_form['is_transfer'],'no'))
// {
// $loan_table_dispaly_rows[] = array('particulars' => 'Balance Transfer Amount','details' => "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".MYUTIL::customIndianNumberFormat($loan_form['balance_transfer_amount']).' ('.MYUTIL::numtowords($loan_form['balance_transfer_amount']).')');
// $loan_table_dispaly_rows[] = array('particulars' => 'Top Up Amount applied for','details' => "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".MYUTIL::customIndianNumberFormat($loan_form['topup_amount']).' ('.MYUTIL::numtowords($loan_form['topup_amount']).')');
// $loan_table_dispaly_rows[] = array('particulars' => 'End Use of Topup','details' => ( strcasecmp('others',$loan_form['end_use_topup_master'])) ? $loan_form['end_use_topup_master'] : $loan_form['other_end_use_topup'] );
// $loan_table_dispaly_rows[] = array('particulars' => 'Balance Transfer from','details' => $loan_form['lender'] == 1 ? $loan_form['other_bt_lender']: $loan_form['lender_master']);
// }
// else{
// //echo 'sdn-'.((!$is_current_product_bl) && !$is_current_product_lab); die();
// if((!$is_current_product_bl) && !$is_current_product_lab && !$is_current_product_laep)
// {
// $loan_table_dispaly_rows[] = array('particulars' => 'Amount of Own Contribution','details' =>"<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".MYUTIL::customIndianNumberFormat($loan_form['own_contribution']).' ('.MYUTIL::numtowords($loan_form['own_contribution']).')' );
// $source_of_own_contribution = null;
// foreach($loan_form['source_of_own_contribution_master'] as $own_source)
// {
// if(strpos(strval($own_source), 'Others') === false) { $source_of_own_contribution.= $own_source.' and ';}else{ $source_of_own_contribution.=$loan_form['other_source'].' and '; }
// }
// $source_of_own_contribution = substr_replace($source_of_own_contribution, '', strrpos($source_of_own_contribution, ' and '),strlen($source_of_own_contribution));
// $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' => $rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')' );
if(!$is_current_product_bl && !$is_current_product_laep)
{
if(isset($loan_form['property_type_master']) && $loan_form['property_type_master'] != "")
{
$loan_table_dispaly_rows[] = array('particulars' => 'Type of Property Being Mortgaged','details' => substr_count($loan_form['property_type_master'],'Others') ? $loan_form['property_type_others'] : $loan_form['property_type_master']);
$owners_list = null;foreach($loan_form['owners_list_master'] as $owner){ $owners_list.=$owner.' and '; }
$owners_list = substr_replace($owners_list, '', strrpos($owners_list, 'and'),strlen($owners_list));
if($owners_list == '')
{
if(isset($loan_form['owner_name_group'][0]['owner_name']))
{
$owners_list = $loan_form['owner_name_group'][0]['owner_name']['name'];
}
}
$loan_table_dispaly_rows[] = array('particulars' => 'Name of the current / proposed owner(s) of the Property being Mortgaged','details' => $owners_list);
$loan_table_dispaly_rows[] = array('particulars' => 'Status of Construction','details' => $loan_form['construction_status_master']);
$loan_table_dispaly_rows[] = array('particulars' => 'Estimated Market Value of the property being mortgaged','details' => $rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emv_per_customer']).' ('.MYUTIL::numtowords($loan_form['emv_per_customer']).')');
}
}
if(isset($loan_form['property_seller']) && $loan_form['property_seller'] != '')
{
$loan_table_dispaly_rows[] = array('particulars' => 'Current Owner/Seller of the property','details' => $loan_form['property_seller'] );
}
if(isset($loan_form['address']) && $loan_form['address'] != '')
{
$address_of_owner_seller_property = $loan_form['address'] . (isset($loan_form['city_master']) ? ', '.$loan_form['city_master'] : '') . (isset($loan_form['state_master']) ? ', '.$loan_form['state_master'] : '') . (isset($loan_form['pincode_master']) ? ', '.$loan_form['pincode_master'] : '');
$loan_table_dispaly_rows[] = array('particulars' => 'Address of the property','details' => $address_of_owner_seller_property );
}
//print_r($loan_table_dispaly_rows);
?>
<br><br>
<table class="scorecard_table">
<tr> <th style="text-align:center;">S.No</th> <th>Loan Particulars</th> <th>Loan Particular Details</th> </tr>
<tbody>
<?php
foreach($loan_table_dispaly_rows as $row_key => $row)
{
echo '<tr> <td style="text-align:center;width:25px;">'.($row_key + 1)."</td> <td>".$row['particulars']."</td> <td>".$row['details'] ."</td> </tr>";
}
?>
</tbody>
</table>
<?php
//
echo "<br><br>".$loan_form['loandetails_remarks'];
?>
<!-- ####################### End of Loan Details Details Section ############################-->
<!-- ###########################Business section start#####################################-->
<?php if($total_no_of_business > 0) {
for($business_count = 0;$business_count < $total_no_of_business; $business_count++)
{
// $temp_show = null;
// if($temp_show == null)
// {
?>
<!-- <div id='page_break'></div> -->
<?php
$businessResult=array();
if(isset($pd_processed_forms[13][$business_count]))
{
$bRow = $pd_processed_forms[13][$business_count];
$businessRow = json_decode($bRow['processed_json'],true);
//print_r($businessRow);die();
$business_form_common_remarks = $businessRow['business_remarks'];
$companyList = MYUTIL::findCompanyName($all_company_details,$businessRow['company_id'],2);
//$companyList .=' The director details are as under :';
$bindEachResult["company_details"]=$companyList;
// this is for partner details
if(array_key_exists('partners',$businessRow)){
$bindEachResult["partner"]=Businessform::getPartnerDetails($businessRow['partners'],$pd_master_details[0]['pd_id']);
}
else {
$getPartner=array();
$bindEachResult["partner"]=$getPartner;
}
// this is for person with relationship
if(array_key_exists('persons_with_relationships',$businessRow)){
$bindEachResult["family_members_involved"]=Businessform::getFamilyMemberDetails($businessRow['persons_with_relationships'],$pd_master_details[0]['pd_id']);
}
else {
$getFamilyMembers=array();
$bindEachResult["family_members_involved"]=$getFamilyMembers;
}
$bindEachResult['total_per_of_export'] = $businessRow['export_sale_of_total_sales'];
$bindEachResult['applicant_use_mobile_wallets'] = $businessRow['applicant_use_mobile_wallets'];
$bindEachResult['applicant_use_pos_machines'] = $businessRow['applicant_use_pos_machines'];
//$bindEachResult['applicant_use_pos_machines'] = $businessRow['applicant_use_pos_machines'];
$bindEachResult['pos_machines_details'] = isset($businessRow['pos_machines_details']) ? $businessRow['pos_machines_details']: null;
$bindEachResult['no_of_pos_machines'] = isset($businessRow['no_of_pos_machines']) ? $businessRow['no_of_pos_machines'] : null;
// this is for manufacturing activities
if(array_key_exists('manufacturing_activity_details',$businessRow)){
$bindEachResult['manufacturing'] = Businessform::getActivityDetails($businessRow['manufacturing_activity_details'],1);
}
else{
$getManufacturingRow=array();
$bindEachResult['manufacturing']=$getManufacturingRow;
}
// this is for retail activites
if(array_key_exists('retail_trading_activity_details',$businessRow)){
$bindEachResult['retail'] = Businessform::getActivityDetails($businessRow['retail_trading_activity_details'],2);
}
else{
$getRetailRow=array();
$bindEachResult['retail']=$getRetailRow;
}
// this is for whole sale activites
if(array_key_exists('wholesale_trading_activity_details',$businessRow)){
$bindEachResult['wholesale'] = Businessform::getActivityDetails($businessRow['wholesale_trading_activity_details'],3);
}
else{
$getWholesaleRow=array();
$bindEachResult['wholesale']=$getWholesaleRow;
}
// this is for service provider
if(array_key_exists('service_provider_activity_details',$businessRow)){
$bindEachResult['serviceprovider']=Businessform::getActivityDetails($businessRow['service_provider_activity_details'],4);
}
else{
$getServiceproviderRow=array();
$bindEachResult['serviceprovider']=$getServiceproviderRow;
}
// this is for other activity details
if(array_key_exists('others_activity_details',$businessRow)){
$bindEachResult['otheractivity']=Businessform::getActivityDetails($businessRow['others_activity_details'],5);
}
else{
$getOtheractivityRow=array();
$bindEachResult['otheractivity']=$getOtheractivityRow;
}
// this if for get business peak period
if(strtoupper($businessRow['seasonality'])=='YES' && array_key_exists('peak_period_of_business',$businessRow)){
$bindEachResult['business_peak_details']=Businessform::getBusinessPeakDetails($businessRow['peak_period_of_business'],$businessRow['month_of_business_run']);
}
else{
$bindEachResult['business_peak_details']='The Business has no major change in sales across seasons<span contenteditable="true">.</span>';
}
$bindEachResult['company_employees'] = '';
// this is for no of employees details
if(isset($businessRow['employees_permanent']) && $businessRow['employees_permanent'] <= 0) {
$bindEachResult['company_employees']='As per person met there are no permanent employee(s) with company.';
}
else{
$bindEachResult['company_employees']='As per person met, there are '.$businessRow['employees_permanent'].' permanent employee(s) with company.';
}
if(isset($businessRow['employees_appx_salary']) && $businessRow['employees_appx_salary'] != "")
{
$bindEachResult['employees_appx_salary'] = 'Approximately '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($businessRow['employees_appx_salary']). ' is being paid as salary to employees';
}
if(isset($businessRow['officer_total']) && $businessRow['officer_total'] > 0)
{
$emp = $businessRow['officer_total'] > 1 ? 'employees' : 'employee';
$bindEachResult['officer_visit_company_employees']='At the time of PD visit, the officer sighted '.$businessRow['officer_total'] .' '.$emp.' at the business premises<span contenteditable="true">.</span>';
}
else{
$bindEachResult['officer_visit_company_employees']='At the time of PD visit, no employees seen at the business premises<span contenteditable="true">.</span>';
}
//this is documents visited
$getDocuments=array();
if(array_key_exists('shop_eat_act_cert',$businessRow) && strtoupper($businessRow['shop_eat_act_cert'])=='YES'){
array_push($getDocuments,array('name'=>'Shop/Est act Certificate.','img' => isset($businessRow['shop_eat_act_cert_pic']) ? $businessRow['shop_eat_act_cert_pic'] : '','key_name' => 'shop_eat_act_cert_pic'));
}
if(array_key_exists('gst_Regn_cert',$businessRow) && strtoupper($businessRow['gst_Regn_cert'])=='YES'){
array_push($getDocuments,array('name' => 'GST Registration.','img' => isset($businessRow['gst_Regn_cert_pic']) ? $businessRow['gst_Regn_cert_pic'] : '' ,'key_name' => 'gst_Regn_cert_pic'));
}
if(array_key_exists('pf_regn',$businessRow) && strtoupper($businessRow['pf_regn'])=='YES'){
array_push($getDocuments,array('name' => 'PF Registration.','img' => isset($businessRow['pf_regn_pic']) ? $businessRow['pf_regn_pic'] : '','key_name' => 'pf_regn_pic'));
}
if(array_key_exists('esic_regn',$businessRow) && strtoupper($businessRow['esic_regn'])=='YES'){
array_push($getDocuments,array('name' => 'ESIC Registration.','img' => isset($businessRow['esic_regn_pic']) ? $businessRow['esic_regn_pic'] : '','key_name' => 'esic_regn_pic'));
}
if(array_key_exists('export_import_cert',$businessRow) && strtoupper($businessRow['export_import_cert'])=='YES'){
array_push($getDocuments,array('name' => 'Export/Import Certificate.','img' => isset($businessRow['export_import_cert_pic']) ? $businessRow['export_import_cert_pic'] : '','key_name' => 'export_import_cert_pic'));
}
if(array_key_exists('factory_cert',$businessRow) && strtoupper($businessRow['factory_cert'])=='YES'){
array_push($getDocuments,array('name' => 'Factory Certificate.','img' => isset($businessRow['factory_cert_pic']) ? $businessRow['factory_cert_pic'] : '','key_name' => 'factory_cert_pic'));
}
if(strtoupper($businessRow['other_documents'])=='YES' && array_key_exists('documents',$businessRow)){
foreach($businessRow['documents'] as $docValue){
array_push($getDocuments,array('name' => $docValue['document'].'.', 'img' => isset( $docValue['document_pic']) ? $docValue['document_pic'] : '','key_name' => $docValue['document']));
}
}
//print_r($getDocuments);
if(count($getDocuments))
{
foreach($getDocuments as $getDocument_key => $getDocument_value)
{
foreach($pd_images[13] as $img_key => $img_value)
{
if( $getDocument_value['key_name'] == $img_value['pd_document_title'] )
{
$getDocuments[$getDocument_key]['img'] = $img_value['doc_url'];
break;
}
}
}
}
//print_r($getDocuments);die();
$bindEachResult['visit_documents']=$getDocuments;
array_push($businessResult,$bindEachResult);
?>
<h3 contenteditable="true">BUSINESS INFORMATION:</h3>
<?php
//print_r($businessResult);
$company_firm_name_heading = 'Company / Firm Name : ';
$business_entity_type_heading = 'Business Entity Type :';
if( !strcasecmp($pd_master_details[0]['customer_segment_abbr'],'SEP_INDV'))
{
$company_firm_name_heading = 'Nature of Services : ';
$business_entity_type_heading = 'Entity Type :';
}
foreach($businessResult as $bKey=>$fetchRow){
?>
<p>
<br><strong><?php echo $company_firm_name_heading ?> </strong><span><?php echo $fetchRow['company_details']['company_name'];?></span><br>
<br><strong><?php echo $business_entity_type_heading ?></strong><span><?php echo $fetchRow['company_details']['type_of_activity'];?></span><br>
<?php if($fetchRow['company_details']['formed_on']){ ?>
<br><strong>Date of Incorporation : </strong><span><?php echo $fetchRow['company_details']['formed_on'];?></span><br>
<?php } ?>
<br><strong>Business Vintage : </strong><span><?php echo $fetchRow['company_details']['year_and_month'];?></span>
</p>
<div><p><span><?php echo $fetchRow['company_details']['partners_title_name'];?></span></p></div>
<table class="scorecard_table">
<thead>
<tr>
<th>Name</th>
<th>Share Holding</th>
<th>No.of Years in Current Business</th>
<th>Total Work Experience(Yrs)</th>
<th>Previous Experience</th>
<th>Started Business</th>
</tr>
</thead>
<tbody>
<?php foreach($fetchRow['partner'] as $partRow){
?>
<tr>
<td class="customtd"><?php echo $partRow['name'] ?></td>
<td class="customtd"><?php echo $partRow['share_holding'] ?></td>
<td class="customtd"><?php echo $partRow['no_years_business'] ?></td>
<td class="customtd"><?php echo $partRow['total_experience']?></td>
<td class="customtd"><?php echo $partRow['previous_experience']?></td>
<td class="customtd"><?php echo ucfirst($partRow['started_business'])?></td>
</tr>
<?php } ?>
</tbody>
</table>
<!--this is for family members involved in business -->
<?php
//print_r($fetchRow['family_members_involved']);
if(count($fetchRow['family_members_involved']) >0){ ?>
<div>
<p>Other Family Members involved in business :</p>
</div>
<table class="scorecard_table">
<thead>
<tr>
<th>Name</th>
<th>Individual Relationship</th>
<th>Related to</th>
<th>Relationship to Company / Firm</th>
<th>Started Business (Yes / No)</th>
</tr>
</thead>
<tbody>
<?php foreach($fetchRow['family_members_involved'] as $familyRow){
if($familyRow['name'] != "" || $familyRow['name'] != null){
?>
<tr>
<td class="customtd"><?php echo $familyRow['name'] ?></td>
<td class="customtd"><?php echo $familyRow['individual_relation'] ?></td>
<td class="customtd"><?php echo $familyRow['relation_to'] ?></td>
<td class="customtd"><?php echo $familyRow['relation_to_company'] ?></td>
<td class="customtd"><?php echo ucfirst($familyRow['started_business'])?></td>
</tr>
<?php } ?>
<?php } ?>
</tbody>
</table>
<?php }?>
<!-- end family members -->
<!-- start manufacturing -->
<?php
//
if(count($fetchRow['manufacturing']) >0){ ?>
<!-- <div> -->
<p> Key Products and Area of Operations</p>
<!-- <br> -->
<!-- </div> -->
<table class="scorecard_table">
<thead>
<tr>
<th>Key Products</th>
<th>Area of Operations</th>
<th>Area of Sale / Service</th>
<th>Area where Max Sale / Service done</th>
</tr>
</thead>
<tbody>
<?php foreach($fetchRow['manufacturing'] as $manuRow){
?>
<tr>
<td class="customtd"><?php echo $manuRow['products'] ?></td>
<td class="customtd"><?php echo $manuRow['area_of_sale'] ?></td>
<td class="customtd"><div><?php echo $manuRow['sales_done'] ?></div>
<?php if(array_key_exists('both_sales_done',$manuRow)) { ?>
<div><?php echo $manuRow['both_sales_done'] ?></div>
<?php } ?>
</td>
<td class="customtd"><?php echo $manuRow['max_sales_done']?></td>
</tr>
<?php } ?>
</tbody>
</table>
</br></br></br></br>
<p>Brief of the Business / Service Model </p>
<table class="scorecard_table">
<thead>
<tr> <th>Product / Service</th> <th>Process Brief</th> </tr>
</thead>
<tbody>
<?php foreach($fetchRow['manufacturing'] as $process_brief){?>
<tr> <td class="customtd"><?php echo $process_brief['products']; ?></td> <td><?php echo '<p style="text-align:justify;">'.$process_brief['description'].'</p>'; ?></td> </tr>
<?php } ?>
</tbody>
</table>
<?php } ?>
<!-- end manufacturing -->
<!-- start retail -->
<?php if(count($fetchRow['retail']) >0){ ?>
<!-- <div> -->
<p> Key Products and Area of Operations</p>
<!-- <br> -->
<!-- </div> -->
<table class="scorecard_table">
<thead>
<tr>
<th>Key Products</th>
<th>Area of Operations</th>
<th>Area of Sale / Service</th>
<th>Area where Max Sale / Service done</th>
</tr>
</thead>
<tbody>
<?php foreach($fetchRow['retail'] as $retailRow){
?>
<tr>
<td class="customtd"><?php echo $retailRow['products'] ?></td>
<td class="customtd"><?php echo $retailRow['area_of_sale'] ?></td>
<td class="customtd"><div><?php echo $retailRow['sales_done'] ?></div>
<?php if(array_key_exists('both_sales_done',$retailRow)) { ?>
<div><?php echo $retailRow['both_sales_done'] ?></div>
<?php } ?>
</td>
<td class="customtd"><?php echo $retailRow['max_sales_done']?></td>
</tr>
<?php } ?>
</tbody>
</table>
</br></br></br></br>
<p>Brief of the Business / Service Model </p>
<table class="scorecard_table">
<thead>
<tr> <th>Product / Service</th> <th>Process Brief</th> </tr>
</thead>
<tbody>
<?php foreach($fetchRow['retail'] as $retailRow){?>
<tr> <td class="customtd"><?php echo $retailRow['products']; ?></td> <td><?php echo $retailRow['description']; ?></td> </tr>
<?php } ?>
</tbody>
</table>
<?php } ?>
<!-- end retail -->
<!-- start serviceprovider -->
<?php if(count($fetchRow['serviceprovider']) >0){ ?>
<!-- <div> -->
<p> Key Products and Area of Operations</p>
<!-- <br> -->
<!-- </div> -->
<table class="scorecard_table">
<thead>
<tr>
<th>Services</th>
<th>Area of Operations</th>
<th>Area of Sale / Service</th>
<th>Area where Max Sale / Service done</th>
</tr>
</thead>
<tbody>
<?php foreach($fetchRow['serviceprovider'] as $serviceproviderRow){
?>
<tr>
<td class="customtd"><?php echo $serviceproviderRow['products'] ?></td>
<td class="customtd"><?php echo $serviceproviderRow['area_of_sale'] ?></td>
<td class="customtd"><div><?php echo $serviceproviderRow['sales_done'] ?></div>
<?php if(array_key_exists('both_sales_done',$serviceproviderRow)) { ?>
<div><?php echo $serviceproviderRow['both_sales_done'] ?></div>
<?php } ?>
</td>
<td class="customtd"><?php echo $serviceproviderRow['max_sales_done']?></td>
</tr>
<?php } ?>
</tbody>
</table>
</br></br></br></br>
<p>Brief of the Business / Service Model </p>
<table class="scorecard_table">
<thead>
<tr> <th>Product / Service</th> <th>Process Brief</th> </tr>
</thead>
<tbody>
<?php foreach($fetchRow['serviceprovider'] as $serviceproviderRow){?>
<tr> <td class="customtd"><?php echo $serviceproviderRow['products']; ?></td> <td><?php echo $serviceproviderRow['description']; ?></td> </tr>
<?php } ?>
</tbody>
</table>
<?php } ?>
<!-- end wholesale -->
<!-- serviceprovider start wholesale -->
<?php if(count($fetchRow['wholesale']) >0){ ?>
<!-- <div> -->
<p> Key Products and Area of Operations</p>
<!-- <br> -->
<!-- </div> -->
<table class="scorecard_table">
<thead>
<tr>
<th>Key Products</th>
<th>Area of Operations</th>
<th>Area of Sale / Service</th>
<th>Area where Max Sale / Service done</th>
</tr>
</thead>
<tbody>
<?php
//print_r($fetchRow['wholesale']);
foreach($fetchRow['wholesale'] as $wholesaleRow){
?>
<tr>
<td class="customtd"><?php echo $wholesaleRow['products'] ?></td>
<td class="customtd"><?php echo $wholesaleRow['area_of_sale'] ?></td>
<td class="customtd"><div><?php echo $wholesaleRow['sales_done'] ?></div>
<?php if(array_key_exists('both_sales_done',$wholesaleRow)) { ?>
<div><?php echo $wholesaleRow['both_sales_done'] ?></div>
<?php }
// if(!strcasecmp($wholesaleRow['area_of_sale'],'Domestics & Exports'))
// {
// echo '<div>'.$fetchRow['total_per_of_export'].' % of total sales is export.</div>';
// }
?>
</td>
<td class="customtd"><?php echo $wholesaleRow['max_sales_done']?></td>
</tr>
<?php } ?>
</tbody>
</table>
</br></br></br></br>
<p>Brief of the Business / Service Model </p>
<table class="scorecard_table">
<thead>
<tr> <th>Product / Service</th> <th>Process Brief</th> </tr>
</thead>
<tbody>
<?php foreach($fetchRow['wholesale'] as $wholesaleRow){?>
<tr> <td class="customtd"><?php echo $wholesaleRow['products']; ?></td> <td><?php echo $wholesaleRow['description']; ?></td> </tr>
<?php } ?>
</tbody>
</table>
<?php } ?>
<!-- end wholesale -->
<!-- start other activity-->
<?php if(count($fetchRow['otheractivity']) >0){ ?>
<!-- <div> -->
<!-- <p> Other activity details are as under :</p> -->
<br>
<!-- </div> -->
<table class="scorecard_table">
<thead>
<tr>
<th>Other Business Activity</th>
</tr>
</thead>
<tbody>
<?php foreach($fetchRow['otheractivity'] as $otherRow){
?>
<tr>
<td><?php echo $otherRow['products'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php }
if(is_numeric($fetchRow['total_per_of_export']))
{
echo '<div>'.$fetchRow['total_per_of_export'].' % of total sales is export.</div>';
}
?>
<!-- end other avtivity -->
<!-- business POS,UPI Details details -->
<?php
if($pd_master_details[0]['product_abbr'] == 'LAEP')
{
if(!strcasecmp($fetchRow['applicant_use_mobile_wallets'],'yes'))
{
echo '<p>As per Person(s) met, the applicant is using Mobile Wallets/UPI for business transactions.</p>';
}//else
//{
// echo '<p>As per person`s met,applicant using Mobile Wallets/UPI for business transactions.</p>'
//}
if(!strcasecmp($fetchRow['applicant_use_pos_machines'],'yes'))
{
echo '<p>The applicant has the following POS machines:</p>';
echo '<table class="scorecard_table">';
echo '<tr> <th>Name of the Financial Insitution</th> <th>TID Number of POS machine</th> </tr>';
foreach($fetchRow['pos_machines_details'] as $pos)
{
echo '<tr> <td class="customtd">'.($pos['pos_machines_financial_institution_name'] ? $pos['pos_machines_financial_institution_name'] : 'Not Provided').'</td> <td class="customtd">'.(is_numeric($pos['tid_no_of_pos_machine']) ? $pos['tid_no_of_pos_machine'] : 'Not Provided').'</td> </tr>';
}
echo '</table>';
}
}
?>
<!-- End of business POS,UPI Details details -->
<!-- start this is business peak details -->
<?php
//
if(array_key_exists('business_peak_details',$fetchRow)){ ?>
<div><p><?php echo $fetchRow['business_peak_details'];?></p></div>
<?php } ?>
<!-- end business peak period details -->
<!-- start company employee details -->
<p><?php echo $fetchRow['company_employees'];?></p>
<p><?php if(isset($fetchRow['employees_appx_salary']) && $fetchRow['employees_appx_salary'] != "") { echo $fetchRow['employees_appx_salary']; }?></p>
<p><?php echo $fetchRow['officer_visit_company_employees'];?></p>
<!-- end company employee details -->
<!-- start documents details -->
<?php if(count($fetchRow['visit_documents'])) {
//print_r($fetchRow['visit_documents']);
?>
<p>The below documents were sighted during the visit :</p>
<table>
<!--Gallary Started -->
<?php
$visit_documents = ($fetchRow['visit_documents']);
//print_r($visit_documents);
$visit_documents_row_count = ceil(count($fetchRow['visit_documents'])/2);
//echo count($visit_documents);
//echo $visit_documents_row_count;
$from_index_increment = 0;
for($vrc = 1;$vrc <= $visit_documents_row_count;$vrc++)
{
$from = $from_index_increment;
$to = ($from + 1);
echo '<tr>';
for ($doc = $from; $doc <= $to ; $doc++){
if(isset($visit_documents[$doc])){
?>
<td>
<div class="gallery">
<img src="<?php echo $visit_documents[$doc]['img']; ?>" alt="" width="300" height="300">
<div class="desc"><?php echo $visit_documents[$doc]['name']?></div>
</div>
</td>
<?php
}
}
echo '</tr>';
$from_index_increment = $from_index_increment+2;
} ?>
</table>
<!--Gallary Ended -->
<?php
//
}
if($business_form_common_remarks != "")
{
echo '<p>'.$business_form_common_remarks.'</p>';
}
?>
<!-- end documents details -->
<?php }
}// ENd of If current business available in current index
//?>
<div class="page_break"> </div>
<!-- #################End OF Business section############################### -->
<!-- #################Start of Future Plan and Business Environment #################-->
<?php
if(isset($pd_processed_forms[23][$business_count]))
{
$future_plan_business_environment = json_decode($pd_processed_forms[23][$business_count]['processed_json'],true);?>
<h3 contenteditable="true">Future Plan and Business Environment</h3>
<table class="scorecard_table">
<thead>
<tr> <th>Particulars</th> <th>Details</th> </tr>
</thead>
<tbody>
<?php
echo '<tr><td>USP of the business (How applicants business is different from others in the business)</td><td>'.$future_plan_business_environment['usp_of_the_business'].'</td></tr>';
echo '<tr><td>Future plan for business expansion</td><td>'.$future_plan_business_environment['future_plans_for_business_expansion'].'</td></tr>';
echo '<tr><td>Impact of GST on business</td><td>'.$future_plan_business_environment['impact_of_gst_on_the_business'].'</td></tr>';
echo '<tr><td>Key competitors in the business</td><td>'.$future_plan_business_environment['key_competitors'].'</td></tr>';
echo '<tr><td>Succession Plan for business</td><td>'.$future_plan_business_environment['succession_plan'].'</td></tr>';
echo '<tr><td>Brief of other group concerns/ Business run by the applicant</td><td>'.$future_plan_business_environment['brief_of_other_group_concerns_or_businesses_run_by_the_applicants'].'</td></tr>';
?>
</tbody>
</table>
<?php
if($future_plan_business_environment['remarks'] != "")
{
echo '<br>';
echo '<p>'. $future_plan_business_environment['remarks'] .'</p>';
}
}
?>
<!-- #################End of Future Plan and Business Environment #################-->
<!-- #################start business asset #################-->
<?php
//
$businessAssetResult=array();
$is_business_asset_available = null;
if(isset($pd_processed_forms[22][$business_count]))
{
$baRow = $pd_processed_forms[22][$business_count];
$businessAssetRow = json_decode($baRow['processed_json'],true);
$is_business_asset_available = $businessAssetRow['asset_info_available'];
$business_assets_form_remark = $businessAssetRow['business_assets_form_remark'];
$bindBusinessAsset["company_name"] ='Assets used for ';
$bindBusinessAsset["company_name"] .=MYUTIL::findCompanyName($all_company_details,$businessAssetRow['company_id'],1);
$bindBusinessAsset["company_name"] .=' Business :';
if(count($businessAssetRow['business_assets_details'])>0 && $is_business_asset_available ){
$bindBusinessAsset['details']=ASSETSFORM::getBusinessAssetsDetails($businessAssetRow['business_assets_details'],$pd_master_details[0]['pd_id']);
}
array_push($businessAssetResult,$bindBusinessAsset);
// print_r($businessAssetResult);
?>
<div class="page_break"> <div>
<br>
<h3 contenteditable="true">Assets used in Business</h3>
<?php if( $is_business_asset_available ){
foreach($businessAssetResult as $iterateAsset){ ?>
<?php
if(isset($iterateAsset['details']) && count($iterateAsset['details']))
{
echo $iterateAsset['company_name']; ?></p>
<?php
foreach ($iterateAsset['details'] as $key => $value) {
echo '<table class="scorecard_table">';
echo '<body>';
echo $value['header_row']; ?>
<tbody>
<?php
echo $value['first_row'];
echo $value['sec_row'];
echo $value['third_row'];
echo $value['fourth_row'];
echo $value['fifth_row'];
echo $value['sixth_row'];
if($pd_master_details[0]['product_abbr'] != 'BL' && $pd_master_details[0]['product_abbr'] != 'LAEP')
{
echo $value['seventh_row'];
echo $value['eighth_row'];
}
echo '</tbody>';
echo '</table>';
echo '<br>';
}
}
}
}
else
{
echo '<p> No other assests used for business.</p>';
}
if($business_assets_form_remark != "" ){ echo '<p>'.$business_assets_form_remark.'</p>'; }
} // ENd of if business assesst available in this current index
?>
<?php
//?>
<!-- #################end business asset #################-->
<!-- #################start business financial #################-->
<div class='page_break'></div>
<?php
$businessFinancialResult = array();
$financial_kuccha_info = array();
$current_business_info = array();// only for IndusInd Lender
$profit_loss_symbal = '<span style="font-family:DejaVu Sans; sans-serif;color:green;">↑</span> /<span style="font-family:DejaVu Sans; sans-serif;color:red;">↓</span>';
if(isset($pd_processed_forms[14][$business_count]))
{
$baRow = $pd_processed_forms[14][$business_count];
$businessFinancialRow = json_decode($baRow['processed_json'],true);
//$businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales'];
$financial_remarks = $businessFinancialRow['financial_remarks'];
$comments_on_financials = isset($businessFinancialRow['financial_reason']) ? $businessFinancialRow['financial_reason'] : '';
//echo $financial_remarks;die();
// statementdate_per_financial
if(isset($businessFinancialRow['kuccha_records_shown']))
{
$financial_kuccha_info['kuccha_records_shown'] = $businessFinancialRow['kuccha_records_shown'];
$financial_kuccha_info['kuccha_bill_allowed'] = $businessFinancialRow['kuccha_bill_allowed'];
$financial_kuccha_info['customer_declared_turnover'] = $businessFinancialRow['customer_declared_turnover'];
}
//only for Indusind Lender
if(isset($businessFinancialRow['tot_business_FY']))
{
$current_business_info['tot_business_FY'] = $businessFinancialRow['tot_business_FY'];
$current_business_info['remarks_tot_business_FY'] = $businessFinancialRow['remarks_tot_business_FY'];
$current_business_info['orders_hand_FY'] = $businessFinancialRow['orders_hand_FY'];
}
//print_r($financial_kuccha_info);die();
if(strtoupper($businessFinancialRow['is_financial_statements'])=='YES' && count($businessFinancialRow['date_per_financial'])>0){
$bindBusinessFinancial["company_name"] = MYUTIL::findCompanyName($all_company_details,$businessFinancialRow['company_id'],1);
//$bindBusinessFinancial["company_name"] .= count($businessFinancialRow['date_per_financial'])>1 ? ' provided with last '.count($businessFinancialRow['date_per_financial']).' years of financial statements and the snapshot is as below :' : ' we were provided with last '.count($businessFinancialRow['date_per_financial']).' year of financial statements and the snapshot is as below :';
$bindBusinessFinancial["years_data_provided"] = count($businessFinancialRow['date_per_financial']);
$bindBusinessFinancial['is_statement']= 1;
$bindBusinessFinancial['statements']=FINANCIALFORM::getBusinessFinancialDetails($businessFinancialRow['date_per_financial']);
}
else {
$bindBusinessFinancial["company_name"] =MYUTIL::findCompanyName($all_company_details,$businessFinancialRow['company_id'],1);
$bindBusinessFinancial["years_data_provided"] = 0;
$bindBusinessFinancial['statements']=array();
$bindBusinessFinancial['is_statement']= 0;
}
// customer
if(strtoupper($businessFinancialRow['is_financial_customer'])!='YES' && (!isset($businessFinancialRow['estimated_value']))){
$bindBusinessFinancial["financial_customer"] ="";
//$bindBusinessFinancial["financial_customer"] ="As per Loan Applicant(s) met, the financials are as below :";
$bindBusinessFinancial['customer_statements']=array();
$bindBusinessFinancial['customer_statements_header']=array();
$bindBusinessFinancial['is_customer_statement'] = 0;
}
else if(strtoupper($businessFinancialRow['is_financial_customer'])!='YES' && count($businessFinancialRow['estimated_value'])>0)
{
$bindBusinessFinancial["financial_customer"] ="";
//$bindBusinessFinancial["financial_customer"] ="As per Loan Applicant(s) met, the financials are as below :";
$bindBusinessFinancial['customer_statements']=FINANCIALFORM::getBusinessCustomerFinancialDetails($businessFinancialRow['estimated_value']);
$bindBusinessFinancial['customer_statements_header']=FINANCIALFORM::getBusinessCustomerHeader($businessFinancialRow['estimated_value']);
$bindBusinessFinancial['is_customer_statement'] = 1;
}
else {
$bindBusinessFinancial["financial_customer"] ="As per Loan Applicant(s) met, the actual turnover and net profit of his business is same as disclosed in financial statements.";
$bindBusinessFinancial['customer_statements']=array();
$bindBusinessFinancial['customer_statements_header']=array();
$bindBusinessFinancial['is_customer_statement'] = 0;
}
$bindBusinessFinancial['working_capital_receive'] = $businessFinancialRow['receive_the_money_in_days'];
$bindBusinessFinancial['working_capital_pay'] = $businessFinancialRow['pay_the_money_in_days'];
$bindBusinessFinancial['working_capital_unsold_stock'] = is_numeric($businessFinancialRow['unsold_stock_lies_in_days'])? $businessFinancialRow['unsold_stock_lies_in_days'] : 'Data Not Provided';
$bindBusinessFinancial['is_working_capital_facility'] = $businessFinancialRow['is_there_working_capital_available'];
if(isset($businessFinancialRow['select_working_capital_facilities_availed']))
{
foreach($businessFinancialRow['select_working_capital_facilities_availed'] as $k => $v)
{
switch($v['id'])
{
case 1:
$businessFinancialRow['select_working_capital_facilities_availed'][$k]['name'] = $businessFinancialRow['other_reason_for_working_capital_facilities_availed'];
$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['reason_for_working_capital_facilities_availed'];
break;
case 2:
$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['bank_guarantee'];
break;
case 3:
$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['cash_credit_limit'];
break;
case 4:
$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['factoring'];
break;
case 5:
$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['factoring'];
break;
case 6:
$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['letter_of_credit'];
break;
case 7:
$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['od_limit'];
break;
}
}
}
$bindBusinessFinancial['working_capital_facilites'] = isset($businessFinancialRow['select_working_capital_facilities_availed']) ? $businessFinancialRow['select_working_capital_facilities_availed'] : null;
$bindBusinessFinancial['estimate_posmachine_or_cc_annual_sales'] = isset($businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales']) ? $businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales'] : null;
//print_r($bindBusinessFinancial['select_working_capital_facilities_availed']); //FINANCIALFORM::getAvailableFacilities($businessFinancialRow[-'"working_capital_facilities_availed']);
array_push($businessFinancialResult,$bindBusinessFinancial);
?>
<?php
//print_r($businessFinancialResult);die();
if(count($businessFinancialResult)>0){
?>
<h3 contenteditable="true">Financial Information</h3>
<?php foreach($businessFinancialResult as $iterateFinance){
if($iterateFinance['is_statement'])
{
if(count($iterateFinance['statements'])>0){
?>
<p><?php echo "<strong>Company / Firm Name : </strong>" . $iterateFinance['company_name']; ?></p>
<p><?php echo "<strong>No of Years of Financial Statements provided : </strong>" . $iterateFinance['years_data_provided']; ?></p>
<p><?php echo "<strong>Snapshot of Financials as per Books of Account Provided : </strong>"; ?></p>
<?php ?>
<table class="scorecard_table">
<thead>
<tr>
<th>Particulars</th><?php foreach($iterateFinance['statements'] as $bfRow){ echo "<th>"."FY ".$bfRow['financial_year']."</th>";}?>
</tr>
</thead>
<tbody>
<tr><td>Sales / Revenue (Rs)</td> <?php foreach($iterateFinance['statements'] as $bfRow){ echo '<td style="text-align:center;">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($bfRow['financial_sales_revenue']).'</td>';}?> </tr>
<tr><td>Net Profit / <span style="color:red;">(Net Loss)</span> (Rs)</td> <?php foreach($iterateFinance['statements'] as $bfRow){ if($bfRow['financial_net_profit_mode'] == 1){ echo '<td style="text-align:center;color:green;">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($bfRow['financial_net_profit']).'</td>';}else{ echo '<td style="text-align:center;color:red;">('.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($bfRow['financial_net_loss']).')</td>'; } }?></tr>
<tr><td>Net Profit or <span style="color:red;">(Net Loss)</span> to Sales %</td> <?php foreach($iterateFinance['statements'] as $bfRow){ if($bfRow['financial_net_profit_mode'] == 1) {echo '<td style="text-align:center;color:green;">'.$bfRow['financial_margin_of_profit'].' %</td>';}else { echo '<td style="text-align:center;color:red;">('.$bfRow['financial_margin_of_loss'].' %)</td>'; } }?></tr>
<tr><td>% (<?php echo $profit_loss_symbal;?>) in Sales over PY</td>
<?php foreach($iterateFinance['statements'] as $bfRow)
{
if($bfRow['sale_variation'] != "" || $bfRow['sale_variation'] != null)
{
echo $bfRow['sale_variation'] >= 0 ? '<td style="text-align:center;color:green;">'.$bfRow['sale_variation'].' %</td>' : '<td style="text-align:center;color:red;">('.$bfRow['sale_variation'].' %)</td>';
}else { echo '<td style="text-align:center;">NA</td>';}?>
<?php }?>
</tr>
<tr><td>% (<?php echo $profit_loss_symbal;?>) in Net Profit over PY</td>
<?php
foreach($iterateFinance['statements'] as $bfRow)
{
if($bfRow['profit_variation'] != "" || $bfRow['profit_variation'] != null)
{ echo $bfRow['profit_variation'] >= 0 ? '<td style="text-align:center;color:green;">'.$bfRow['profit_variation'].' %</td>' :'<td style="text-align:center;color:red;">('.$bfRow['profit_variation'].')</td>';
}else
{echo '<td style="text-align:center;">NA</td>';} }?> </tr>
<tr><td>% (<?php echo $profit_loss_symbal;?>) in Net Profit % over PY</td>
<?php
foreach($iterateFinance['statements'] as $bfRow)
{
if($bfRow['financial_profit_to_sale_variation'] != "" || $bfRow['financial_profit_to_sale_variation'] != null)
{
echo $bfRow['financial_profit_to_sale_variation'] >= 0 ? '<td style="text-align:center;color:green">'.$bfRow['financial_profit_to_sale_variation'].' %</td>' : '<td style="text-align:center;color:red">('.$bfRow['financial_profit_to_sale_variation'].' %)</td>';
}else { echo '<td style="text-align:center;">NA</td>';}}?> </tr>
</tbody>
</table>
<?php
echo '<br><p>' . $comments_on_financials . '</p>';
}
}
else{ echo "<p>Financial statements not provided by Loan Applicants to PD officer. </p>";}
?>
<!-- customer finance statements-->
<p><?php echo $iterateFinance['financial_customer']; ?></p>
<?php
if($iterateFinance['is_customer_statement'])
{
if(count($iterateFinance['customer_statements'])>0){
//print_r($iterateFinance['customer_statements']);
?>
<?php foreach($iterateFinance['customer_statements'] as $csRow){
if(!strcasecmp($csRow['estimate_net_margin_availablity'],'yes')){
?>
<p> As per Loan Applicant(s) met, the Financials are as below: </p>
<table class="scorecard_table">
<thead>
<tr>
<th rowspan=2>Particulars</th> <th colspan=2>Range provided</th> <th rowspan=2>Final Considered</th>
</tr>
<tr> <th>From</th> <th>To</th> </tr>
</thead>
<tbody>
<tr>
<td>Sales / Revenue (Rs)</td> <td class="customtd"><?php echo MYUTIL:: customIndianNumberFormat($csRow['estimate_sales_from']) ?></td><td class="customtd"><?php echo MYUTIL:: customIndianNumberFormat($csRow['estimate_sales_to']) ?></td><td class="customtd"><?php echo MYUTIL:: customIndianNumberFormat($csRow['estimate_sales_average']) ?></td>
</tr>
<tr>
<td>Net Profit or (Net Loss) to Sales %</td> <td class="customtd"><?php echo MYUTIL:: customIndianNumberFormat($csRow['net_profit_loss_sales_per_from']).'%' ?></td><td class="customtd"><?php echo MYUTIL:: customIndianNumberFormat($csRow['net_profit_loss_sales_per_to']).'%' ?></td><td class="customtd" <?php echo $csRow['estimate_profit_or_loss'] ? "style='color:green'" : "style='color:green'";?> ><?php echo MYUTIL:: customIndianNumberFormat($csRow['net_profit_loss_sales_final_per']).'%' ?></td>
</tr>
<tr>
<td colspan=3>Net Profit / (Net Loss) (Rs) >>>></td> <td class="customtd" <?php echo $csRow['estimate_profit_or_loss'] ? "style='color:green'" : "style='color:green'";?>><?php echo MYUTIL::customIndianNumberFormat($csRow['net_profit_loss_sales_final_rs']) ?></td>
</tr>
</tbody></table>
<?php } else{ ?>
<table class="scorecard_table">
<thead>
<tr>
<th rowspan=2>Particulars</th> <th colspan=2>Range provided</th> <th rowspan=2>Final Considered</th>
</tr>
<tr> <th>From</th> <th>To</th> </tr>
</thead>
<tbody>
<tr>
<td>Sales / Revenue (Rs)</td> <td class="customtd"><?php echo MYUTIL::customIndianNumberFormat($csRow['estimate_sales_from']) ?></td><td class="customtd"><?php echo MYUTIL::customIndianNumberFormat($csRow['estimate_sales_to']) ?></td><td class="customtd"><?php echo MYUTIL::customIndianNumberFormat($csRow['estimate_sales_average']) ?></td>
</tr>
<tr>
<td>Net Profit or (Net Loss) to Sales (Rs) </td> <td class="customtd"><?php echo MYUTIL::customIndianNumberFormat($csRow['net_profit_loss_sales_per_from']) ?></td><td class="customtd"><?php echo MYUTIL::customIndianNumberFormat($csRow['net_profit_loss_sales_per_to']) ?></td><td class="customtd" <?php echo $csRow['estimate_profit_or_loss']? "style='color:green'" : "style='color:green'";?> ><?php echo MYUTIL:: customIndianNumberFormat($csRow['net_profit_loss_sales_final_per']) ?></td>
</tr>
<tr>
<td colspan=3> Net Profit / (Net Loss)% >>>> </td> <td class="customtd" <?php echo $csRow['estimate_profit_or_loss'] ? "style='color:green'" : "style='color:green'";?> ><?php echo MYUTIL:: customIndianNumberFormat($csRow['net_profit_loss_sales_final_rs']).'%' ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php
if($iterateFinance['estimate_posmachine_or_cc_annual_sales'] != null)
{
echo '<p>As per Loan Applicant(s) met,'. $rupee_symbol . ' '. MYUTIL:: customIndianNumberFormat($iterateFinance['estimate_posmachine_or_cc_annual_sales']) .' as Annual sales through credit cards / POS machines.</p>';
};
} ?>
<?php }
}//else { echo "<p> As per Loan Applicant(s) met, the financials figures were not provided. </p>"; }
?>
<?php
//echo $iterateFinance['working_capital_receive'].$iterateFinance['working_capital_pay'].$iterateFinance['working_capital_unsold_stock'];
} ?>
<?php
if(count($financial_kuccha_info))
{
echo '<p><strong>Validation of Customer Declared Financials :</strong></p>';
echo 'Kuccha Record Seen (Yes/No) : ';echo $financial_kuccha_info['kuccha_records_shown'] == 'yes' ? 'Yes' : 'No Kuccha Records made available to PD officer and therefore validation of customer declared financials was not possible.';
if($financial_kuccha_info['kuccha_records_shown'] == 'yes')
{
echo '<br><br>Photograph of Kuchha Bills Allowed (Yes/No) : '. ($financial_kuccha_info['kuccha_bill_allowed'] == 'yes' ? 'Yes, enclosed with report': 'No');
echo '<br><br>Number of Kuccha Bills and Values therein, justifies the customer declared turnover (Yes / No): '. ( $financial_kuccha_info['customer_declared_turnover'] == 'yes' ? 'Yes': 'No');
}
}
//only for Indusind Lender
if(count($current_business_info))
{
echo '<p><strong>Current Business :</strong></p>';
echo 'Approximate Total Business / Sales Done for Current FY as on date is '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($current_business_info['tot_business_FY']);
echo $current_business_info['remarks_tot_business_FY'] != "" ? ' ( '. $current_business_info['remarks_tot_business_FY'] .' ) ': '';
echo '<br>Orders in Hand to be executed in Current FY : '. $current_business_info['orders_hand_FY'];
}
?>
<p><strong>Working Capital Cycle:</strong></p>
<table class="scorecard_table">
<thead> <tr> <th>S.No</th> <th>Particulars</th> <th>Days</th> </tr> </thead>
<tbody>
<tr> <td class="customtd">1</td> <td class="customtd">Debtor Days</td> <td class="customtd"><?php echo isset($iterateFinance['working_capital_receive']) && is_numeric($iterateFinance['working_capital_receive']) ? $iterateFinance['working_capital_receive'] :"Data Not provided"?></td> </tr>
<tr> <td class="customtd">2</td> <td class="customtd">Creditor Days</td> <td class="customtd"><?php echo isset($iterateFinance['working_capital_pay']) && is_numeric($iterateFinance['working_capital_pay']) ? $iterateFinance['working_capital_pay'] : "Data Not Provided"?></td></tr>
<tr> <td class="customtd">3</td> <td class="customtd">Stock Days</td> <td class="customtd"><?php echo $iterateFinance['working_capital_unsold_stock']?></td></tr>
</tbody>
</table>
<?php if($iterateFinance['is_working_capital_facility'] != "" ){ ?>
<p><strong>Working Capital Facilities:</strong></p>
<?php if(strcasecmp($iterateFinance['is_working_capital_facility'],'no')){?>
<table class="scorecard_table">
<thead> <tr> <th>S.No</th> <th>Facility Type</th> <th>Facility Details</th> </tr> </thead>
<tbody>
<?php foreach($iterateFinance['working_capital_facilites'] as $fk => $facility){
echo '<tr> <td class="customtd">'.(++$fk) .'</td><td class="customtd">'.$facility['name'].'</td> <td class="customtd">'.$facility['details'].'</td></tr>';
}?>
</tbody>
</table>
<?php }else{echo "<p>The Loan Applicants have not availed any Working Capital Facilities from any financial institution.<p>";}
}
?>
<?php
if($financial_remarks != ""){ echo '<p>'. $financial_remarks.'</p>'; }
}
else {?>
<p>Financial information is not available.</p>
<?php }
} //ENd of finance available in this current index
//?>
<!--################# end business financial #################-->
<!-- start business banking section -->
<?php
$bankingResult=array();
$is_business_banking_available = null;
if(isset($pd_processed_forms[21][$business_count]))
{
// business banking
$bbRow = $pd_processed_forms[21][$business_count] ;
$businessBankRow = json_decode($bbRow['processed_json'],true);
$business_banking_common_remarks = $businessBankRow['banking_form_remark'];
//print_r($businessBankRow);die();
if(isset($businessBankRow['bank_info_available']) && $businessBankRow['bank_info_available'] == 1)
{
$is_business_banking_available = 1;
if(count($businessBankRow['banking_details'])>0){
$getEachValues['is_od_cc'] = null;
foreach($businessBankRow['banking_details'] as $bd){ if($bd['account_type']== 4 || $bd['account_type']== 3){ $getEachValues['is_od_cc'] = true; } }
$getEachValues['bankDetails']=BANKINGFORM::getBusinessBankingDetails($businessBankRow['banking_details'],$pd_master_details[0]['pd_id']);
$bankingResult = array_merge($bankingResult,$getEachValues);
}
}
?>
<?php
echo '<h3 contenteditable="true">Business Banking:</h3>';
if($is_business_banking_available != null){ ?>
<table class="scorecard_table">
<thead>
<tr>
<th>Account Name</th>
<th>Bank Name</th>
<th>Account Type</th>
<th>Account Vintage</th>
<?php if($getEachValues['is_od_cc']){?>
<th>OD/CC Limit(Rs)</th>
<?php }?>
<th>Main Business A/c</th>
</tr>
</thead>
<tbody>
<?php foreach($bankingResult['bankDetails'] as $bdRow){
if($bdRow['account_name'] != '')
{
?>
<tr>
<td><?php echo $bdRow['account_name'] ?></td>
<td class="customtd"><?php echo $bdRow['bank_name'] ?></td>
<td class="customtd"><?php echo $bdRow['account_type'] ?></td>
<td class="customtd"><?php echo $bdRow['vintage'] ?></td>
<?php if($getEachValues['is_od_cc']){?>
<td class="customtd"><?php echo $bdRow['od_cc_limit'] ?></td>
<?php } ?>
<td class="customtd"><?php echo $bdRow['main_business'] ?></td>
</tr>
<?php }
}?>
</tbody>
</table>
<?php }
else
{
echo '<p>As per person met, Applicant does not have any business account.</p>';
}
if($business_banking_common_remarks != ""){ echo '<p>'.$business_banking_common_remarks.'</p>'; }
}// end of busienss bankDetails available in this currrent index
?>
<!-- #################end business banking section #################-->
<!-- #################client section start #################-->
<?php
$clientResult=array();
$client_form_remarks = '';
// this is for manufacturing
//global $client_first_row;
$client_first_row = '';
$client_second_row = '';
$client_third_row = '';
$client_fourth_row = '';
$client_fifth_row = '';
$client_sixth_row = '';
$client_seventh_row = '';
$client_eigth_row = '';
$to_no_of_clients = 0;
$done_on_credit = array();
$name_of_the_company = '';
$is_client_details_available = null;
if(isset($pd_processed_forms[2][$business_count]))
{
$cRow = $pd_processed_forms[2][$business_count];
$clientRow = json_decode($cRow['processed_json'],true);
$client_form_remarks = isset($clientRow['supplier_info_form_remark']) ? $clientRow['supplier_info_form_remark'] : '';
if(isset($clientRow['client_info_available']) && $clientRow['client_info_available'] == 1)
{
$is_client_details_available = 1;
$name_of_the_company = MYUTIL::findCompanyName($all_company_details,$clientRow['company_id'],1);
// $bindEachResult["company_name"]=MYUTIL::findCompanyName($all_company_details,$clientRow['company_id'],1);
// $getmanufacturing = array();
// $getTrading=array();
// $getService=array();
//$getTotalPaymentsPercentonCredit=array();
$client_first_row = '<tr><td class="customtd">1</td><td class="customtd">Product / Service </td>';
$client_second_row = '<tr><td class="customtd">2</td><td class="customtd">Client Name </td>';
$client_third_row = '<tr><td class="customtd">3</td><td class="customtd">Mobile Number </td>';
$client_fourth_row = '<tr><td class="customtd">4</td><td class="customtd">Landline No</td>';
$client_fifth_row = '<tr><td class="customtd">5</td><td class="customtd">Payment Terms</td>';
$client_sixth_row = '<tr><td class="customtd">6</td><td class="customtd">Payment Mode</td>';
$client_seventh_row = '<tr><td class="customtd">7</td><td class="customtd">No of Days Credit</td>';
$client_eigth_row = '<tr><td class="customtd">8</td><td class="customtd">Contribution to Total Turnover in %</td>';
// this is for manufacturing
if(array_key_exists('manufacturing_details',$clientRow)){
$clientRow['manufacturing_details'][0]['main_raw_materials_total_payments_percent_on_credit'] ? $done_on_credit['manufacturing prodcuts'] = $clientRow['manufacturing_details'][0]['main_raw_materials_total_payments_percent_on_credit'] : '';
foreach($clientRow['manufacturing_details'] as $manuRow){
if(isset($manuRow['main_raw_materials'])){
//$to_no_of_clients += count($manuRow['main_raw_materials']);
foreach($manuRow['main_raw_materials'] as $main_raw_material_key => $main_raw_material)
{
if($main_raw_material['manufacturing_product_name'] != "" || $main_raw_material['manufacturing_product_name'] != null)
{
$to_no_of_clients ++;
}
//print_r($main_raw_material);
$client_first_row .= '<td class="customtd">'.$main_raw_material['manufacturing_product_name'].'</td>';
$client_second_row .= isset($main_raw_material['person_title_name_master']) ? '<td class="customtd">' . $main_raw_material['person_title_name_master'].' ': '<td class="customtd">';
$client_second_row .= $main_raw_material['manufacturing_contact_person_name'] ;
$client_second_row .= isset($main_raw_material['person_designation']) && $main_raw_material['person_designation']== 1 ? ' '.$main_raw_material['other_person_designation'] : ' ';//
$client_second_row .= isset($main_raw_material['person_designation_master']) && $main_raw_material['person_designation'] != 1? $main_raw_material['person_designation_master'] : '' ;
$client_second_row .= ' '.$main_raw_material['manufacturing_client_name'].'</td>';
$client_third_row .= '<td class="customtd">'.($main_raw_material['manufacturing_contact_person_mobile_number'] ? $main_raw_material['manufacturing_contact_person_mobile_number'].'</td>' : 'Not Provided' .'</td>');
$client_fourth_row .= $main_raw_material['person_stdcode'] && $main_raw_material['person_landline'] ? '<td class="customtd">'. $main_raw_material['person_stdcode'].' '.$main_raw_material['person_landline'].'</td>' : '<td class="customtd">'.'Not Provided'.'</td>';
$client_fifth_row .= isset($main_raw_material['manufacturing_payment_type_master']) && $main_raw_material['manufacturing_payment_type_master'] ? '<td class="customtd">'. $main_raw_material['manufacturing_payment_type_master'] .'</td>' : '<td class="customtd">NA</td>';
$client_sixth_row .= $main_raw_material['manufacturing_payment_mode'] ? '<td class="customtd">'. $main_raw_material['manufacturing_payment_mode'] .'</td>' : '<td class="customtd">NA</td>';;
$client_seventh_row .= $main_raw_material['manufacturing_credit_days_from'] && $main_raw_material['manufacturing_credit_days_to'] ? '<td class="customtd">'. $main_raw_material['manufacturing_credit_days_from'].' to '. $main_raw_material['manufacturing_credit_days_to'].' days'.'</td>' :'<td class="customtd"> NA </td>' ;
$client_eigth_row .= isset($main_raw_material['manufacturing_contribution_total_turnover']) && $main_raw_material['manufacturing_contribution_total_turnover'] != "" ? '<td class="customtd">'. $main_raw_material['manufacturing_contribution_total_turnover'].'</td>' :'<td class="customtd"> Not Provided </td>' ;
}
}
}
}
// this is for trading
if(array_key_exists('trade_details',$clientRow)){
//$done_on_credit += $clientRow['trade_details'][0]['trading_products_total_payments_percent_on_credit'];
$clientRow['trade_details'][0]['trading_products_total_payments_percent_on_credit'] ? $done_on_credit['trading products'] = $clientRow['trade_details'][0]['trading_products_total_payments_percent_on_credit'] : '';
foreach($clientRow['trade_details'] as $tradeRow){
if(isset($tradeRow['trading_products'])){
//$to_no_of_clients += count($tradeRow['trading_products']);
foreach($tradeRow['trading_products'] as $trading_product_key => $trading_product)
{
if($trading_product['trade_product_name'] != "" || $trading_product['trade_product_name'] != null)
{
$to_no_of_clients++;
}
$client_first_row .= '<td class="customtd">'.$trading_product['trade_product_name'].'</td>';
$client_second_row .= isset($trading_product['person_title_name_master']) ? '<td class="customtd">' . $trading_product['person_title_name_master'].' ': '<td class="customtd">';
$client_second_row .= $trading_product['trade_product_contact_person_name'] ;
$client_second_row .= isset($trading_product['person_designation']) && $trading_product['person_designation']== 1 ? ' '.$trading_product['other_person_designation'] : ' ';//
$client_second_row .= isset($trading_product['person_designation_master']) & $trading_product['person_designation'] != 1? $trading_product['person_designation_master'] : '' ;
$client_second_row .= ' '.$trading_product['trade_client_name'].'</td>';
$client_third_row .= '<td class="customtd">'. ($trading_product['trade_product_contact_person_mobile_number'] ? $trading_product['trade_product_contact_person_mobile_number'].'</td>' : 'Not Provided'.'</td>');
$client_fourth_row .= $trading_product['person_stdcode'] && $trading_product['person_landline'] ? '<td class="customtd">'. $trading_product['person_stdcode'].' '.$trading_product['person_landline'].'</td>' : '<td class="customtd">'.'Not Provided'.'</td>';
$client_fifth_row .= isset($trading_product['trade_product_payment_type_master']) ? '<td class="customtd">'. $trading_product['trade_product_payment_type_master'] .'</td>' : '<td class="customtd">NA</td>';
$client_sixth_row .= $trading_product['trade_product_payment_mode'] ? '<td class="customtd">'. $trading_product['trade_product_payment_mode'] .'</td>' : '<td class="customtd">NA</td>';;
$client_seventh_row .= $trading_product['trade_product_credit_days_from'] && $trading_product['trade_product_credit_days_to']? '<td class="customtd">'. $trading_product['trade_product_credit_days_from'].' to '. $trading_product['trade_product_credit_days_to'].' days'.'</td>' :'<td class="customtd"> NA </td>' ;
$client_eigth_row .= isset($trading_product['trade_product_contribution_total_turnover']) && $trading_product['trade_product_contribution_total_turnover'] != "" ? '<td class="customtd">'. $trading_product['trade_product_contribution_total_turnover'].'</td>' :'<td class="customtd"> Not Provided </td>' ;
}
}
}
}
//this is for service
if(array_key_exists('service_provider_details',$clientRow)){
//$done_on_credit += $clientRow['service_provider_details'][0]['service_products_total_payments_percent_on_credit'];
$clientRow['service_provider_details'][0]['service_products_total_payments_percent_on_credit'] ? $done_on_credit['service providing'] = $clientRow['service_provider_details'][0]['service_products_total_payments_percent_on_credit'] : '';
foreach($clientRow['service_provider_details'] as $serviceRow){
if(isset($serviceRow['service_products'])){
//$to_no_of_clients += count($serviceRow['service_products']);
foreach($serviceRow['service_products'] as $service_product_key => $service_product)
{
if($service_product['service_provider_product_name'] != "" || $service_product['service_provider_product_name'] != null)
{
$to_no_of_clients++;
}
$client_first_row .= '<td class="customtd">'.$service_product['service_provider_product_name'].'</td>';
$client_second_row .= isset($service_product['person_title_name_master']) ? '<td class="customtd">' . $service_product['person_title_name_master'].' ': '<td class="customtd">';
$client_second_row .= $service_product['service_provider_product_contact_person_name'] ;
$client_second_row .= isset($service_product['person_designation']) && $service_product['person_designation']== 1 ? ' '.$service_product['other_person_designation'] : ' ';//
$client_second_row .= isset($service_product['person_designation_master']) && $service_product['person_designation'] != 1 ? $service_product['person_designation_master'] : '' ;
$client_second_row .= ' '.$service_product['service_provider_client_name'].'</td>';
$client_third_row .= '<td class="customtd">'. ($service_product['service_provider_product_contact_person_mobile_number'] ? $service_product['service_provider_product_contact_person_mobile_number'].'</td>' : 'Not Provided' .'</td>');
$client_fourth_row .= $service_product['person_stdcode'] && $service_product['person_landline'] ? '<td class="customtd">'. $service_product['person_stdcode'].' '.$service_product['person_landline'].'</td>' : '<td class="customtd">'.'Not Provided'.'</td>';
$client_fifth_row .= $service_product['service_provider_product_payment_type_master'] ? '<td class="customtd">'. $service_product['service_provider_product_payment_type_master'] .'</td>' : '<td class="customtd">NA</td>';
$client_sixth_row .= $service_product['service_provider_product_payment_mode'] ? '<td class="customtd">'. $service_product['service_provider_product_payment_mode'] .'</td>' : '<td class="customtd">NA</td>';
$client_seventh_row .= $service_product['service_provider_product_credit_days_from'] && $service_product['service_provider_product_credit_days_to']? '<td class="customtd">'. $service_product['service_provider_product_credit_days_from'].' to '. $service_product['service_provider_product_credit_days_to'].' days'.'</td>' :'<td class="customtd"> NA </td>' ;
$client_eigth_row .= isset($service_product['service_provider_contribution_total_turnover']) && $service_product['service_provider_contribution_total_turnover'] != "" ? '<td class="customtd">'. $service_product['service_provider_contribution_total_turnover'].'</td>' :'<td class="customtd"> Not Provided </td>' ;
}
}
}
}
}
$client_first_row .= '</tr>';
$client_second_row .= '</tr>';
$client_third_row .= '</tr>';
$client_fourth_row .= '</tr>';
$client_fifth_row .= '</tr>';
$client_sixth_row .= '</tr>';
$client_seventh_row .= '</tr>';
$client_eigth_row .= '</tr>';
//echo $client_third_row;
?>
<?php
echo '<h3 contenteditable="true">Client Details</h3>';
if($is_client_details_available != null)
{
?>
<table class="scorecard_table">
<thead>
<tr>
<th>Sr.No</th>
<th>Particulars</th>
<?php for($i = 1; $i <= $to_no_of_clients; $i++){
echo "<th>Client $i</th>";
}?>
</tr>
</thead>
<tbody>
<?php echo $client_first_row?>
<?php echo $client_second_row?>
<?php echo $client_third_row?>
<?php echo $client_fourth_row?>
<?php
if($pd_master_details[0]['lender_short_name'] == 'MWISE')
{
?>
<?php echo $client_fifth_row?>
<?php echo $client_sixth_row?>
<?php echo $client_seventh_row?>
<?php
}
?>
<?php
if($pd_master_details[0]['lender_short_name'] == 'MWISE')
{
echo $client_eigth_row;
}?>
</tbody>
</table>
<?php
//$done_on_credit['test products'] = 96;
if(count($done_on_credit)) {
//print_r($done_on_credit);
$vals = array_values($done_on_credit);$temp = array();$all_same = false;
foreach ($vals as $key => $value)
{
if(count($temp))
{
foreach ($temp as $tk => $tvalue)
{
$value == $tvalue ? $all_same = true : $all_same = false ;array_push($temp, $value);
}
}
else
{
array_push($temp, $value);
}
}
if($all_same)
{ echo "<p> Out of total sales done by ".$name_of_the_company .", ".$vals[0]."% is done on credit.</p>"; }
else
{
$activities = '';
foreach ($done_on_credit as $dkey => $dvalue)
{
$activities .= $dkey.' '.$dvalue.'%, ';
}
$activities = substr_replace($activities,' ', -2);
$activities = substr_replace($activities,' and ',strripos($activities,','),2);
echo "<p> Out of total sales done by ".$name_of_the_company .", ".$activities."are done on credit.</p>";
}
}
//CLient Photo Section
// $client_photo_count = $pd_images[2];
// $client_img_row_count = ceil(count($client_photo_count) / 3);
// if(count($client_photo_count)){
// // echo '<br>';
// // echo '<p>Supplier '.($k+1).' Photograph`s : </p>';
// // echo '<br>';
// echo '<table border="1" height="100%" width="50%">';
// $client_from_index_increment = 0;
// for($img_row = 1; $img_row <= $client_img_row_count; $img_row++)
// {
// echo '<tr>';
// $from = $client_from_index_increment;
// $to = ($from + 2);
// for($client_photo_iter = $from; $client_photo_iter <= $to;$client_photo_iter++)
// {
// if(isset($client_photo_count[$client_photo_iter]) &&$client_photo_count[$client_photo_iter]['company_id'] == ($business_count+1))
// {
// echo '<td>';
// echo '<div class="gallery">';
// echo '<img src="'.$client_photo_count[$client_photo_iter]['doc_url'].'" alt="" width="200" height="200">';
// echo '<div class="desc">'.$client_photo_count[$client_photo_iter]['pd_document_title'].'<br>'.$client_photo_count[$client_photo_iter]['location'].'<br>'. date('Y/m/d h:s:i A',strtotime($client_photo_count[$client_photo_iter]['createdon'])).'</div>';
// echo '</div>';
// echo '</td>';
// //unset($stock_photo_count[$stock_photo_iter]);
// }
// }
// //echo "<br><br><hr>";
// echo '</tr>';
// $client_from_index_increment = $client_from_index_increment + 3;
// }
// //echo '</tbody>';
// echo '</table>';
// }
//End of CLient Photo Section
?>
<?php }
echo '<p>'.$client_form_remarks.'</p>';
} // ENd of client info available in this current index ?>
<!-- #################client section end #################-->
<!-- #################supplier section start #################-->
<?php
//
$supplierResult=array();
$supplier_form_remarks = '';
$is_supplier_details_avaialable = null;
$supplier_first_row = '<tr><td class="customtd">1</td><td class="customtd">Item Purchased </td>';
$supplier_second_row = '<tr><td class="customtd">2</td><td class="customtd">Contact Person </td>';
$supplier_third_row = '<tr><td class="customtd">3</td><td class="customtd">Mobile Number </td>';
$supplier_fourth_row = '<tr><td class="customtd">4</td><td class="customtd">Landline No</td>';
$supplier_fifth_row = '<tr><td class="customtd">5</td><td class="customtd">Payment Terms</td>';
$supplier_sixth_row = '<tr><td class="customtd">6</td><td class="customtd">Payment Mode</td>';
$supplier_seventh_row = '<tr><td class="customtd">7</td><td class="customtd">No of Days Credit</td>';
$supplier_eigth_row = '<tr><td class="customtd">8</td><td class="customtd">Contribution to Total Purchase in %</td>';
if(isset($pd_processed_forms[1][$business_count]))
{
$supplier_details = $pd_processed_forms[1][$business_count];
$supplierRow = json_decode($supplier_details['processed_json'],true);
//print_r($supplierRow);
$supplier_form_remarks = (isset($supplierRow['supplier_info_form_remark']) ? $supplierRow['supplier_info_form_remark'] : '');
if(isset($supplierRow['supplier_info_available']) && $supplierRow['supplier_info_available'] == 1)
{
$is_supplier_details_avaialable = 1;
$company_name_for_supplier_form_dispaly = MYUTIL::findCompanyName($all_company_details,$supplierRow['company_id'],1);
//$supplierResult['company_name'] = $company_name;
$total_no_of_suppliers = 0;
$total_payments_percent_on_credit_for_supplier = 0;
foreach($supplierRow['manufacturing_details'] as $manuRow){
$total_payments_percent_on_credit_for_supplier += isset($supplierRow['manufacturing_details'][0]['main_raw_materials_total_payments_percent_on_credit']) ? $supplierRow['manufacturing_details'][0]['main_raw_materials_total_payments_percent_on_credit'] : 0;
if(isset($manuRow['main_raw_materials'])){
foreach($manuRow['main_raw_materials'] as $rawkey => $raw){
if($raw['manufacturing_raw_material_name'] != "" || $raw['manufacturing_raw_material_name'] != null)
{
$total_no_of_suppliers++;
}
$supplier_first_row .= '<td class="customtd">'.$raw['manufacturing_raw_material_name'].'</td>';
$supplier_second_row .= isset($raw['person_title_name_master']) ? '<td class="customtd">' . $raw['person_title_name_master'].' ': '<td class="customtd">' . '';
$supplier_second_row .= $raw['manufacturing_contact_person_name'] ;
$supplier_second_row .= isset($raw['person_designation']) && $raw['person_designation']== 1 ? ' '.$raw['other_person_designation'] : ' ';//
$supplier_second_row .= isset($raw['person_designation_master']) && $raw['person_designation'] != 1? $raw['person_designation_master'] : '' ;
$supplier_second_row .= ' '.$raw['manufacturing_supplier_name'].'</td>';
$supplier_third_row .= '<td class="customtd">'. ($raw['manufacturing_contact_person_mobile_number'] ? $raw['manufacturing_contact_person_mobile_number'].'</td>' : 'Not Provided' .'</td>');
$supplier_fourth_row .= $raw['person_stdcode'] && $raw['person_landline'] ? '<td class="customtd">'. $raw['person_stdcode'].' '.$raw['person_landline'].'</td>' : '<td class="customtd">'.'Not Provided'.'</td>';
$supplier_fifth_row .= $raw['manufacturing_payment_type_master'] ? '<td class="customtd">'. $raw['manufacturing_payment_type_master'] .'</td>' : '<td class="customtd">NA</td>';
$supplier_sixth_row .= $raw['manufacturing_payment_mode'] ? '<td class="customtd">'. $raw['manufacturing_payment_mode'] .'</td>' : '<td class="customtd">NA</td>';
$supplier_seventh_row .= $raw['manufacturing_credit_days_from'] && $raw['manufacturing_credit_days_to'] ? '<td class="customtd">'. $raw['manufacturing_credit_days_from'].' to '. $raw['manufacturing_credit_days_to'].' days</td>' : '<td class="customtd">NA</td>';
//array_push($supplierResult,$temp);
$supplier_eigth_row .= isset($raw['manufacturing_contribution_total_purchase']) && $raw['manufacturing_contribution_total_purchase'] != "" ? '<td class="customtd">'.$raw['manufacturing_contribution_total_purchase'] .'</td>' : '<td class="customtd"> Not Provided </td>' ;
}
}
}
// this is for trading
//print_r($supplierRow['trade_details'][0]['trading_products']);
if(isset($supplierRow['trade_details'][0]['trading_products']) && count($supplierRow['trade_details'][0]['trading_products']))
{
$total_payments_percent_on_credit_for_supplier += $supplierRow['trade_details'][0]['trading_products_total_payments_percent_on_credit'];
foreach($supplierRow['trade_details'][0]['trading_products'] as $tradeRow){
if($tradeRow['trade_product_name'] != "" || $tradeRow['trade_product_name'] != null)
{
$total_no_of_suppliers++;
}
$supplier_first_row .= '<td class="customtd">'.$tradeRow['trade_product_name'].'</td>';
$supplier_second_row .= isset($tradeRow['person_title_name_master']) ? '<td class="customtd">' . $tradeRow['person_title_name_master'].' ': '<td class="customtd">' . '';
$supplier_second_row .= $tradeRow['trade_product_contact_person_name'] ;
$supplier_second_row .= isset($tradeRow['person_designation']) && $tradeRow['person_designation']== 1 ? ' '.$tradeRow['other_person_designation'] : ' ';//
$supplier_second_row .= isset($tradeRow['person_designation_master']) && $tradeRow['person_designation'] != 1? $tradeRow['person_designation_master'] : '' ;
$supplier_second_row .= ' '.$tradeRow['trade_supplier_name'].'</td>';
//$supplier_second_row .= $supplier_second_row;
$supplier_third_row .= '<td class="customtd">'. ($tradeRow['trade_product_contact_person_mobile_number'] ? $tradeRow['trade_product_contact_person_mobile_number'].'</td>' : 'Not Provided' .'</td>');
$supplier_fourth_row .= $tradeRow['person_stdcode'] && $tradeRow['person_landline'] ? '<td class="customtd">'. $tradeRow['person_stdcode'].' '.$tradeRow['person_landline'].'</td>' : '<td class="customtd">'.'Not Provided'.'</td>';
$supplier_fifth_row .= isset($tradeRow['trade_product_payment_type_master']) ? '<td class="customtd">'. $tradeRow['trade_product_payment_type_master'] .'</td>' : '<td class="customtd">NA</td>';
$supplier_sixth_row .= $tradeRow['trade_product_payment_mode'] ? '<td class="customtd">'. $tradeRow['trade_product_payment_mode'] .'</td>' : '<td class="customtd">NA</td>';
$supplier_seventh_row .= $tradeRow['trade_product_credit_days_from'] && $tradeRow['trade_product_credit_days_to'] ? '<td class="customtd">'. $tradeRow['trade_product_credit_days_from'].' to '. $tradeRow['trade_product_credit_days_to'].' days</td>' : '<td class="customtd">NA</td>';
$supplier_eigth_row .= isset($tradeRow['trade_product_contribution_total_purchase']) && $tradeRow['trade_product_contribution_total_purchase'] != "" ? '<td class="customtd">'.$tradeRow['trade_product_contribution_total_purchase'] .'</td>' : '<td class="customtd"> Not Provided </td>' ;
///array_push($supplierResult,$temp);
//}
//}
}
}
if(isset($supplierRow['servicing_details'][0]['service_providers']) && count($supplierRow['servicing_details'][0]['service_providers']))
{
$total_payments_percent_on_credit_for_supplier += isset($supplierRow['servicing_details'][0]['service_providers_total_payments_percent_on_credit']) ? $supplierRow['servicing_details'][0]['service_providers_total_payments_percent_on_credit'] : 0;
//echo isset($supplierRow['servicing_details'][0]['service_providers_total_payments_percent_on_credit']) ? $supplierRow['servicing_details'][0]['service_providers_total_payments_percent_on_credit'] : 0;
foreach($supplierRow['servicing_details'][0]['service_providers'] as $serviceRow){
if($serviceRow['service_provider_name'] != "" || $serviceRow['service_provider_name'] != null)
{
$total_no_of_suppliers++;
}
$supplier_first_row .= '<td class="customtd">'.$serviceRow['service_provider_name'].'</td>';
$supplier_second_row .= isset($serviceRow['person_title_name_master']) ? '<td class="customtd">' . $serviceRow['person_title_name_master'].' ': '<td class="customtd">' . '';
$supplier_second_row .= $serviceRow['service_provider_contact_person_name'] ;
$supplier_second_row .= isset($serviceRow['person_designation']) && $serviceRow['person_designation']== 1 ? ' '.$serviceRow['other_person_designation'] : ' ';//
$supplier_second_row .= isset($serviceRow['person_designation_master']) && $serviceRow['person_designation'] != 1? $serviceRow['person_designation_master'] : '' ;
$supplier_second_row .= ' '.$serviceRow['service_provider_supplier_name'].'</td>';
//$supplier_second_row .= $supplier_second_row;
$supplier_third_row .= '<td class="customtd">'. ($serviceRow['service_provider_contact_person_mobile_number'] ? $serviceRow['service_provider_contact_person_mobile_number'].'</td>' : 'Not Provided' .'</td>');
$supplier_fourth_row .= $serviceRow['person_stdcode'] && $serviceRow['person_landline'] ? '<td class="customtd">'. $serviceRow['person_stdcode'].' '.$serviceRow['person_landline'].'</td>' : '<td class="customtd">'.'Not Provided'.'</td>';
$supplier_fifth_row .= isset($serviceRow['service_provider_payment_type_master']) ? '<td class="customtd">'. $serviceRow['service_provider_payment_type_master'] .'</td>' : '<td class="customtd">NA</td>';
$supplier_sixth_row .= $serviceRow['service_provider_payment_mode'] ? '<td class="customtd">'. $serviceRow['service_provider_payment_mode'] .'</td>' : '<td class="customtd">NA</td>';
$supplier_seventh_row .= $serviceRow['service_provider_credit_days_from'] && $serviceRow['service_provider_credit_days_to'] ? '<td class="customtd">'. $serviceRow['service_provider_credit_days_from'].' to '. $serviceRow['service_provider_credit_days_to'].' days</td>' : '<td class="customtd">NA</td>';
$supplier_eigth_row .= isset($serviceRow['service_provider_contribution_total_purchase']) && $serviceRow['service_provider_contribution_total_purchase'] != "" ? '<td class="customtd">'.$serviceRow['service_provider_contribution_total_purchase'] .'</td>' : '<td class="customtd"> Not Provided </td>' ;
//array_push($supplierResult,$temp);
//}
}//}
}
$supplier_first_row .= '</tr>';
$supplier_second_row.= '</tr>';
$supplier_third_row .= '</tr>';
$supplier_fourth_row.= '</tr>';
$supplier_fifth_row .= '</tr>';
$supplier_sixth_row .= '</tr>';
$supplier_seventh_row .= '</tr>';
$supplier_eigth_row .= '</tr>';
}
// echo "dsfnsdkfnj**********";
// print_r($supplierResult);//
echo '<h3 contenteditable="true">Supplier Details</h3>' ;
if($is_supplier_details_avaialable != null)
{
?>
<?php
// foreach($supplierResult as $k => $fetchRow){
//echo '<br>Supplier '.($k+1).':<br><br>';
?>
<table class="scorecard_table">
<thead>
<tr>
<th>Sr.No</th>
<th>Particulars</th>
<?php for($i = 1; $i <= $total_no_of_suppliers; $i++){
echo "<th>Supplier $i</th>";
}?>
</tr>
</thead>
<tbody>
<?php //foreach($fetchRow['details'] as $productRow){
echo $supplier_first_row;
echo $supplier_second_row;
echo $supplier_third_row;
echo $supplier_fourth_row;
if($pd_master_details[0]['lender_short_name'] == 'MWISE')
{
echo $supplier_fifth_row;
echo $supplier_sixth_row;
echo $supplier_seventh_row;
}
?>
<?php
if($pd_master_details[0]['lender_short_name'] == 'MWISE')
{
echo $supplier_eigth_row;
}?>
</tbody>
</table>
<?php
// //*/Supplier Photo section
// $supplier_photo_count = array();
// foreach($pd_images[1] as $sup_img)
// {
// if(!strcasecmp($sup_img['pd_document_title'],$fetchRow['supplier_name_for_photo']))
// {
// $supplier_photo_count[] = $sup_img;
// }
// }
// $supplier_img_row_count = ceil(count($supplier_photo_count) / 3);
// if(count($supplier_photo_count)){
// echo '<br>';
// echo '<p>Supplier '.($k+1).' Photograph`s : </p>';
// echo '<br>';
// echo '<table border="1" height="100%" width="50%">';
// $supplier_from_index_increment = 0;
// for($img_row = 1; $img_row <= $supplier_img_row_count; $img_row++)
// {
// echo '<tr>';
// $from = $supplier_from_index_increment;
// $to = ($from + 2);
// for($supplier_photo_iter = $from; $supplier_photo_iter <= $to;$supplier_photo_iter++)
// {
// if(isset($supplier_photo_count[$supplier_photo_iter]) &&$supplier_photo_count[$supplier_photo_iter]['company_id'] == ($business_count+1))
// {
// echo '<td>';
// echo '<div class="gallery">';
// echo '<img src="'.$supplier_photo_count[$supplier_photo_iter]['doc_url'].'" alt="" width="200" height="200">';
// echo '<div class="desc">'.$supplier_photo_count[$supplier_photo_iter]['pd_document_title'].'<br>'.$supplier_photo_count[$supplier_photo_iter]['location'].'<br>'.date('Y/m/d h:s:i A',$supplier_photo_count[$supplier_photo_iter]['createdon']).'</div>';
// echo '</div>';
// echo '</td>';
// //unset($stock_photo_count[$stock_photo_iter]);
// }
// }
// //echo "<br><br><hr>";
// echo '</tr>';
// $supplier_from_index_increment = $supplier_from_index_increment + 3;
// }
// //echo '</tbody>';
// echo '</table>';
// }*/
//End of Supplier Photo section
//}//End of supplier foreach
?>
<?php
if($total_payments_percent_on_credit_for_supplier > 0)
{
//$company_name = MYUTIL::findCompanyName($all_company_details,$supplierRow['company_id'],1);
echo "<p>Out of total purchases done by ". $company_name_for_supplier_form_dispaly .", ". $total_payments_percent_on_credit_for_supplier ." % is done on credit.</p>"; //in advance rest on delivery.
}
}
echo '<p>'.$supplier_form_remarks.'<p>';
}// End of supplier info avilable in this current index?>
<!-- #################supplier section end ##################################-->
<!-- #################start stock section #################-->
<?php
$stockResult=array();
$stock_form_remarks = '';
if(isset($pd_processed_forms[11][$business_count]))
{
$stRow = $pd_processed_forms[11][$business_count];
$stockRow = json_decode($stRow['processed_json'],true);
//print_r($stockRow);die();
$stock_form_remarks = $stockRow['stock_remarks'];
$service_goods_enough_remarks = $stockRow['service_goods_enough_remarks'];
$is_stock_sufficient_enough = $stockRow['is_sufficiant_finished_and_traded_goods'];
$is_stock_sufficient_enough_remarks = $stockRow['finished_and_traded_goods_remarks'];
$is_raw_materials_sufficient_enough = null;
$is_raw_materials_sufficient_enough_remarks = null;
$how_was_the_stock_validated = isset($stockRow['stock_validated']) && $stockRow['stock_validated'] != '' ? $stockRow['stock_validated'] : null;
$is_sufficiant_service_goods = $stockRow['is_sufficiant_service_goods'];
$bindStockResult["company_name"]=MYUTIL::findCompanyName($all_company_details,$stockRow['company_id'],1);
// this is for stock manufacturing details
if(isset($stockRow['manufacturing_details']) && is_array($stockRow['manufacturing_details']) && count($stockRow['manufacturing_details']) && (is_array($stockRow['manufacturing_details'][0]['manufacturing_raw_materials']) && count($stockRow['manufacturing_details'][0]['manufacturing_raw_materials'])) > 0 || (is_array($stockRow['manufacturing_details'][0]['manufacturing_finished_goods']) && count($stockRow['manufacturing_details'][0]['manufacturing_finished_goods']) > 0)) {
$is_raw_materials_sufficient_enough = $stockRow['manufacturing_details'][0]['is_sufficiant_raw'];
$is_raw_materials_sufficient_enough_remarks = $stockRow['manufacturing_details'][0]['rawmaterial_remarks'];
$bindStockResult["manufacturing"]=Stockform::getStockManufacturingDetails($stockRow['manufacturing_details'][0]['manufacturing_raw_materials'], $stockRow['manufacturing_details'][0]['manufacturing_finished_goods']);
//print_r($bindStockResult["manufacturing"]);
}
else {
$bindStockResult["manufacturing"]=array();
}
// this is for stock retail details
if(isset($stockRow['retail_details'][0]['retail_traded_goods']) && count($stockRow['retail_details'][0]['retail_traded_goods']) > 0){
$bindStockResult["retail"]=Stockform::getStockRetailDetails($stockRow['retail_details'][0]['retail_traded_goods']);
}
else {
$bindStockResult["retail"]=array();
}
// this is for stock whole sale details
if(isset($stockRow['trade_details'][0]['trading_traded_goods']) && count($stockRow['trade_details'][0]['trading_traded_goods']) > 0){
$bindStockResult["wholesale"]=Stockform::getStockWholesaleDetails($stockRow['trade_details'][0]['trading_traded_goods']);
}
else {
$bindStockResult["wholesale"]=array();
}
// this is for stock service details
//print_r($stockRow['servicing_details']);
if(isset ($stockRow['servicing_details'][0]['service_provider']) &&count($stockRow['servicing_details'][0]['service_provider']) > 0){
$bindStockResult["service_stocks"]=Stockform::getStockServiceDetails($stockRow['servicing_details'][0]['service_provider']);
}
else {
$bindStockResult["service_stocks"]=array();
}
//print_r($bindStockResult);die();
count($bindStockResult['wholesale']) || count($bindStockResult['retail']) || count($bindStockResult['manufacturing']) || count($bindStockResult["service_stocks"])? array_push($stockResult,$bindStockResult) : $stockResult;
//echo "**********************";
//print_r($stockResult);die();
?>
<?php
if(count($stockResult) || $stock_form_remarks != ''){
$stock_sr_no = 0;
?>
<h3 contenteditable="true">Stock Details</h3>
<?php foreach($stockResult as $getstRow) { ?>
<h3><?php echo $getstRow['company_name']; ?></h3>
<table class="scorecard_table">
<thead>
<tr>
<th>Sr.No</th>
<th>Type of Stock</th>
<th>Stock Item</th>
<th>Stock Value (Rs)</th>
<!-- <th>Stock Quantity</th> -->
</tr>
</thead>
<tbody>
<!-- manufacturing -->
<?php if(count($getstRow['manufacturing'])>0) {
foreach($getstRow['manufacturing'] as $pstRow){
if($pstRow['name']){
?>
<tr>
<td class="customtd"><?php echo (++$stock_sr_no) ?></td>
<td class="customtd"><?php echo $pstRow['type'] ?></td>
<td class="customtd"><?php echo $pstRow['name'] ?></td>
<td class="customtd"><?php echo $pstRow['value'] && $pstRow['value'] != "" ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pstRow['value']) : 'Not Observed'?></td>
<!-- <td class="customtd"><?php echo $pstRow['quantity'] && $pstRow['quantity'] != "" ? $pstRow['quantity'].' '.$pstRow['uom'] : 'Could Not Verify' ?></td> -->
<!-- <td><?php //echo $pstRow['is_sufficiant'] ?></td> -->
</tr>
<?php }
} ?>
<?php } ?>
<!-- Retail -->
<?php if(count($getstRow['retail'])) {
//print_r(($getstRow['retail']));
?>
<?php foreach($getstRow['retail'] as $reRow){
if($reRow['name']){
?>
<tr>
<td class="customtd"><?php echo (++$stock_sr_no) ?></td>
<td class="customtd"><?php echo $reRow['type'] ?></td>
<td class="customtd"><?php echo $reRow['name'] ?></td>
<td class="customtd"><?php echo $reRow['value'] && $reRow['value'] != " " ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($reRow['value']) : 'Not Observed' ?></td>
<!-- <td class="customtd"><?php echo $reRow['quantity'] && $reRow['quantity'] != "" ? $reRow['quantity'].' '.$reRow['uom'] : 'Not Observed' ?></td> -->
</tr>
<?php }
} ?>
<?php }
?>
<!-- wholesale -->
<?php
//print_r($getstRow['wholesale']);
if(count($getstRow['wholesale'])) { ?>
<?php foreach($getstRow['wholesale'] as $wsRow){
if($wsRow['name']){
?>
<tr>
<td class="customtd"><?php echo (++$stock_sr_no) ?></td>
<td class="customtd"><?php echo $wsRow['type'] ?></td>
<td class="customtd"><?php echo $wsRow['name'] ?></td>
<td class="customtd"><?php echo $wsRow['value'] && $wsRow['value'] != "" ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($wsRow['value']) : 'Not Observed' ?></td>
<!-- <td class="customtd"><?php echo $wsRow['quantity'] && $wsRow['quantity'] != " " ? $wsRow['quantity'].' '.$wsRow['uom'] : 'Not Observed' ?></td> -->
</tr>
<?php }} ?>
<?php } ?>
<?php
//print_r($getstRow['service_stocks']);die();
if(count($getstRow['service_stocks'])) { ?>
<?php foreach($getstRow['service_stocks'] as $serviceRow){
if($serviceRow['name']){
?>
<tr>
<td class="customtd"><?php echo (++$stock_sr_no) ?></td>
<td class="customtd"><?php echo $serviceRow['type'] ?></td>
<td class="customtd"><?php echo $serviceRow['name'] ?></td>
<td class="customtd"><?php echo $serviceRow['value'] && $serviceRow['value'] != '' ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($serviceRow['value']) : 'Not Observed'?></td>
<!-- <td class="customtd"><?php echo $serviceRow['quantity'] && $serviceRow['quantity'] != ""? $serviceRow['quantity'].' '.$serviceRow['uom'] : 'Not Observed' ?></td> -->
</tr>
<?php }} ?>
<?php } ?>
</tbody>
</table>
<?php }
if(!strcasecmp($is_stock_sufficient_enough,'yes')){
echo '<p style="text-align:justify;">Considering the size of operations, the stock of finished goods maintained is sufficient as per the PD Officers observations.</p>';
}else if(!strcasecmp($is_stock_sufficient_enough,'no')){
echo '<p style="text-align:justify;">Considering the size of operations, the stock of finished goods maintained is not sufficient as per the PD Officers observations.</p>';
echo '<p style="text-align:justify;">'. $is_stock_sufficient_enough_remarks.'</p>';
}
else if(!strcasecmp($is_stock_sufficient_enough,'not applicable'))
{
echo '<p style="text-align:justify;">Finished goods Stock not required to be maintained.</p>';
}
if(!strcasecmp($is_raw_materials_sufficient_enough,'yes'))
{
echo '<p style="text-align:justify;">Considering the size of operations, the stock of raw materials maintained is sufficient as per the PD Officers observations.</p>';
}else if(!strcasecmp($is_raw_materials_sufficient_enough,'no'))
{
echo '<p style="text-align:justify;">Considering the size of operations, the stock of raw materials maintained is not sufficient as per the PD Officers observations.</p>';
echo '<p style="text-align:justify;">'. $is_raw_materials_sufficient_enough_remarks.'</p>';
}
else if(!strcasecmp($is_raw_materials_sufficient_enough,'not applicable'))
{
echo '<p style="text-align:justify;">Raw material Stock not required to be maintained.</p>';
}
//echo '<p style="text-align:justify;">'.$stock_remarks.'</p>';
//serivce
if(!strcasecmp($is_sufficiant_service_goods,'yes'))
{
echo '<p style="text-align:justify;">Considering the size of operations, the stock maintained for service providing is sufficient as per the PD Officers observations.</p>';
}else if(!strcasecmp($is_sufficiant_service_goods,'no'))
{
echo '<p style="text-align:justify;">Considering the size of operations, the stock maintained for service providing is not sufficient as per the PD Officers observations.</p>';
echo '<p style="text-align:justify;">'. $service_goods_enough_remarks.'</p>';
}
else if(!strcasecmp($is_sufficiant_service_goods,'not applicable'))
{
echo '<p style="text-align:justify;">Stock not required to be maintained.</p>';
}
echo $how_was_the_stock_validated ? ('<p>How was stock validated :- '.$how_was_the_stock_validated .'</p>') : '';
$stock_photo_count = array_filter($pd_images[11],function($d) use ($business_count){ if($d['company_id'] == ($business_count + 1)){ return 1;}else {return 0;} });
$stock_img_row_count = ceil(count($stock_photo_count) / 3);
if(count($stock_photo_count)){
echo '<br>';
echo '<p>Stock Photograph`s :</p>';
echo '<br>';
echo '<table border="1" height="100%" width="50%">';
for($img_row = 0; $img_row < $stock_img_row_count; $img_row++)
{
if($img_row > 0) { break; }
echo '<tr>';
$from = $img_row == 0 ? $img_row : ($img_row+2);
$to = ($from + 2);
for($stock_photo_iter = $from; $stock_photo_iter <= $to;$stock_photo_iter++)
{
if(isset($stock_photo_count[$stock_photo_iter]) &&$stock_photo_count[$stock_photo_iter]['company_id'] == ($business_count+1))
{
echo '<td>';
echo '<div class="gallery">';
echo '<img src="'.$stock_photo_count[$stock_photo_iter]['doc_url'].'" alt="" width="200" height="200">';
echo '<div class="desc">'.$stock_photo_count[$stock_photo_iter]['pd_document_title'] .'</div>';
echo '</div>';
echo '</td>';
//unset($stock_photo_count[$stock_photo_iter]);
}
}
//echo "<br><br><hr>";
echo '</tr>';
}
//echo '</tbody>';
echo '</table>';
}
//
?>
<?php
//
}
echo '<p>'.$stock_form_remarks.'</p>';
//else {?>
<!-- <p> Stock details is not available.</p> -->
<?php //}
} //end of stock details available in current index
?>
<!-- #################end stock section #################-->
<!-- #################Start of AI #################-->
<?php
//echo "AI*******************##############@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@";
if(is_array($assessed_income_details) && count($assessed_income_details) && isset($assessed_income_details[ ($business_count+1) ] ))
{
$ai_core_details = ($assessed_income_details[ ($business_count+1) ]['core_details']);
//print_r($ai_core_details);
$ai_core_details_processed = ASSESSEDINCOME::getCoreDetails($ai_core_details);
// echo "######################################";
// print_r($ai_core_details_processed);
$order_dipaly_array = array('A','B','C','D','E','F','G','H','I','J');
$ai_summary_details = ($assessed_income_details[ ($business_count+1) ]['summary_details']);
$ai_summary_details_processed = ASSESSEDINCOME::getSummaryTable($ai_summary_details,$ai_core_details);
echo "<p>Assessed Income - ".MYUTIL::findCompanyName($all_company_details,($business_count+1),1)."</p>";
if(isset($ai_core_details) && count($ai_summary_details_processed))
{
echo '<p contenteditable="true"> '.$order_dipaly_array[0].') Financial Snapshot</p>';
echo '<table class="scorecard_table">';
echo '<thead>';
echo $ai_summary_details_processed['ai_table_header_row'];
echo '</thead>';
echo '<tbody>';
echo $ai_summary_details_processed['sale_revenue_row'];
echo $ai_summary_details_processed['purchase_row'];
echo $ai_summary_details_processed['gross_profit_loss_row'];
echo $ai_summary_details_processed['gross_profit_loss_per_row'];
echo $ai_summary_details_processed['business_expense_row'];
echo $ai_summary_details_processed['net_profit_loss_row'];
echo $ai_summary_details_processed['house_hold_expense_row'];
echo $ai_summary_details_processed['disposable_income_row'];
echo $ai_summary_details_processed['net_margin_row'];
echo '</tbody>';
echo '</table>';
// echo '<br>';
// echo '<table class="scorecard_table">';
// echo '<thead>';
// echo '<tr> <th>Particulars</th> <th>Details</th> </tr>';
// echo '</thead>';
// echo '<tbody>';
// echo $ai_summary_details_processed['considered_sales_revenue_row'];
// echo $ai_summary_details_processed['considered_net_profit_row'];
// echo $ai_summary_details_processed['considered_net_margint_row'];
// echo '</tbody>';
// echo '</table>';
array_shift($order_dipaly_array);
}
echo '<p style="text-align:justify;">';
// if(isset($ai_core_details) && count($ai_core_details['sales_items_by_monthwise']))
// {
// echo "<br>";
// echo '<p contenteditable="true">'.$order_dipaly_array[0].') Kuchha Sales Book/Bills : </p>';
// foreach($ai_core_details_processed['sales_month_wise_to_display'] as $sale_month_wise)
// {
// // if($sale_month_wise['sales_type'] == 1)
// // {
// echo '<br><br>';
// echo 'Item name : <b>' . $sale_month_wise['sales_item'].'</b><br>';
// if($sale_month_wise['sales_type'] == 1)
// {
// echo '<b>'.$sale_month_wise['month_count'].'</b> month sales value : <b>'.$rupee_symbol.''.MYUTIL::customIndianNumberFormat($sale_month_wise['total_months_value']).'</b> Annual Sales value:<b>'.$rupee_symbol.'' .MYUTIL::customIndianNumberFormat(($sale_month_wise['total_months_value'] * (12 / $sale_month_wise['month_count']) )).'</b>';
// }
// else
// {
// echo 'Annual Sales value:<b>'. $rupee_symbol.' '.MYUTIL::customIndianNumberFormat(($sale_month_wise['total_months_value'] )).'</b>';
// }
// }
// array_shift($order_dipaly_array);
// echo '<br><br>Detail Available on Annexure A';
// }
// if(isset($ai_core_details) && count($ai_core_details['sales_items_by_monthwise']))
// {
// echo "<br>";
// echo '<p contenteditable="true">'.$order_dipaly_array[0].') Kuchha Sales Book/Bills : </p>';
// foreach($ai_core_details_processed['sales_month_wise_to_display'] as $sale_month_wise)
// {
// // if($sale_month_wise['sales_type'] == 1)
// // {
// echo '<div id="billwise">';
// echo 'Item name : <b>' . $sale_month_wise['sales_item'].'</b><br>';
// if($sale_month_wise['sales_type'] == 1)
// {
// echo '<b>'.$sale_month_wise['month_count'].'</b> month sales value : <b>'.$rupee_symbol.''.MYUTIL::customIndianNumberFormat($sale_month_wise['total_months_value']).'</b> Annual Sales value:<b>'.$rupee_symbol.'' .MYUTIL::customIndianNumberFormat(($sale_month_wise['total_months_value'] * (12 / $sale_month_wise['month_count']) )).'</b>';
// }
// else
// {
// echo 'Annual Sales value:<b>'. $rupee_symbol.' '.MYUTIL::customIndianNumberFormat(($sale_month_wise['total_months_value'] )).'</b>';
// }
// echo '<hr>';
// $row_count = ceil(count($sale_month_wise['months']) / 5);
// //print_r(($sale_month_wise['months']));
// // echo $row_count;
// //die();
// echo '<table>';
// for($i = 0; $i <= $row_count; $i++)
// {
// $from = $i== 0 ? $i : ($i + 3);
// $to = ($from + 3);
// echo '<tr>';
// for($j = $from ; $j <= $to ;$j++)
// {
// //$sale_month_wise['months'] as $sale_month_data
// //echo '<span style="display:inline;width:auto;height:auto;padding: 5px;">';
// if(isset($sale_month_wise['months'][$j]))
// {
// echo '<td>';
// echo '<table class="billwise_table">';
// echo '<thead>';
// if($sale_month_wise['sales_type'] == 1)
// {
// echo '<tr> <th colspan="2">'.$sale_month_wise['months'][$j]['month_to_dispaly'].'</th> </tr>';
// }
// if($sale_month_wise['sales_type'] == 1)
// {
// echo '<tr> <th>Date</th> <th>Value</th></tr>';
// }else if($sale_month_wise['months'][$j]['sales_type'] == 2)
// {
// echo '<tr> <th>Frequncy</th> <th>Value</th></tr>';
// }
// echo '</thead>';
// echo '<tbody>';
// foreach($sale_month_wise['months'][$j]['month_data'] as $m_key => $month)
// {
// if($sale_month_wise['sales_type'] == 1)
// {
// echo '<tr> <td>'.$month['date'] .'</td> <td>'.$month['value'] .'</td> </tr>';
// }
// if($m_key == 20)break;
// else if($sale_month_wise['sales_type'] == 2)
// {
// echo '<tr> <td>'.$month['frequency_name'] .'</td> <td>'.$month['frequency_value'] .'</td> </tr>';
// }
// }
// echo '</tbody>';
// echo '</table>';
// echo '</td>';
// }
// }
// echo '</tr>';
// }
// echo '</table>';
// echo '</div>';
// //}
// }
// array_shift($order_dipaly_array);
// }
if(isset($ai_core_details) && count($ai_core_details['sales_calculated_by_itemwise']))
{
echo '<p contenteditable="true">'.$order_dipaly_array[0].') Sales Itemwise : </p>';
echo '<table class="scorecard_table">';
echo '<thead>';
echo $ai_core_details_processed['sales_calculated_by_itemwise_header'];
echo '</thead>';
echo '<tbody>';
foreach($ai_core_details_processed['sales_item_wise_to_diaplay'] as $sid)
{
//print_r($sid);
$rate_per_unit = ($sid['rate_per_unit'] != 0 && $sid['rate_per_unit'] != '' ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['rate_per_unit']) : '-');
echo '<tr>';
echo '<td>'.($sid['other_sales_item'] != '' ? $sid['other_sales_item'] :$sid['sale_item']).'</td><td class="customtd">'.$sid['sales_qty'].'</td><td class="customtd">'.$sid['uom'].'</td><td class="customtd">'. $rate_per_unit .'</td><td class="customtd">'.$sid['frequency'].'</td><td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['annual_sale_value']).($sid['sales_type'] == 3 ? ' *' : '').'</td>';
if(isset($sid['margin_per'])){echo '<td class="customtd">'.($sid['margin_per'] != 0 ? $sid['margin_per'] : '-').'</td>'; }
// if(isset($sid['margin_per_uom'])){echo '<td class="customtd">'.($sid['margin_per_uom'] != 0? $sid['margin_per_uom'] : '-').'</td>'; }
if(isset($sid['margin_final_value'])){ echo '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['margin_final_value']).'</td>'; }
echo '</tr>';
}
echo '</tbody>';
echo '</table>';
array_shift($order_dipaly_array);
}
echo '<br>* Assessed From Kuchha Records, Details Available in Annexure A';
if(isset($ai_core_details) && count($ai_core_details['sales_declared_by_customer']))
{
echo '<p contenteditable="true">'.$order_dipaly_array[0].') Sales Declared By Customer</p>';
// if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 1)
// {
// echo '<p style="text-align:justify;">As per person met, the following Purchase details were shared:</p>';
// }
// else if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
// {
// echo '<p>As per person met, Purchase details were not shared, income calculated by Net margin percentage.</p>';
// }
$str = 'As per person met, '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_core_details['sales_declared_by_customer'][0]['sales_declared_by_customer']).' ( '.MYUTIL::numtowords($ai_core_details['sales_declared_by_customer'][0]['sales_declared_by_customer']).' ) declared as annual sale value.';
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
{
$str .= '<br>and '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_core_details['sales_declared_by_customer'][0]['margin_value']).' ( '.MYUTIL::numtowords( $ai_core_details['sales_declared_by_customer'][0]['margin_value']).' )'.'( '.$ai_core_details['sales_declared_by_customer'][0]['margin_per'].'% sales declared ) as net margin amount.';
}
echo $str;
echo '</p><br>';
array_shift($order_dipaly_array);
}
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 1)
{
echo '<p style="text-align:justify;">As per person met, the following Purchase details were shared:</p>';
}
else if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
{
echo '<p>As per person met, Purchase details were not shared, income calculated by Net margin percentage.</p>';
}
echo '<br>';
if(isset($ai_core_details) && count($ai_core_details['purchase_declared_by_customer']))
{
echo '<p contenteditable="true">'.$order_dipaly_array[0].') Purchase Declared By Customer</p>';
$str = 'As per person met, '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_core_details['purchase_declared_by_customer'][0]['purchase_declared_by_customer']).' ( '.MYUTIL::numtowords($ai_core_details['purchase_declared_by_customer'][0]['purchase_declared_by_customer']).' ) declared as annual purchase value.';
// if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
// {
// $str .= '<br>and '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_core_details['sales_declared_by_customer'][0]['margin_value']).' ( '.MYUTIL::numtowords( $ai_core_details['sales_declared_by_customer'][0]['margin_value']).' )'.'( '.$ai_core_details['sales_declared_by_customer'][0]['margin_per'].'% sales declared ) as net margin amount.';
// }
echo $str;
echo '</p><br>';
array_shift($order_dipaly_array);
}
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 1 && $ai_core_details['gross_profit_calculation_type'][0]['purchase_type'] == 1)
{
echo '<p>'.$order_dipaly_array[0].') Itemwise Purchase Details :</p>';
echo '<table class="scorecard_table">';
echo '<thead>';
echo '<tr> <th>Raw Material/Trading Item </th> <th class="customtd">Purchase Quantity</th> <th class="customtd">UOM</th> <th class="customtd">Rate/Unit of Purchase</th> <th>Frequency</th> <th>Annual Purchase(Rs)</th> </tr>';
echo '</thead>';
echo '<tbody>';
foreach($ai_core_details_processed['purchase_to_display'] as $dat)
{
$rate = $dat['rate'] != 0 && $dat['rate'] != '' ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($dat['rate']) : '-';
echo '<tr> <td>'.$dat['material_name'] .'</td> <td class="customtd">'.$dat['qty'] .'</td> <td class="customtd">'.$dat['uom'] .'</td> <td class="customtd">'. $rate .'</td> <td class="customtd">'.$dat['frequency'] .'</td> <td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($dat['annual_value']) .'</td> </tr>';
}
echo '</tbody>';
echo '</table>';
array_shift($order_dipaly_array);
}
else if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 1 &&$ai_core_details['gross_profit_calculation_type'][0]['purchase_type'] == 2)
{
echo '<p>'.$order_dipaly_array[0].') Billwise Purchase Details :</p>';
foreach($ai_core_details_processed['purchase_to_display'] as $billwise)
{
echo '<div id="billwise">';
echo 'Item name : <b>' . $billwise['item_name'].'</b><br>';
echo '<b>'.$billwise['month_count'].'</b> month(s) purchase value : <b>'.MYUTIL::customIndianNumberFormat($billwise['annual_purchase_value']).'</b> Annual Purchase value:<b>'. MYUTIL::customIndianNumberFormat($billwise['annual_purchase_value'] * (12 / $billwise['month_count']) ).'</b>';
echo '<hr>';
foreach($billwise['months'] as $month_data)
{
//echo '<span style="display:inline;width:auto;height:auto;padding: 5px;">';
echo '<br>';
echo '<table class="billwise_table">';
echo '<thead>';
echo '<tr> <th colspan="2">'.$month_data['month_to_dispaly'].'</th> </tr>';
echo '<tr> <th>Date</th> <th>Value</th></tr>';
echo '</thead>';
echo '<tbody>';
foreach($month_data['month_data'] as $month)
{
echo '<tr> <td>'.$month['date'] .'</td> <td>'.$month['value'] .'</td> </tr>';
}
echo '</tbody>';
echo '</table>';
//echo '</span>';
}
echo '</div>';
}
array_shift($order_dipaly_array);
}
}
//
if(isset($ai_core_details) && count($ai_core_details['business_expenses']))
{
echo '<p contenteditable="true">'.$order_dipaly_array[0].') Business Expenses Details :</p>';
echo '<table class="scorecard_table">';
echo '<thead>';
echo '<tr> <th>Business Expense </th> <th>Amount</th> <th>Frequency </th> <th>Annual Expenses</th></tr>';
echo '</thead>';
echo '<tbody>';
foreach($ai_core_details_processed['business_expenses_to_diaplay'] as $b_exp)
{
echo '<tr> <td>'.$b_exp['expense_item'] .'</td> <td class="customtd">'.$rupee_symbol." ".MYUTIL::customIndianNumberFormat($b_exp['expense_value']) .'</td> <td class="customtd">'.$b_exp['frequency_name'] .'</td> <td class="customtd">'.$rupee_symbol." ".MYUTIL::customIndianNumberFormat($b_exp['annual_expenses_value']).'</td></tr>';
}
echo '</tbody>';
echo '</table>';
array_shift($order_dipaly_array);
}
if(isset($ai_core_details) && count($ai_core_details['house_hold_expenses']))
{
echo '<p contenteditable="true">'.$order_dipaly_array[0].') Household Expenses Details :</p>';
echo '<table class="scorecard_table">';
echo '<thead>';
echo '<tr> <th>Expense Particulars </th> <th>Amount (Rs) </th> <th>Frequency </th> <th>Annual Expenses(Rs)</th></tr>';
echo '</thead>';
echo '<tbody>';
foreach($ai_core_details_processed['household_expenses_to_diaplay'] as $h_exp)
{
echo '<tr> <td>'.$h_exp['expense_item'] .'</td> <td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($h_exp['expense_value']) .'</td> <td class="customtd">'.$h_exp['frequency_name'] .'</td> <td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($h_exp['annual_expense_value']) .'</td></tr>';
}
echo '</tbody>';
echo '</table>';
array_shift($order_dipaly_array);
}
// if(isset($ai_core_details) && count($ai_summary_details_processed))
// {
// echo '<p contenteditable="true">The Summary of Income :</p>';
// echo '<table class="scorecard_table">';
// echo '<thead>';
// echo $ai_summary_details_processed['ai_table_header_row'];
// echo '</thead>';
// echo '<tbody>';
// echo $ai_summary_details_processed['sale_revenue_row'];
// echo $ai_summary_details_processed['purchase_row'];
// echo $ai_summary_details_processed['gross_profit_loss_row'];
// echo $ai_summary_details_processed['business_expense_row'];
// echo $ai_summary_details_processed['net_profit_loss_row'];
// echo $ai_summary_details_processed['house_hold_expense_row'];
// echo $ai_summary_details_processed['disposable_income_row'];
// echo $ai_summary_details_processed['net_margin_row'];
// echo '</tbody>';
// echo '</table>';
// echo '<br>';
// echo '<table class="scorecard_table">';
// echo '<thead>';
// echo '<tr> <th>Particulars</th> <th>Details</th> </tr>';
// echo '</thead>';
// echo '<tbody>';
// echo $ai_summary_details_processed['considered_sales_revenue_row'];
// echo $ai_summary_details_processed['considered_net_profit_row'];
// echo $ai_summary_details_processed['considered_net_margint_row'];
// echo '</tbody>';
// echo '</table>';
// }
//echo "<div class='page_break'></div>";
//
?>
<!-- #################End of AI #################-->
<?php } // end of total_no_of_business for loop
} // end of total_no_of_business count if condition ?>
<!-- ######################END OF OVERALL BUSINESS SECTION ########################-->
<!-- #################start other asset section #################-->
<?php
$otherAssetResult=array();
$is_personal_info_available = null;
foreach($pd_processed_forms[4] as $rowKey=> $oaRow) {
$otherAssetRow = json_decode($oaRow['processed_json'],true);
$other_assest_common_remrks = $otherAssetRow['assets_form_remark'];
if(isset($otherAssetRow['asset_info_available']) && $otherAssetRow['asset_info_available'] == 1)
{
$is_personal_info_available = 1;
if(count($otherAssetRow['assets_details'])>0){
$otherAssetResult=ASSETSFORM::getOthersAssetsDetails($otherAssetRow['assets_details'],$pd_master_details[0]['pd_id']);
//print_r($otherAssetResult);
}
}
}
?>
<!-- <div id="page_break"></div> -->
<h3 contenteditable="">Personal Assets</h3>
<?php
//print_r($otherAssetResult);die();
if($is_personal_info_available != null){ ?>
<table class="scorecard_table">
<thead>
<tr>
<th>Sr.No</th>
<th>Asset Type</th>
<th>Asset Description</th>
<th>Asset Owned By</th>
<th>Approx Market Value(Rs)</th>
<?php
if($pd_master_details[0]['product_abbr'] != 'BL' && $pd_master_details[0]['product_abbr'] != 'LAEP')
{
?>
<th>Age of the Assest(Yrs)</th>
<th>Loan Again Assest</th>
<?php }?>
</tr>
</thead>
<tbody>
<?php foreach($otherAssetResult as $oakey => $paRow){
?>
<tr>
<td class="customtd"><?php echo (++$oakey); ?></td>
<td class="customtd"><?php echo $paRow['assets_mode']; ?></td>
<td class="customtd"><?php echo $paRow['about_assets']; ?></td>
<td class="customtd"><?php echo $paRow['name_of_the_owner']; ?></td>
<td class="customtd"><?php echo isset($paRow['is_sum_assured']) ? 'Sum Assured -<br> '. $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($paRow['approximate_market_value']) : $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($paRow['approximate_market_value']); ?></td>
<?php
if($pd_master_details[0]['product_abbr'] != 'BL' && $pd_master_details[0]['product_abbr'] != 'LAEP')
{
?>
<td class="customtd"><?php echo $paRow['purchase_year'] ? $paRow['purchase_year'] : 'NA'; ?></td>
<td class="customtd"><?php echo ($paRow['emi']) ? 'Yes' : 'No'; ?></td>
<?php }?>
</tr>
<?php } ?>
</tbody>
</table>
<?php }
else {?>
<p>As per Loan applicant, he does not have any other assets.</p>
<?php }
if($other_assest_common_remrks != ""){ echo '<p>'.$other_assest_common_remrks.'</p>'; }
?>
<!-- end other asset section -->
<!-- start individual banking section -->
<?php
$bankingResult=array();
$is_personal_banking_available = null;
// individual banking
foreach($pd_processed_forms[7] as $rowKey=> $ibRow) {
$individualBankRow = json_decode($ibRow['processed_json'],true);
$ind_banking_common_remarks = $individualBankRow['banking_form_remark'];
if(isset($individualBankRow['bank_info_available']) && $individualBankRow['bank_info_available'] == 1)
{
$is_personal_banking_available = 1;
if(count($individualBankRow['banking_details'])>0){
$getIndividualEachValues=BANKINGFORM::getIndividualBankingDetails($individualBankRow['banking_details'],$pd_master_details[0]['pd_id']);
$bankingResult = array_merge($bankingResult,$getIndividualEachValues);
}
}
}
?>
<?php if($is_personal_banking_available != null){
//print_r($bankingResult);
?>
<h3 contenteditable="true">Personal Banking: </h3>
<p>Below bank account details were shared :</p>
<table class="scorecard_table">
<thead>
<tr>
<th>Sr.No</th>
<th>Account Holder's Name</th>
<th>Bank Name</th>
<th>Account Type</th>
<th>OD / CC Limit</th>
<th>Vintage</th>
</tr>
</thead>
<tbody>
<?php foreach($bankingResult as $pbkey => $bdRow){
?>
<tr>
<td class="customtd"><?php echo (++$pbkey); ?></td>
<td class="customtd"><?php echo $bdRow['account_name'] ?></td>
<td class="customtd"><?php echo $bdRow['bank_name'] ?></td>
<td class="customtd"><?php echo $bdRow['account_type'] ?></td>
<td class="customtd"><?php echo $bdRow['od_cc_limit'] ? $bdRow['od_cc_limit'] : "NA" ?></td>
<td class="customtd"><?php echo $bdRow['vintage'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php
}
if($ind_banking_common_remarks != ''){echo '<p>'.$ind_banking_common_remarks.'</p>'; } ?>
<!-- #################end business / individual banking section #################-->
<!-- start other income section -->
<?php
//
$otherIncomeResult=array();
$is_other_income_available = null;
foreach($pd_processed_forms[9] as $rowKey=> $iRow) {
$otherIcomeRow = json_decode($iRow['processed_json'],true);
$other_source_income_common_remarks = $otherIcomeRow['otherincome_remarks'];
if(strtoupper($otherIcomeRow['other_income'])=='YES' && count($otherIcomeRow['income_details'])>0){
$is_other_income_available = 1;
$otherIncomeResult=OTHERINCOMEFORM::getIncomeDetails($otherIcomeRow['income_details'],$pd_master_details[0]['pd_id']);
}
}
?>
<br>
<h3 contenteditable="true">Other Sources of Income of Individual Loan Applicants:</h3>
<?php if($is_other_income_available != null){
//print_r($otherIncomeResult);
?>
<table class="scorecard_table">
<thead>
<tr>
<th>Sr.No</th>
<th>Income Source</th>
<th>Earned by</th>
<th>Amount(Rs)</th>
</tr>
</thead>
<tbody>
<?php foreach($otherIncomeResult as $oidkey =>$oiRow){
?>
<tr>
<td class="customtd"><?php echo (++$oidkey) ?></td>
<td class="customtd"><?php echo $oiRow['source']; if(!strcasecmp($oiRow['source'], 'RENTAL INCOME') && isset($pd_processed_forms[17][0]['processed_json']) ){ echo '<br>(Details Available in Annexure B)'; $GLOBALS['is_rental_available'] = 1 ; } ?></td>
<td class="customtd"><?php echo $oiRow['earned_by'] ?></td>
<td class="customtd"><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($oiRow['amount']).' '.$oiRow['frequency'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php }
else {?>
<p>As per the loan applicants, they do not have any other source of Income.</p>
<?php }
if($other_source_income_common_remarks != ''){ echo '<p>'. $other_source_income_common_remarks.'</p>'; }
?>
<!-- end other income section -->
<!-- #################start family section #################-->
<?php
$familyResult=array();
foreach($pd_processed_forms[6] as $rowKey=> $fRow) {
$familyRow = json_decode($fRow['processed_json'],true);
//print_r($familyRow);die();
$other_family_form_common_remarks = $familyRow['family_details_form_remark'];
if(array_key_exists('family_details',$familyRow) && count($familyRow['family_details'])>0){
$familyResult=OTHERFAMILYFORM::getFamilyDetails($familyRow['family_details'],$pd_master_details[0]['pd_id']);
}
}
?>
<h3 contenteditable="true">Family Information:</h3>
<?php if(count($familyResult)>0){
//print_r($familyResult);
?>
<!-- <div id='page_break'></div> -->
<?php foreach($familyResult as $fmKey => $fmValue) { ?>
<!-- <p><strong><?php //echo ($fmKey+1).'. '.$fmValue['selected_person']; ?></strong></p> -->
<?php
$intro_text = '<span class="tooltip">'.$fmValue['selected_person_title'].$fmValue['selected_person'].'<span class="tooltiptext">Family Information - Select person for capturing family details</span></span>, <span contenteditable="true">who is an applicant in the case, resides at </span><span class="tooltip">'.$fmValue['residency_address'].'<span class="tooltiptext">Family Information - Residence Address of Select person </span></span><span contenteditable="true">.</span>';
$residence_text ='<span contenteditable="true">This is a </span><span class="tooltip">'. $fmValue['residence_ownership'].' <span class="tooltiptext">Family Information - Ownership of Residence </span></span><span contenteditable="true"> residence, where the applicant has been staying for </span><span class="tooltip">'. $fmValue['residence_No_of_years'].'<span class="tooltiptext">Family Information - No of Yrs in current residence </span></span><span contenteditable="true">.</span>';
$residence_text .= (!strcasecmp($fmValue['residence_ownership'],'rented')) ? '<span contenteditable="true"> The rent paid '.$rupee_symbol.' </span>'.$fmValue['rent'].'<span contenteditable="true"> per month.</span>' : '';
$clix_dependency_text = 'There are '.$fmValue['no_family_members_clix'].' family member(s) ';
$clix_dependency_text .= isset($fmValue['no_dependents_clix']) && $fmValue['no_dependents_clix'] != 0 ? ' of which ' . ($fmValue['no_dependents_clix'] == 1 ? 'One is' : $fmValue['no_dependents_clix']. ' are'). ' dependent on applicant.' : ' and none of them dependent on applicant.';
echo '<p>' . $intro_text . '</p>';echo '<p>' . $residence_text . '</p>';
echo '<p>' . $clix_dependency_text . '</p>';
?>
<!-- <p>The table below provides details of other family members of <?php echo $fmValue['selected_person']." :";?></p>
<table class="scorecard_table">
<thead>
<tr>
<th>Sr.No</th>
<th>Name</th>
<th>Relation</th>
<th>Age</th>
<th>Earning Status</th>
<th>Occupation Details</th>
</tr>
</thead>
<tbody>
<?php //foreach($fmValue['family_members_details'] as $fmdkey => $fmRow){
?>
<tr>
<td class="customtd"><?php echo (++$fmdkey) ?></td>
<td class="customtd"><?php echo $fmRow['name'] ?></td>
<td class="customtd"><?php echo $fmRow['family_member_relationship'] ?></td>
<td class="customtd"><?php echo $fmRow['family_member_age'] ?></td>
<td class="customtd"><?php echo $fmRow['family_member_earning'] ?></td>
<td class="customtd"><?php echo $fmRow['family_member_occupation'] ?></td>
</tr> -->
<?php //} ?>
<!-- </tbody>
</table> -->
<?php }?>
<?php }
// else{?>
<!-- <p>Other Family Members is not available.</p> -->
<?php //}
if($other_family_form_common_remarks != ""){ echo '<p>'.$other_family_form_common_remarks.'</p>'; }
?>
<!-- #################end family section #################-->
<!-- #################start Existing Loan obligations section################# -->
<?php
//
$existLoanResult=array();
$is_existing_loans_available = null;
foreach($pd_processed_forms[8] as $rowKey=> $elRow) {
$otherLoanRow = json_decode($elRow['processed_json'],true);
$existing_loan_form_common_remarks = $otherLoanRow['currentloan_remarks'];
$is_all_loan_details_availble = 'yes';
$out_standing_loan_info = array();
if(array_key_exists('loan_info_available',$otherLoanRow))
{
$is_all_loan_details_availble = $otherLoanRow['loan_info_available'];
}
$total_no_of_data = 0;
if(strtoupper($otherLoanRow['existing_loan'])=='YES' && (!strcasecmp($is_all_loan_details_availble,'yes') && count($otherLoanRow['loan_details'])>0)){
$is_existing_loans_available = 1;
$total_no_of_data = count($otherLoanRow['loan_details']);
$existLoanResult=FINANCIALFORM::getOtherLoanDetails($otherLoanRow['loan_details'],$pd_master_details[0]['pd_id']);
}
else if(!strcasecmp($is_all_loan_details_availble,'no'))
{
$out_standing_loan_info['tot_running_loans'] = $otherLoanRow['tot_running_loans'];
$out_standing_loan_info['tot_emi_paid'] = $otherLoanRow['tot_emi_paid'];
$out_standing_loan_info['tot_outstanding_loans'] = $otherLoanRow['tot_outstanding_loans'];
}
}
?>
<br>
<h3 contenteditable="true">Existing loan obligation</h3>
<?php if($is_existing_loans_available != null && (!strcasecmp($is_all_loan_details_availble,'yes'))){
//print_r($existLoanResult);
?>
The table below lists the details of Existing Loan Obligations of the Loan Applicants.
<br><br>
<?php
$pre_loan_no = 0;
foreach($existLoanResult as $table_key => $single_table){
//print_r($single_table);die();
?>
<table class="scorecard_table_resonal_assest" >
<!-- <thead> -->
<tr>
<th>Particulars</th>
<?php for($header = 1;$header <= $single_table['total_header']; $header++ )
{ $pre_loan_no++; echo "<th>Loan $pre_loan_no</th>"; } ?>
</tr>
<!-- </thead> -->
<tbody>
<?php
echo $single_table['first_row'];
echo $single_table['second_row'];
//echo $existLoanResult['third_row'];
echo $single_table['fourth_row'];
echo $single_table['fifth_row'];
echo $single_table['sixth_row'];
echo $single_table['seventh_row'];
echo $single_table['eigth_row'];
echo $single_table['ninth_row'];
echo $single_table['tenth_row'];
?>
</tbody>
</table>
<?php
//
}
}
elseif (!strcasecmp($is_all_loan_details_availble,'no') && ($out_standing_loan_info['tot_running_loans']))
{
?>
The table below lists the details of Existing Loan Obligations of the Loan Applicants.
<table class="scorecard_table"><thead><tr>
<th>Total No of Running Loans</th><th>Total Outstanding Amount</th><th>Total EMI being Paid (Monthly)</th></tr></thead><tbody>
<tr> <td class="customtd"><?php echo $out_standing_loan_info['tot_running_loans'] ?></td> <td class="customtd"><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($out_standing_loan_info['tot_outstanding_loans']) ?></td> <td class="customtd"><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($out_standing_loan_info['tot_emi_paid']) ?></td> </tr>
</tbody></table>
<?php
}
else {?>
<p>As per loan applicant he does not have any existing loan obligations.</p>
<?php } ?>
<?php
if($existing_loan_form_common_remarks != ""){ echo '<p>'.$existing_loan_form_common_remarks.'</p>';}
?>
<!-- #################end Existing Loan obligations section ################# -->
<!-- #################start neighbourhood/reference check #################-->
<?php
$existNeighRefCheck=array();
$pd_offiecer_status_about_neighbor = "";
foreach($pd_processed_forms[19] as $rowKey=> $nrcRow) {
$neighbourRefRow = json_decode($nrcRow['processed_json'],true);
//print_r($applicants_details);
//print_r($neighbourRefRow);die();
$neighbourhood_form_common_remarks = $neighbourRefRow['neighbour_reference_remark'];
if(strcasecmp($neighbourRefRow['neighbourhood_status'],'could not verify')){
$pd_offiecer_status_about_neighbor = $neighbourRefRow['neighbourhood_status'];
if(count($neighbourRefRow['neighbourhood_list'])>0){
$company_name = MYUTIL::findCompanyName($all_company_details,1,1);
$existNeighRefCheck=NEIGHBOURREFERENCECHECKFORM::getNeighbourhoodDetails($company_name,$neighbourRefRow['neighbourhood_list'],$pd_master_details[0],$applicants_details);//applicants_details comes from controller
}
}
// if(&& count($neighbourRefRow['referencecheck_list'])>0){
// $existNeighRefCheck=NEIGHBOURREFERENCECHECKFORM::getReferenceDetails($neighbourRefRow['referencecheck_list'],$pd_master_details[0]);
// }
}
?>
<h3 contenteditable="true">Neighbourhood / Reference Check</h3>
<?php
//echo $pd_offiecer_status_about_neighbor;
if(count($existNeighRefCheck)>0){
//print_r($existNeighRefCheck);die();
?>
<?php foreach($existNeighRefCheck as $nkey => $nfValue) {
echo $nfValue['neighbourhood_name_only'];
?>
<ul>
<li style="margin: 15px 0;"><?php echo $nfValue['neighbourhood_name']; ?></li>
<li style="margin: 15px 0;"><?php echo $nfValue['neighbourhood_do_know']; ?></li>
<li style="margin: 15px 0;"><?php echo $nfValue['neighbourhood_business_running_yr']; ?></li>
<li style="margin: 15px 0;"><?php echo $nfValue['ownership']; ?>
</ul>
<?php }?>
<li style="margin: 15px 0;"> Neighbourhood Check Status is <span style="font-size:16px;font-weight:bold;"><?php echo $pd_offiecer_status_about_neighbor;?>.</span></li>
</li>
<?php
}
else{?>
<!-- <p>Status of check: Could Not Verify. <br>Neighbour Check was not possible due to Could not verify</p> -->
<!-- <p>Neighbour Check was not possible due to Could not verify</p> -->
<p>Status of the check: could not verify.<p>
<?php
}
if($neighbourhood_form_common_remarks != ""){ echo '<p>'. $neighbourhood_form_common_remarks.'</p>';}
?>
<!-- #################end neighbourhood/reference check #################-->
<!-- #################Credit Manager Specific Query Section #################-->
<?php
$credit_officier_specific_queries = array();
if(isset($pd_processed_forms[24])) {
$credit_officier_specific_queries = json_decode($pd_processed_forms[24][0]['processed_json'],true);
}
// echo 'CREDIT ********************';
// print_r($data['pd_processed_forms'][24]);
//print_r($credit_officier_specific_queries);
// if(count($credit_officier_specific_queries))
// {
echo '<br>';
echo '<h3 contenteditable="true">Credit Manager`s Specific Queries:</h3>';
//echo '<br>';
if(isset($credit_officier_specific_queries['additional_requirements_processed']) && count($credit_officier_specific_queries['additional_requirements_processed']))
{
foreach ($credit_officier_specific_queries['additional_requirements_processed'] as $key => $value)
{
echo 'Question - '.$value['question'].'<br>';
echo 'Answer - '. $value['answer'];
echo '<br><br>';
}
}
else
{
echo 'There are no specific queries raised by Credit Manager.';
}
echo '<br>';
echo '<h3 contenteditable="true">Documents to be collected: </h3>';
//
if(isset($credit_officier_specific_queries['docs_to_be_sighted_processed']) && count($credit_officier_specific_queries['docs_to_be_sighted_processed']))
{
foreach ($credit_officier_specific_queries['docs_to_be_sighted_processed'] as $doc_key => $doc_value)
{
echo 'Document Required : ' . $doc_value['doc_name'].'<br>';
echo 'Provided ( Yes / No ) : ' . ($doc_value['ans'] == 'yes' ? 'YES, Document available in zipped file enclosed with report'.'<br>' : 'NO<br>');
if($doc_value['ans'] != 'yes')
{
echo 'Reason : ' .$doc_value['reason'];
}
echo '<br><br>';
}
}
else
{
echo 'There are no specific documents to be collect.';
}
//}
?>
<!-- #################End of Credit Manager Specific Query Section #################-->
<!-- #################Final Remarks Section#################-->
<div class="page_break"></div>
<br><h3 contenteditable="true">PD OFFICER`S REMARKS ON CUSTOMER BEHAVIOUR, BUSINESS LOCATION & OVERALL PD STATUS</h3>
<?php
//print_r($final_remark_data);
$polite = null;$rude = null; $other_behaviour = null;$other_behaviour_remarks = null;
$fair = null;$well = null;$not = null;
$positive = null;$negative = null;$refer_to_credit = null;$fo_diplay = null;
$other_pd_officer_command = null;$other_command_remark = null;
$other_pd_officer_recommandation = null;$other_pd_officer_recommandation_remark = null;
if($final_remark_data['final_custormer_remark_type'] == 3){$polite = 1;}
else if($final_remark_data['final_custormer_remark_type'] == 2){$rude = 1;}
else if($final_remark_data['final_custormer_remark_type'] == 1){$other_behaviour = 1;
$other_behaviour_remarks = $final_remark_data['final_other_customer_behaviour'];
}
if(!strcasecmp($final_remark_data['is_service_provided'],'fairly_suited')){ $fair = 1;}
else if(!strcasecmp($final_remark_data['is_service_provided'],'well_suited')){$well = 1;}
else if(!strcasecmp($final_remark_data['is_service_provided'],'not_suited')){$not = 1;}
if($final_remark_data['pd_officers_recommendation'] == 2){$positive = 1;$fo_diplay = "Positive";}
else if($final_remark_data['pd_officers_recommendation'] == 3){
$negative = 1;$fo_diplay = "Negative";}
else if($final_remark_data['pd_officers_recommendation'] == 4){$refer_to_credit = 1;$fo_diplay = "Refer to credit";}
else if($final_remark_data['pd_officers_recommendation'] == 1){
$other_pd_officer_command = 1;
$other_command_remark = $final_remark_data['others_pd_officers_recommendation'];
}
$pd_officer_final_remark = isset($final_remark_data['final_form_remarks']) ? $final_remark_data['final_form_remarks'] : '';
//if(is_null($other_behaviour)){ echo 'null'; }
?>
<div>
<?php
if(isset($final_remark_data['market_intelligence']) && $final_remark_data['market_intelligence'] != '')
{
echo '<div class="intelligence">';
echo '<h3>Personal feedback or market intelligence on the case (if any):</h3>';
echo '<p>'.$final_remark_data['market_intelligence'].'</p>';
echo '</div>';
}
?>
<ul>
<li>Customer Behaviour: </li>
<br><br>
<!-- <table cellspacing="25">
<tr>
<td><div id="boxstyle2">polite&nbsp;&nbsp;&nbsp;<div class="ver_line"><?php if($polite){?><span style='font-family: DejaVu Sans; sans-serif;font-size:12px'>&#10004;</span><?php } ?></div></div></td>
<td><div id="boxstyle2">Rude&nbsp;&nbsp;&nbsp;<?php if($rude){?><span style='font-family: DejaVu Sans; sans-serif;font-size:12px'>✔</span><?php } ?></div></td>
<td><div id="boxstyle2">Others as mentioned below &nbsp;&nbsp;&nbsp;<?php if($other_behaviour){?><span style='font-family: DejaVu Sans; sans-serif;font-size:12px'>✔</span><?php } ?></div></td>
</tr>
</table> -->
<?php $tick_mark ='<span style="font-family: DejaVu Sans; sans-serif;font-size:12px">✔</span>';
?>
<table>
<tr>
<td>
<div id="first_div" style="border-color:green;color:black;">Polite</div> <div id="tick_div" style="border-color:green;color:black;"><?php if($polite){ echo $tick_mark; } ?></div>
</td>
<td style="padding-left:50px;">
<div id="first_div" style="border-color:red;color:black;">Rude</div> <div id="tick_div" style="border-color:red;color:black;"><?php if($rude){ echo $tick_mark; } ?></div>
</td>
<?php if(!is_null($other_behaviour)){ ?>
<td style="padding-left:50px;">
<div id="first_div" style="border-color:red;color:black;">Others*</div> <div id="tick_div" style="border-color:red;color:black;"><?php if($other_behaviour){ echo $tick_mark; } ?></div>
</td>
<?php } ?>
</tr>
</table>
<br>
<?php if($other_behaviour){
echo "*".$other_behaviour_remarks;
echo '<br><br>';
}?>
<li>Suitability of Business Location: </li>
<br><br>
<table>
<!-- <tr>
<td><div id="boxstyle3">Well Suited&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php if($well){?><span style='font-family: DejaVu Sans; sans-serif;font-size:12px'>&#10004;</span><?php } ?></div></td>
<td><div id="boxstyle3">Fairly Suited&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php if($fair){?><span style='font-family: DejaVu Sans; sans-serif;font-size:12px'>&#10004;</span><?php } ?></div></td>
<td><div id="boxstyle3">Not Suited&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php if($not){?><span style='font-family: DejaVu Sans; sans-serif;font-size:12px'>&#10004;</span><?php } ?></div></td>
</tr>-->
<tr>
<td >
<div id="first_div" style="border-color:green;color:black;">Well Suited</div> <div id="tick_div" style="border-color:green;color:black;"><?php if($well){ echo $tick_mark; } ?></div>
</td>
<td style="padding-left:50px;">
<div id="first_div" style="border-color:#ffff00;color:black;">Fairly Suited</div> <div id="tick_div" style="border-color:#ffff00;color:black;"><?php if($fair){ echo $tick_mark; } ?></div>
</td>
<td style="padding-left:50px;">
<div id="first_div" style="border-color:red;color:black;">Not Suited</div> <div id="tick_div" style="border-color:red;color:black;"><?php if($not){ echo $tick_mark; } ?></div>
</td>
</tr>
</table>
<br>
<li>PD Officers overall assessment: </li>
<br><br>
<table >
<!-- <tr>
<td><div id="boxstyle3">Positive&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php if($positive){?><span style='font-family: DejaVu Sans; sans-serif;font-size:12px'>&#10004;</span><?php } ?></div></td>
<td><div id="boxstyle3">Refer to Credit&nbsp;&nbsp;&nbsp;&nbsp;<?php if($refer_to_credit){?><span style='font-family: DejaVu Sans; sans-serif;font-size:12px'>&#10004;</span><?php } ?></div></td>
<td><div id="boxstyle3">Negative&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php if($negative){?><span style='font-family: DejaVu Sans; sans-serif;font-size:12px'>&#10004;</span><?php } ?></div></td>
</tr>
<?php if($other_pd_officer_command){?>
<td><div id="boxstyle3">Others&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php if($other_pd_officer_command){?><span style='font-family: DejaVu Sans; sans-serif;font-size:12px'>&#10004;</span><?php } ?></div></td>
<?php } ?>
</tr> -->
<tr>
<?php if($other_pd_officer_command == null){?>
<td >
<div id="first_div" style="border-color:green;color:black;">Positive</div> <div id="tick_div" style="border-color:green;color:black;"><?php if($positive){ echo $tick_mark; } ?></div>
</td>
<td style="padding-left:50px;">
<div id="first_div" style="border-color:#ffff00;color:black;">Refer to Credit</div> <div id="tick_div" style="border-color:#ffff00;color:black;"><?php if($refer_to_credit){ echo $tick_mark; } ?></div>
</td>
<td style="padding-left:50px;">
<div id="first_div" style="border-color:red;color:black;">Negative</div> <div id="tick_div" style="border-color:red;color:black;"><?php if($negative){ echo $tick_mark; } ?></div>
</td>
<?php }?>
<?php if($other_pd_officer_command){?>
<td>
<div id="first_div" style="border-color:red;color:black;">Others*</div> <div id="tick_div" style="border-color:red;color:black;"><?php if($other_pd_officer_command){ echo $tick_mark; } ?></div>
</td>
<?php } ?>
</tr>
</table>
<br>
<?php if(!$other_pd_officer_command){?>
</ul>
</div>
<p style="text-align:justify;">PD officer recommendation is <?php
if($positive){ $color_for_pd_offcier_recom = 'green';} else if($negative) { $color_for_pd_offcier_recom = 'red';}else{ $color_for_pd_offcier_recom = 'black';}
echo '<strong><span style="font-size:20px;color:'.$color_for_pd_offcier_recom.';">'.$fo_diplay.'</span>.</strong></p>';?> <p style="text-align:justify;">The following key points were considered while arriving at the aforementioned status.</p>
<?php
//
if($positive){ echo "<ul>"; foreach($final_remark_data['recommendation_positive'] as $pos){ echo "<li>".$pos['reason_for_positive']."</li>";}
}else if($negative){ echo "<ul>"; foreach($final_remark_data['recommendation_negative'] as $neg){ echo "<li>".$neg['reason_for_negative']."</li>";}
}
else if($refer_to_credit){ echo "<ul>"; foreach($final_remark_data['recommendation_refer_to_credit'] as $rtc){ echo "<li>".$rtc['reason_for_refer_to_credit']."</li>";}
}
echo "</ul>";
?>
<?php } else{ echo "<p>".$other_command_remark."</p>";}
echo '<p style="text-align:justify;">'.$pd_officer_final_remark.'</p>'
?>
<!-- #################End Final Remarks Section#################-->
<!-- #################Annexure A section start#################-->
<?php if($total_no_of_business > 0) {
for($business_count = 0;$business_count < $total_no_of_business; $business_count++)
{
if(is_array($assessed_income_details) && count($assessed_income_details) && isset($assessed_income_details[ ($business_count+1) ] ) && count($ai_core_details['sales_calculated_by_itemwise']))
{
echo '<div id="page_break"></div>';
echo '<p> Annexure A</p>';
if(isset($ai_core_details) && count($ai_core_details['sales_calculated_by_itemwise']))
{
//echo "<br>";
echo '<p contenteditable="true">Kuchha Sales Book/Bills Details: </p>';
//print_r($ai_core_details_processed['sales_item_wise_to_diaplay']);//die();
foreach($ai_core_details_processed['sales_item_wise_to_diaplay'] as $sale_month_wise)
{
//echo '<div id="billwise">';
if($sale_month_wise['sales_type'] == 3 || $sale_month_wise['sales_type'] == 2)
{
//print_r($sale_month_wise);//die();
echo 'Item name : <b>' . $sale_month_wise['sale_item'] .'</b><br>';
if($sale_month_wise['sales_type'] == 3)
{
echo '<b>'.$sale_month_wise['month_count'].'</b> month sales value : <b>'.$rupee_symbol.''.MYUTIL::customIndianNumberFormat($sale_month_wise['total_months_value']).'</b> Annual Sales value:<b>'.$rupee_symbol.'' .MYUTIL::customIndianNumberFormat(($sale_month_wise['total_months_value'] * (12 / $sale_month_wise['month_count']) )).' (i.e. ' . (12 / $sale_month_wise['month_count']).' * '. $sale_month_wise['total_months_value'] .')</b>';
}
else
{
echo 'Annual Sales value:<b>'. $rupee_symbol.' '.MYUTIL::customIndianNumberFormat(($sale_month_wise['total_months_value'] )).'</b>';
}
echo '<hr>';
echo '<div style="display:table;width:100%;border: 1px solid #0191ed;">';
$row_count = ceil(count($sale_month_wise['months']) / 5);
//print_r(($sale_month_wise['months']));
// echo $row_count;
//die();
echo '<div style="display: table-cell;width:600px;text-align:center;">';
for($i = 0; $i <= $row_count; $i++)
{
$from = $i== 0 ? $i : ($i + 3);
$to = ($from + 3);
//echo '<tr>';
for($j = $from ; $j <= $to ;$j++)
{
//$sale_month_wise['months'] as $sale_month_data
//echo '<span style="display:inline;width:auto;height:auto;padding: 5px;">';
if(isset($sale_month_wise['months'][$j]))
{
//print_r($sale_month_wise['months'][$j]) ;die();
echo '<div style="display: inline-block;vertical-align: top;width: auto;">';
//echo '<table class="annexure_table">';
echo '<table class="annexure_table">';
echo '<thead>';
if($sale_month_wise['sales_type'] == 3)
{
echo '<tr> <th colspan="2">'.$sale_month_wise['months'][$j]['month_to_dispaly'].'</th> </tr>';
}
if($sale_month_wise['sales_type'] == 3)
{
echo '<tr> <th>Date</th> <th>Value</th></tr>';
}else if(($sale_month_wise['sales_type'] == 2))
{
echo '<tr> <th>Frequncy</th> <th>Value</th></tr>';
}
echo '</thead>';
echo '<tbody>';
$month_sub_total = 0;
foreach($sale_month_wise['months'][$j]['month_data'] as $m_key => $month)
{
if($sale_month_wise['sales_type'] == 3)
{
echo '<tr> <td>'.$month['date'] .'</td> <td>'.$month['value'] .'</td> </tr>';
$month_sub_total += $month['value'];
}
//if($m_key == 20)break;
else if($sale_month_wise['sales_type'] == 2)
{
echo '<tr> <td>'.$month['frequency_name'] .'</td> <td>'.$month['frequency_value'] .'</td> </tr>';
$month_sub_total += $sale_month_wise['annual_sale_value'];
}
}
echo '<tr> <th> Total </th> <th>'. MYUTIL::customIndianNumberFormat ( $month_sub_total ) .'</th> </tr>';
$month_sub_total = 0;
echo '</tbody>';
echo '</table>';
echo '</div>';
echo '&nbsp;&nbsp;&nbsp;';
}
}
//echo '</tr>';
}
echo '</div>';
echo '</div>';
}
}
}
}// end of if AI available in current business count
}//end of total no of business for loop
}
?>
<!-- #################End Annexure A section ################-->
<!-- #################Annexure B(RI) section start#################-->
<?php
if(isset($GLOBALS['is_rental_available']) && $GLOBALS['is_rental_available'] == 1)
{
$rental_data = array();
foreach($pd_processed_forms[17] as $rental_property_key => $rental_property)
{
//echo $rental_property_key;
$current_property = json_decode($rental_property['processed_json'],true);
$rental_data[] = RENTALFORM::getRentalText($current_property);
}
if(count($rental_data))
{
echo '<div id="page_break"></div>';
echo '<p><b>Annexure B : Rental Income Details</b></p>';
foreach ($rental_data as $key => $value) {
echo '<br><b>Property : '.($key + 1).'</b>';
echo '<br><br>Address of Property : <b>'.($value['address_property']).'</b>';
echo '<br><br>Type of Property : <b>'.($value['type_of_property']).'</b>';
echo '<br><br>Name of the Property Owner`s : <b>'.($value['property_owners_name']).'</b>';
echo '<br><br>Name of the person`s who showing Property : <b>'.($value['property_showing_persons_name']).'</b>';
echo '<br><br>Property Document Proof Seen : <b>'.($value['property_document_proof_visted']).'</b>';
if(!strcasecmp($value['property_document_proof_visted'],'yes')) { echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type of Property Document Visted : <b>'.($value['type_of_document_visited']).'</b>'; }
echo '<br><br>Unit Type : <b>' . ($value['unit_type']) . '</b>';
echo '<br><br>No of Floors/Units : <b>'.($value['no_of_floors']).'</b>';
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; echo $value['area_coverd'] != "" ? 'Area covered : <b>'.($value['area_coverd'].' '.$value['area_uom'].'</b>') : '';
if(isset($value['unit_details']['multistorey']) && count($value['unit_details']['multistorey']))
{
echo '<p><b>Multistorey Details:</b></p>';
echo '<table class="scorecard_table">';
echo '<tr> <th>Floor Name</th> <th>No of Units</th> <th>Rent same for <br> all Units</th> <th>Unit Details</th> <th>Total <br> Rent Amount</th></tr>';
foreach($value['unit_details']['multistorey'] as $multistorey_key => $multistorey_value)
{
echo '<tr> <td class="customtd">'. $multistorey_value['floor_name'] .'</td> <td class="customtd">'. $multistorey_value['no_units_in_floor'] .'</td><td class="customtd">'. $multistorey_value['same_rent'] .'</td><td class="customtd">'. $multistorey_value['unit_details'] .'</td><td class="customtd">'. $multistorey_value['total_floor_rent'] .'</td></tr>';
}
echo '<tr><td class="customtd" colspan="4"> Total </td><td class="customtd">'. $rupee_symbol.' '.$value['unit_details']['multistorey_over_all_total'].'</td></tr>';
echo '</table>';
}
echo '<p><b>Unit Details:</b></p>';
foreach ($value['unit_details']['property_core'] as $u_key => $unit_value) {
echo '<br>';
echo $unit_value['unit_name'];
echo '<table class="scorecard_table">';
echo $unit_value['header_row'];
echo $unit_value['first_owners_row'];
echo $unit_value['second_lessee_name_row'];
echo $unit_value['third_area_of_unit_row'];
echo $unit_value['fourth_payment_mode_row'];
echo $unit_value['fifth_lease_period_row'];
echo $unit_value['sixth_security_deposit_row'];
echo $unit_value['eigth_current_rent_received_row'];
echo $unit_value['nineth_difference_between_rent_amount_row'];
echo '</table>';
}
//print_r($value['third_check_details']);
if($value['third_check_details']['done_third_party_check'])
{
echo '<br>For property'.($key + 1).' Third Party check was done with ' . $value['third_check_details']['whom_third_party_check_done'];
echo isset($value['third_check_details']['description_third_party_check_done']) ? ' ('. $value['third_check_details']['description_third_party_check_done'].'). ' : ' ';
if($value['third_check_details']['rental_rates_third_party_check_done'] != "")
{
echo 'Rental rates in the area as per person whom third party check is done is '.$value['third_check_details']['rental_rates_third_party_check_done'];
}
}
else
{
echo '<br>For property '.($key + 1).' Third Party check not done.';
echo isset($value['third_check_details']['why_third_party_check_not_done']) && $value['third_check_details']['why_third_party_check_not_done'] != "" ?'Resaon - '.$value['third_check_details']['why_third_party_check_not_done'] : '';
}
echo '<br>' . $value['property_remark'];
}
}
}
?>
<!-- #################END of Annexure B(RI) section start#################-->
<?php
$show_detailed_scorecard = null;
if($show_detailed_scorecard)
{
echo '<div id="page_break"></div>';
echo "<h3>Detailed Score Card Section</h3>" ;
// *** General Section Questions Score Table
echo '<table class="scorecard_table2">';
echo "<tr> <th>General Questions L1(". $pd_score['general']['otp_done']['l1_weightage']."%) </th> <th>L2</th> <th>Answer</th> <th>Score</th> <th>Attributed Score</th> <th>Max Score</th></tr>";
foreach($pd_score['general'] as $key => $general)
{
$question = MYUTIL::findQuestionByKey($score_questions_display,$key);
$span = '<span style="font-size:9px">('.$general['l1_weightage'].'% * '. $general['l2_weightage'].'% * '.$general['score_band'].')</span>';
$max_span = '<span style="font-size:9px">('.$general['l1_weightage'].'% * '. $general['l2_weightage'].'% * '.$general['max_score_band'].')</span>';
echo '<tr>'.'<td>'.$question.'</td><td class="customtd">'.$general['l2_weightage'] .'%</td><td class="customtd">'.$general['answer'].
'</td><td class="customtd">'.$general['score_band'].'</td><td class="customtd">'.$general['attributed_score'].'<br>'.$span.'</td><td class="customtd">'.$general['max_score'].'<br>'.$max_span.'</td></tr>';
}
echo '<tr> <td colspan="4">General Section Sum of Attributed Score | Sum of Max Score </td> <td class="customtd">'.number_format($pd_score['score_summary']['general']['actual_score'],2,'.',',').'</td> <td class="customtd">'.number_format($pd_score['score_summary']['general']['max_score'],2,'.',',').'</td> </tr>';
echo '</table>';
echo '<br><br>';
// *** Asset Caculation Score Table
echo '<table class="scorecard_table2">';
echo "<tr> <th colspan='2'>Asset Value Calculaitons</th></tr>";
echo "<tr> <td>Actual Value Of Assets (a)</td><td>". number_format($pd_score['score_summary']['asset_calculation_details']['actual_value_of_assets'],2,'.',',')."</td></tr>";
echo "<tr> <td>Loan Amount (b)</td><td>". number_format($pd_score['score_summary']['asset_calculation_details']['loan_amount'],2,'.',',')."</td></tr>";
echo "<tr> <td>Avg Expected Value Of Assets (c)</td><td>". round($pd_score['score_summary']['asset_calculation_details']['avg_expected_value_of_assets'],2)."%</td></tr>";
echo "<tr> <td>Expected Value Of Assets (d = c*b)</td><td>". number_format($pd_score['score_summary']['asset_calculation_details']['expected_value_of_assets'],2,'.',',')."</td></tr>";
echo "<tr> <td>Actual Value Of Assets Percentage (e = (a/b) * 100)</td><td>". round($pd_score['score_summary']['asset_calculation_details']['actual_value_of_assets_percentage'],2)."%</td></tr>";
echo "<tr> <td>Variance (f = ((e-c)/c) * 100)</td><td>". round($pd_score['score_summary']['asset_calculation_details']['variance'],2)."%</td></tr>";
echo "<tr> <td>Score As per Grid</td><td>". round($pd_score['score_summary']['asset_calculation_details']['score'],2)."</td></tr>";
echo '</table>';
echo '<br><br><br>';
// *** Final Remarks Questions Score Table
echo '<table class="scorecard_table2">';
echo "<tr> <th>Final Remarks Questions L1(". $pd_score['final_remarks']['pd_officer_recommandations']['l1_weightage']."%)</th> <th>L2</th><th>Answer</th> <th>Score</th><th>Attributed Score</th> <th>Max Score</th></tr>";
foreach($pd_score['final_remarks'] as $key => $final_remark)
{
$question = MYUTIL::findQuestionByKey($score_questions_display,$key);
$span = '<span style="font-size:9px">('.$final_remark['l1_weightage'].'% * '. $final_remark['l2_weightage'].'% * '.$final_remark['score_band'].')</span>';
$max_span = '<span style="font-size:9px">('.$final_remark['l1_weightage'].'% * '. $final_remark['l2_weightage'].'% * '.$final_remark['max_score_band'].')</span>';
echo '<tr>'.'<td>'.$question.'</td><td class="customtd">'.$final_remark['l2_weightage'].'%</td><td class="customtd">'.$final_remark['answer'].'</td><td class="customtd">'.$final_remark['score_band'].'</td><td class="customtd">'.$final_remark['attributed_score'].'<br>'.$span.'</td><td class="customtd">'.$final_remark['max_score'].'<br>'.$max_span.'</td></tr>';
}
echo '<tr> <td colspan="4">Final Remarks Section Sum of Attributed Score | Sum of Max Score </td> <td class="customtd">'.number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.',',').'</td> <td class="customtd">'.number_format($pd_score['score_summary']['final_remarks']['max_score'],2,'.',',').'</td> </tr>';
echo '</table>';
echo '<br><br><br>';
//print_r($pd_score['business']);
echo '<table class="scorecard_table2">';
// *** Business Section Questions Score Table
echo "<tr> <th>Business Questions L1(". $pd_score['business']['no_of_years_business_run']['l1_weightage']."%)</th> <th>L2</th><th>Answer</th> <th>Score</th> <th>Attributed Score</th><th>Max Score</th></tr>";
$certificates = array();
foreach($pd_score['business'] as $key => $business)
{
$question = MYUTIL::findQuestionByKey($score_questions_display,$key);
$span = '<span style="font-size:9px">('.$business['l1_weightage'].'% * '. $business['l2_weightage'].'% * '.$business['score_band'].')</span>';
$max_span = '<span style="font-size:9px">('.$business['l1_weightage'].'% * '. $business['l2_weightage'].'% * '.$business['max_score_band'].')</span>';
if(($key != 'cerificates') && ($key != 'location_suited_for_busienss'))
{
echo '<tr>'.'<td>'.$question.'</td><td class="customtd">'.$business['l2_weightage'].'%</td><td class="customtd">'.$business['answer'].'</td><td class="customtd">'.$business['score_band'].'</td><td class="customtd">'.$business['attributed_score'].'<br>'.$span.'</td><td class="customtd">'.$business['max_score'].'<br>'.$max_span.'</td></tr>';
}
if($key == 'location_suited_for_busienss')
{
echo '<tr>'.'<td>'.$question.'</td><td class="customtd">'.$business['l2_weightage'].'%</td><td class="customtd">'.$address_type_remarks_caption[ $business['answer'] ].'</td><td class="customtd">'.$business['score_band'].'</td><td class="customtd">'.$business['attributed_score'].'<br>'.$span.'</td><td class="customtd">'.$business['max_score'].'<br>'.$max_span.'</td></tr>';
}
if($key == 'cerificates')
{
$certificates = $business;
echo '<tr>'.'<td> Certificates </td><td class="customtd">'.round($business['l2_weightage'],2).'%</td><td class="customtd">'.'Refer Cert Table'.'</td><td class="customtd">'.$business['score_band'].'</td><td class="customtd">'.$business['attributed_score'].'</td><td class="customtd">'.$business['max_score'].'</td></tr>';
}
}
echo '<tr> <td colspan="4">Business Section Sum of Attributed Score | Sum of Max Score </td> <td class="customtd">'.number_format($pd_score['score_summary']['business']['actual_score'],2,'.',',').'</td> <td class="customtd">'.number_format($pd_score['score_summary']['business']['max_score'],2,'.',',').'</td> </tr>';
echo '</table>';
// *** Business Certificates Score Table
echo '<br><br>';
echo "<table class='scorecard_table2'>";
echo "<tr> <th>Business Certificates</th> <th>Answer</th> <th>Score</th> <th>Attributed Score</th> <th>Max Score</th></tr>";
$index = 0;
// print_r($certificates);
foreach($certificates as $key => $cerificate)
{
$index++;
if($index <=7)
{
$question = MYUTIL::findQuestionByKey($score_questions_display,$key);
$span = '<span style="font-size:9px">('.$cerificate['l1_weightage'].'% * '. $cerificate['l2_weightage'].'% * '.$cerificate['score_band'].')</span>';
$max_span = '<span style="font-size:9px">('.$cerificate['l1_weightage'].'% * '. $cerificate['l2_weightage'].'% * '.$cerificate['max_score_band'].')</span>';
echo '<tr>'.'<td>'.$question.'</td><td class="customtd">'.$cerificate['answer'].'</td><td class="customtd">'.$cerificate['score_band'].'</td><td class="customtd">'.round($cerificate['attributed_score'],3).'<br>'.$span.'</td><td class="customtd">'.round($cerificate['max_score'],3).'<br>'.$max_span.'</td></tr>';
}
}
echo "</table>";
}
// ########################### End Of Score Card Section #########################################
?>
</body>
</html>