MEQ REPORT

This commit is contained in:
Velz2020 2020-12-15 16:16:08 +05:30
parent f872efac1c
commit 0fdf204aab
2 changed files with 629 additions and 17 deletions

View File

@ -168,7 +168,7 @@ class Sales_PD_Controller extends REST_Controller {
$where_condition_array = array('SALES_PD_DATA.sales_pd_id' => $sales_pd_id);
$sales_pd_data = $this->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array);
//print_r($sales_pd_data);die();
// print_r($sales_pd_data);die();
if($sales_pd_data)
{
@ -187,29 +187,29 @@ class Sales_PD_Controller extends REST_Controller {
mkdir($this->external_path.'/sales_pd/'.$sales_pd_id,0777);
}
if(!$sales_pd_data[0]['is_pdf'] || $sales_pd_data[0]['is_edited'])
if($sales_pd_data[0]['is_pdf'] || $sales_pd_data[0]['is_edited'])
{
$all_section_data = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('sales_pd_id' => $sales_pd_id,'isactive' => 1),SALESPD_SECTION_DATA);
// print_r($this->db->last_query());die();
$all_section_data = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('sales_pd_id' => $sales_pd_id,'isactive' => 1),SALESPD_SECTION_DATA,array(),'','section_id','ASC');
// print_r(json_decode($all_section_data[2]['section_data'],true));//die();
$view_data['master'] = $sales_pd_data;
foreach ($all_section_data as $sec_key => $section)
{
//print_r($section);die();
$view_data['section'.$section['section_id'] ] = $this->processSalesPDJSON($section);
// print_r($section['section_id']);die();
$view_data['section'.$section['section_id'] ] = $this->processSalesPDJSON($section);//die();
}
//print_r($view_data['section1']);die();
// print_r($view_data['section6']);die();
$view_data['section9'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name !=' => 'satellite','isactive' => 1),SALEPD_DOCS);
$view_data['satellite_image'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name' => 'satellite','isactive' => 1),SALEPD_DOCS);
$view_data['product_id'] = $sales_pd_data[0]['product_id'];
$view_data['geo_location'] = $sales_pd_data[0]['geo_location'];
//print_r($this->db->last_query());die();
//$view_name = $sales_pd_data[0]['short_name'].'_'.$sales_pd_data[0]['abbr'];
$view_name = $sales_pd_data[0]['short_name'];
$view_name = $sales_pd_data[0]['short_name'];if( $sales_pd_data[0]['abbr'] == 'MEQ'){ $view_name = $sales_pd_data[0]['abbr']; }
$html_content = $this->load->view('sale_pd_templates/'.$view_name,$view_data,true);
//echo $html_content;die();
// echo $html_content;die();
$pdf_doc = $this->pdfgenerator->generate($html_content, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait");
//End of PDF Gen using DOM PDF
$output_file = $this->external_path ."/sales_pd/" . $sales_pd_id . "/temp.pdf";
@ -353,11 +353,11 @@ class Sales_PD_Controller extends REST_Controller {
{
$temp_array[ $question['question_key'] ] = isset($question['answer_value']) ? $question['answer_value'] : null;
if($question['question_key'] == 'state' || $question['question_key'] == 'city' || $question['question_key'] == 'pincode' || $question['question_key'] == 'loan_purpose')
if($question['question_key'] == 'state' || $question['question_key'] == 'city' || $question['question_key'] == 'pincode' || $question['question_key'] == 'loan_purpose' || $question['question_key'] == 'constitution' || $question['question_key'] == 'about_locality' || $question['question_key'] == 'equipment_list' || $question['question_key'] == 'vendor_list')
{
//if($question['type'] == 4) { print_r($question['answer_value']); }
$temp_array[ $question['question_key'] ] = $this->getMasterData($question['answer_value'],$question['answers']);
//if($question['type'] == 4) { print_r($temp_array[ $question['question_key'] ]); }
// if($question['type'] == 4) { print_r($temp_array[ $question['question_key'] ]); }
}
if(isset($question['subfield_key']))
{
@ -365,12 +365,12 @@ class Sales_PD_Controller extends REST_Controller {
$temp_array[ $question['question_key'] ] .= $question['subfield_value'].',';
}
// echo 'FIRST';print_r($temp_array[ $question['question_key'] ]);
if(substr_count($temp_array[ $question['question_key'] ], ','))
{
$temp_array[ $question['question_key'] ] = substr_replace($temp_array[ $question['question_key'] ],'', strrpos($temp_array[ $question['question_key'] ],','),1);
}
//echo 'SECOND'; print_r($temp_array[ $question['question_key'] ]);
if(substr_count($temp_array[ $question['question_key'] ], ','))
{
@ -426,14 +426,14 @@ class Sales_PD_Controller extends REST_Controller {
function getMasterData($id,$array)
{
//print_r($id);
// print_r($id);echo '***';
if(!is_array($id))
{
foreach($array as $value)
{
if($id == $value['answer_id'])
{
return $value['answer'];
return ($value['answer']);
break;
}
}
@ -444,15 +444,16 @@ class Sales_PD_Controller extends REST_Controller {
foreach($id as $value)
{
//echo $value.'****'.strcasecmp($value,'Others').'#';
foreach($array as $mas_value)
{
if( !strcasecmp($value,$mas_value['answer_id']) && (substr_count($value,'Others') == 0))
if( !strcasecmp($value,$mas_value['answer_id']) && (!substr_count($mas_value['answer'],'Others')) )
{
$final_string .= $mas_value['answer'] . ',';
}
}
}
//print_r($final_string);die();
// print_r($final_string);//die();
return $final_string;
}

View File

@ -0,0 +1,611 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$uparrow = '<span style="color:green;">↑</span>';
$downarrow = '<span style="color:red;">↓</span>';
$dash = '<span style="color:black;"> </span>';
$product_name = $master[0]['abbr'];
$rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>";
//print_r($master[0]['abbr']);die();
?><!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link href="https://fonts.googleapis.com/css?family=Merriweather" rel="stylesheet">
<style type="text/css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
.page_break { page-break-before: always; }
#page_break { page-break-before: always; }
/*.page { width: 100%; height: 95%; }*/
@page {
margin: 100px 50px;
/*font-family:Helvetica,Arial;*/
font-family:Merriweather;
}
header {
position: fixed;
top: -70px;
left: 0px;
right: 0px;
height: 20px;
/** Extra personal styles **/
/*background-color: #03a9f4;
color: white;*/
text-align: right;
/*line-height: 35px;*/
}
footer {
position: fixed;
bottom: 5px;
left: 0px;
right: 0px;
height: 20px;
font-size: 10px;
/** Extra personal styles **/
/*background-color: #03a9f4;
color: white;*/
text-align: left;
/*line-height: 35px;*/
}
/* #########Score Card Table Styles######### */
.scorecard_table {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: 100%;
page-break-inside: inline;
}
.scorecard_table td, .scorecard_table th {
border: 1px solid #000;
padding: 8px;
page-break-inside: inline;
}
.scorecard_table tr:nth-child(even){background-color: #f2f2f2;page-break-inside: inline; }
.scorecard_table tr:hover {background-color: #ddd;}
.scorecard_table th {
padding-top: 8px;
padding-bottom: 8px;
text-align: center;
background-color: #0191ed;
color: white;page-break-inside: inline;
}
/* #########End of Score Card Table Styles######### */
/* #########Score Card2 Table Styles######### */
.scorecard_table2 {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: 100%;
page-break-inside: avoid;
}
.scorecard_table2 td, .scorecard_table2 th {
border: 1px solid #000;
padding: 8px;
page-break-inside: avoid;
}
.scorecard_table2 tr:nth-child(even){background-color: #f2f2f2;page-break-inside: avoid; }
.scorecard_table2 tr:hover {background-color: #ddd;}
.scorecard_table2 th {
padding-top: 8px;
padding-bottom: 8px;
text-align: center;
background-color: #0191ed;
color: white;page-break-inside: avoid;
}
/* #########End of Score Card 2 Table Styles######### */
.tdcenteralign{ text-align: center; }
.thlargefont{ font-size: 20px; }
</style>
</head>
<body style="font-family:Merriweather;font-size:12px;margin:15px 30px">
<footer>
<hr>
<img style="width:100px;height:50px;opacity: 0.5;padding-top: 5px;" src='https://pdgenie.com/logo/sineedge_red.png'/> Powered By PD Genie
</footer>
<header>
<div><img style="width:100px;height:50px;opacity: 0.5;" src='https://www.smcfinance.com/images/logo-small.jpg'/></div>
<hr>
</header>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="10" >Personal Discussion by Sales Team - <?php echo $product_name; ?> </th>
</tr>
<!-- <tr>
<td colspan="3"> Application ID</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['application_id'] ? $section1['application_id'] : 'Not Provided'?> </td>
</tr> -->
<tr>
<td colspan="3"> Name of Main Loan Applicant</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['main_loan_applicant']?> </td>
</tr>
<tr>
<td colspan="3"> Name of the Company/Firm</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['company_name']?></td>
</tr>
<tr>
<td colspan="3"> Constitution</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['constitution']?></td>
</tr>
<tr>
<td colspan="3"><?php if($master[0]['sales_pd_type'] == 1){echo 'Name of Person Met during visit'; }else{ echo 'Name of the Person Contacted'; } ?></td>
<td class = "tdcenteralign" colspan="7"><?php echo $section1['person_met_during_visit']?></td>
</tr>
<tr>
<td colspan="3" rowspan="2" ><?php if($master[0]['sales_pd_type'] == 1){echo 'Address Visited'; }else{ echo 'Business Address'; } ?></td>
<td class = "tdcenteralign" colspan="7"><?php echo $section1['address_visited']?></td>
</tr>
<tr>
<td>City</td>
<td class = "tdcenteralign"><?php echo $section1['state']?></td>
<td>State</td>
<td class = "tdcenteralign"><?php echo $section1['city']?></td>
<td>PIN</td>
<td class = "tdcenteralign" colspan="2"><?php if(isset($section1['pincode_others'])){ echo $section1['pincode_others']; } else { echo $section1['pincode']; }?></td>
</tr>
</tbody>
</table>
<br>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="10">Fund Requirement</th>
</tr>
<tr>
<td colspan="5" >Loan Amount Applied for (Rs)</td>
<td class = "tdcenteralign" colspan="5" ><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($section2['loan_amount_applied'])?></td>
<!-- <td colspan="2">Total Fund Requirement (Rs)</td>
<td class = "tdcenteralign" colspan="2"> <?php echo $rupee_symbol.' '. MYUTIL::customIndianNumberFormat($section2['total_fund_requirement'])?></td> -->
</tr>
<tr>
<td colspan="5" >Loan Tenure (Months)</td>
<td class = "tdcenteralign" colspan="5" ><?php echo $section2['loan_tenure']?></td>
</tr>
<tr>
<td colspan="5" >Loan Purpose (End-Use)</td>
<td class = "tdcenteralign" colspan="5" ><?php echo $section2['loan_purpose']?></td>
</tr>
</tbody>
</table>
<br>
<?php if(isset($section3))
{ ?>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="10">Details of Key Stakeholders in the Business</th>
</tr>
<tr>
<th colspan="6">Name</th>
<th colspan="2" >Share Holding</th>
<th colspan="2" >Year(s) in Current Business</th>
<!-- <th colspan="1">Total Work Exp(Yrs)</th>
<th colspan="3" >Previous Experience Details</th>
<th colspan="2" >Started Business</th> -->
</tr>
<?php
foreach ($section3 as $section3_key => $section3_value)
{
echo '<tr><td class="tdcenteralign" colspan="6">'.$section3_value['name'] .'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section3_value['share_holding'].'%</td>'.
'<td class="tdcenteralign" colspan="2">'.$section3_value['vintage_in_current_biz'].'</td>'.'</tr>';
//'<td class="tdcenteralign" colspan="1">'.$section3_value['total_work_exp'].'</td>'.
//'<td class="tdcenteralign" colspan="3">'.( isset ($section3_value['previous_experience_details']) && $section3_value['previous_experience_details'] ? $section3_value['previous_experience_details'] : 'NA' ).'</td>'.
//'<td class="tdcenteralign" colspan="2" style="text-align: center">'.$section3_value['started_biz'].'</td>'.
//'</tr>';
}
}
echo '</tbody></table>';
?>
<table class="scorecard_table"><tbody>
<tr>
<th class="thlargefont" colspan="10" >Institution Details</th>
</tr>
<tr>
<td colspan="3" >Type of institution</td>
<td class = "tdcenteralign" colspan="2" ><?php echo ($section4['institution_type'])?></td>
<td colspan="2">About the Locality</td>
<td class = "tdcenteralign" colspan="3"> <?php echo ($section4['about_locality'])?></td>
</tr>
<tr>
<td colspan="3" >Institution vintage</td>
<td class = "tdcenteralign" colspan="2" ><?php echo ($section4['instituion_vitage'])?></td>
<td colspan="2">If existing ( Since When) </td>
<td class = "tdcenteralign" colspan="3"> <?php echo ($section4['existing_since'])?></td>
</tr>
<tr>
<td colspan="3" >Opening New Branch</td>
<td class = "tdcenteralign" colspan="2" ><?php echo ($section4['opening_new_branch'])?></td>
<td colspan="2">Property Ownership</td>
<td class = "tdcenteralign" colspan="3"> <?php echo ($section4['property_ownership'])?></td>
</tr>
<tr>
<td colspan="3" >Area (Sq Feet)</td>
<td class = "tdcenteralign" colspan="2" ><?php echo ($section4['area_sq_feet'])?></td>
<td colspan="2">Floors</td>
<td class = "tdcenteralign" colspan="3"> <?php echo ($section4['floor'])?></td>
</tr>
<tr>
<td colspan="3">How many Bedded</td>
<td class = "tdcenteralign" colspan="2" ><?php echo ($section4['how_many_beds'])?></td>
<td colspan="2">Occupancy ratio </td>
<td class = "tdcenteralign" colspan="3"> <?php echo ($section4['occupancy_ratio'])?></td>
</tr>
<?php if( (!strcasecmp($section4['instituion_vitage'], 'Hospital')) || (!strcasecmp($section4['instituion_vitage'], 'Nursing Home'))){ ?>
<tr>
<td colspan="3">Doctor's Permanent</td>
<td class = "tdcenteralign" colspan="2" ><?php echo ($section4['how_many_beds'])?></td>
<td colspan="2">Doctor's Visited</td>
<td class = "tdcenteralign" colspan="3"> <?php echo ($section4['occupancy_ratio'])?></td>
</tr>
<?php } ?>
<tr>
<td colspan="3" >Number of staff observed</td>
<td class = "tdcenteralign" colspan="2" ><?php echo ($section4['staff_observer_number'])?></td>
<td colspan="2">Business activity seen </td>
<td class = "tdcenteralign" colspan="3"> <?php echo ($section4['business_activity_seen'])?></td>
</tr>
<!-- <tr></tr><tr></tr><tr></tr> -->
</tbody></table>
<table class="scorecard_table"><tbody>
<tr>
<th class="thlargefont" colspan="10">Product Information</th>
</tr>
<tr>
<td colspan="5">Equipment List</td>
<td class = "tdcenteralign" colspan="5" ><?php echo ($section5['equipment_list'])?></td>
</tr>
<?php if(isset($section5['equipment_list_other'])) { ?>
<tr>
<td colspan="5">Others Equipment</td>
<td class = "tdcenteralign" colspan="5" ><?php echo ($section5['equipment_list_other'])?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="5">Total invoice value of the selected product</td>
<td class = "tdcenteralign" colspan="5"> <?php echo ($section5['tot_product_invoice_value'])?></td>
</tr>
<tr>
<td colspan="5">Vendor list</td>
<td class = "tdcenteralign" colspan="5"> <?php echo ($section5['vendor_list'])?></td>
</tr>
<?php if(isset($section5['equipment_list_other']))
{?>
<tr>
<td colspan="5">Other Vendor</td>
<td class = "tdcenteralign" colspan="5" ><?php echo ($section5['equipment_list_other'])?></td>
</tr>
<?php } ?>
</tbody></table>
<div id="page_break"></div>
<table class="scorecard_table">
<tr>
<th class="thlargefont" colspan="10" >Financial Information</th>
</tr>
<tr>
<td colspan="6" >Name of the Company / Firm whose financials are noted </td>
<td class = "tdcenteralign" colspan="4" ><?php echo $section1['company_name']?></td>
</tr>
</tbody></table>
<table class="scorecard_table"><tbody>
<tr>
<th colspan="7">Particulars of Financials as per books of Accounts</th>
<?php
$sales_pd_created_date = date('Y-m-d',strtotime($master[0]['createdon']));
$last_four_finyrs = MYUTIL::getFinYears($sales_pd_created_date,1);
$ordered_finyrs_data = MYUTIL::reOrderFinYrsData($section6,$last_four_finyrs);
//print_r($section5);die();
$totol = 0;
foreach ($ordered_finyrs_data as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
$totol++;
echo '<th colspan="1" >FY - '.($fy_value['fy']).'</th>';
}
}
?>
</tr>
<tr>
<td colspan="7">Sales / Revenue (Rs) </td>
<?php
foreach ($ordered_finyrs_data as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
echo '<td colspan="1" class="tdcenteralign">'. $rupee_symbol.' '.MYUTIL::customIndianNumberFormat(($fy_value['sales_revenue'])).'</td>';
}
}
?>
</tr>
<tr>
<td colspan="7" >Net Profit / (Net Loss) (Rs) </td>
<?php
foreach ($ordered_finyrs_data as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
echo '<td colspan="1" class="tdcenteralign">'.$rupee_symbol.' '. MYUTIL::customIndianNumberFormat($fy_value['net_profit']).'</td>';
}
}
?>
</tr>
<tr>
<td colspan="7" >Net Profit or (Net Loss) to Sales % </td>
<?php
foreach ($ordered_finyrs_data as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
echo '<td colspan="1" class="tdcenteralign">'.round((($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 ),2).'%</td>';
}
}
?>
</tr>
<tr>
<td colspan="7" >% <?php echo '( '.$uparrow.'/'.$downarrow.' )'?> in Sales over PY </td>
<?php
$pre_year_sales = 0;
foreach ($ordered_finyrs_data as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
if($fy_key == 0)
{
echo '<td colspan="1" class="tdcenteralign">NA</td>';
}
else
{
//echo $pre_year_sales;
$sales_over_py = round( ((($fy_value['sales_revenue'] - $pre_year_sales) / $pre_year_sales ) * 100),2);
echo '<td colspan="1"class="tdcenteralign" >'. ((($sales_over_py == 0 ) ? $dash :( $sales_over_py > 0 ? $uparrow : $downarrow))).'' . abs($sales_over_py). ' %</td>';
}
$pre_year_sales = $fy_value['sales_revenue'];
}
}
?>
</tr>
<tr>
<td colspan="7" >% <?php echo '( '.$uparrow.'/'.$downarrow.' )'?> in Net Profit over PY </td>
<?php
$pre_year_net_profit = 0;
foreach ($ordered_finyrs_data as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
if($fy_key == 0)
{
echo '<td colspan="1" class="tdcenteralign">NA</td>';
}
else
{
$net_profit_over_py = round( ((($fy_value['net_profit'] - $pre_year_net_profit) / $pre_year_net_profit ) * 100),2);
echo '<td colspan="1" class="tdcenteralign">'. ((($net_profit_over_py == 0 ) ? $dash :( $net_profit_over_py > 0 ? $uparrow : $downarrow))).' ' . abs($net_profit_over_py). '% </td>';
}
$pre_year_net_profit = $fy_value['net_profit'];
}
}
?>
</tr>
<tr>
<td colspan="7" >% <?php echo '( '.$uparrow.'/'.$downarrow.' )'?> in Net Profit % over PY </td>
<?php
$pre_year_net_pro_loss_per = 0;
foreach ($ordered_finyrs_data as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
if($fy_key == 0)
{
echo '<td colspan="1" class="tdcenteralign">NA</td>';
}
else
{
$year_net_pro_loss_per_over_py = round( ((( (($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 ) - $pre_year_net_pro_loss_per) / $pre_year_net_pro_loss_per ) * 100),2);
echo '<td colspan="1" class="tdcenteralign">'. ((($year_net_pro_loss_per_over_py == 0 ) ? $dash :( $year_net_pro_loss_per_over_py > 0 ? $uparrow : $downarrow))).' ' . abs($year_net_pro_loss_per_over_py). '% </td>';
// echo '<td colspan="1" >'. (($year_net_pro_loss_per_over_py > 0 )? '<span style="color:green;">↑</span>' : '<span style="color:red;">↓</span>').' ( ' . $year_net_pro_loss_per_over_py. ' )</td>'; //(($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 )
}
$pre_year_net_pro_loss_per = (($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 );
}
}
?>
</tr>
</tbody></table>
<br>
<table class="scorecard_table">
<tr>
<td colspan="3">Income to be Considered (Rs Per Annum) </td>
<td class="tdcenteralign" colspan="2"><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($section6['income_considered'] )?></td>
<td colspan="3" >Income Considered (Rs Per Mth) </td>
<td class="tdcenteralign" colspan="2"><?php echo MYUTIL::customIndianNumberFormat( round(($section6['income_considered'] / 12 ),2) );?></td>
</tr>
<tr>
<td colspan="3">Income assessment Program Recommended </td>
<td class="tdcenteralign" colspan="2"><?php echo $section6['income_assessment_program_recommended']?></td>
<td colspan="3" >Fixed Obligations (Rs per month) </td>
<td class="tdcenteralign" colspan="2"><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat( $section6['fixed_obligations'] )?></td>
</tr>
</tbody></table>
<table class="scorecard_table2">
<tbody>
<tr>
<th class="thlargefont" colspan="10" >Final Remarks of Sales officer</th>
</tr>
<?php if($master[0]['sales_pd_type'] == 1){?>
<tr>
<td colspan="4" >Business activity seen during visit (Yes / No)</td>
<td class="tdcenteralign" ><?php echo $section7['business_activity_seen']?></td>
<td colspan="4" >Location of workplace suits the business (Yes/No)</td>
<td class="tdcenteralign" ><?php echo $section7['location_workplace_suits_business']?></td>
</tr>
<?php }?>
<tr>
<td colspan="4" >Overall Assessment (Positive / Negative)</td>
<td class="tdcenteralign" <?php if($section7['overall_assessment'] == 'Positive') { echo 'style="color:green;"';}else{ echo 'style="color:red;"';} ?> ><?php echo $section7['overall_assessment']?></td>
<td colspan="4" >Recommended ROI for the case</td>
<td class="tdcenteralign" ><?php echo $section7['recommended_roi'].' %'?></td>
</tr>
<tr>
<td colspan="2" >Any Other remarks </td>
<td style="text-align: justify;" colspan="8" ><?php echo $section7['any_other_remarks']?></td>
</tr>
</tbody>
</table>
<br><br>
<div id="page_break"></div>
<br><table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Satellite Image of PD Location</th></tr></table><br>
<p><b>GPS Coordinates of location where PD Visit was done : <?php echo $geo_location ? $geo_location : '-'; ?></b></p>
<?php if($geo_location) { ?>
<img style="border:3px solid #0191ed;" src = "<?php echo 'data:image/gif;base64,'.$satellite_image[0]['img']; ?>" alt = "PD Visted Location Satellite Image " height="300px" width="630px">
<?php
}else{ echo '<p>Due to location access not provided by loan applicant Geo coordinates on photographs and Satellite image of PD location is not shown</p>';}
?>
<?php
$iter = 0;
$photo_names = array('selfie_with_person_met' => 'Selfie with person met','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','workplace_interior_image' => 'Workplace interior image','satellite1' => 'satellite');
if($master[0]['sales_pd_type'] == 2){ $photo_names['selfie_with_person_met'] = 'Selfie of the person contacted';}
//echo count($section9);die();
//print_r(array_keys($section9));die();
$tot_rows = ceil(count($section9) / 3);
// foreach ($section9 as $key => $value) {
// print_r($value).'<br>';
// }
// die();
if(count($section9))
{
echo '<div id="page_break"></div>';
echo '<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Photograph`s</th></tr></table><br><table ><tbody>';
$add_factor = 0;
for($row = 0;$row < $tot_rows; $row++)
{
echo '<tr>';
$from = $row == 0 ? $row : ($row+$add_factor);
$to = ($from + 2);
$add_factor = $add_factor + 2;
for($i = $from ; $i <= $to; $i++)
{
if(isset($section9[$i]))
{
echo '<td style="text-align:center;border:1px solid;"> <img src="'.$section9[$i]['img'].'" height = "200" width="200" alt="'.$section9[$i]['img_name'].'"/><br>'.$photo_names [ $section9[$i]['img_name'] ].'</td>';
}
//unset($p_key);
}
echo '</tr>';
}
echo '</tbody></table>';
}
?>
<br>
<br><br>
<table class="scorecard_table">
<tbody>
<tr>
<td colspan="3" >Name of Sales Team Member </td>
<td class="tdcenteralign" colspan="7" ><?php echo $section8['name_of_sales_team_member']?></td>
</tr>
<tr>
<td colspan="3" >Designation of Sales Team Member </td>
<td class="tdcenteralign" colspan="7" ><?php echo $section8['designation']?></td>
</tr>
<tr>
<td colspan="3" >Date of PD Visit </td>
<td class="tdcenteralign" colspan="7" ><?php echo $section8['date']?></td>
</tr>
<!-- <tr>
<td colspan="3">Signature of PD Officer </td>
<td colspan="7" ></td>
</tr> -->
</tbody>
</table>
</body>
</html>