SALES PD UAT COMPLETE SCORE CARD

This commit is contained in:
Velz2020 2019-11-15 18:35:07 +05:30
parent 253e2fdd89
commit 2df3cff689
6 changed files with 175 additions and 350 deletions

View File

@ -256,5 +256,5 @@ $route['(getRawData/:any)'] = 'Data_Dump_Controller/getRawData';
$route['loadSalesPDTemplate'] = 'Sales_PD_Controller/loadSalesPDTemplate'; $route['loadSalesPDTemplate'] = 'Sales_PD_Controller/loadSalesPDTemplate';
$route['saveSalesPD'] = 'Sales_PD_Controller/saveSalesPD'; $route['saveSalesPD'] = 'Sales_PD_Controller/saveSalesPD';
$route['(downloadSalesPDReport/:any)'] = 'Sales_PD_Controller/getSalesPDReport'; $route['(downloadSalesPDReport/:any)'] = 'Sales_PD_Controller/getSalesPDReport';
$route['(listSalesPD/:any)'] = 'Sales_PD_Controller/listSalesPD'; $route['(listSalesPD/:any/:any)'] = 'Sales_PD_Controller/listSalesPD';

View File

@ -5952,8 +5952,8 @@ public function getPDFormDetailsJSON_post()
file_put_contents(APPPATH.'/views/js/phantomchart.js',$exact_script,LOCK_EX); file_put_contents(APPPATH.'/views/js/phantomchart.js',$exact_script,LOCK_EX);
$str = 'phantomjs '.APPPATH.'/views/js/phantomchart.js'; $str = 'phantomjs '.APPPATH.'/views/js/phantomchart.js';
// exec($str,$ou); exec($str,$ou);
// exec('phantom.exit();'); exec('phantom.exit();');
//print_r($ou); //print_r($ou);

View File

@ -55,36 +55,41 @@ class Sales_PD_Controller extends REST_Controller {
$applicant_name = ''; $applicant_name = '';
$applicant_id = ''; $applicant_id = '';
$officer = ''; $officer = '';
// foreach ($records['pd_json']['sections'] as $key => $value)
// {
// if($value['section_id'] == 1)
// {
// foreach ($value as $g_key => $g_value)
// {
// if($g_value['question_key'] == 'application_id')
// {
// $applicant_name = $g_value['answer_value'];
// }
// if($g_value['question_key'] == 'person_met_during_visit')
// {
// $applicant_id = '';
// }
// }
// }
// if($value['section_id'] == 8)
// {
// echo "OFFICE";
// }
// }
//print_r($records); foreach ($records['pd_json'] as $key => $value)
// $pd_data = $records['pd_json']; {
// $lender_id = $records['lender_id']; //print_r($value);die();
// $product_id = $records['product_id']; if($value['section_id'] == 1)
// $created_by = $records['created_by'];// {
//sales_pd_id, pd_json, lender_id, product_id, createdby, updatedby, createdon, updatedon, isactive foreach ($value['questions'] as $g_key => $g_value)
//$json_data = (json_decode($records['pd_json']['sections'][0],true)); {
// print_r($records['pd_json']['sections'][0]['questions']);die(); if($g_value['question_key'] == 'application_id')
{
$applicant_id = $g_value['answer_value'];
}
if($g_value['question_key'] == 'person_met_during_visit')
{
$applicant_name = $g_value['answer_value'];
}
}
}
if($value['section_id'] == 8)
{
foreach ($value['questions'] as $g_key => $g_value)
{
if($g_value['question_key'] == 'name_of_sales_team_member')
{
$officer = $g_value['answer_value'];
}
}
}
}
$records['applicant_id'] = $applicant_name;
$records['applicant_name'] = $applicant_id;
$records['officer_name'] = $officer;
$id = null; $id = null;
if(!$records['sales_pd_id']) if(!$records['sales_pd_id'])
{ {
@ -134,7 +139,11 @@ class Sales_PD_Controller extends REST_Controller {
if($sales_pd_data) if($sales_pd_data)
{ {
$bucket_name = LENDER_BUCKET_NAME_PREFIX.$sales_pd_data[0]['lender_id']; $bucket_name = LENDER_BUCKET_NAME_PREFIX.$sales_pd_data[0]['lender_id'];
$key = 'sales_pd/'.$sales_pd_id.'/'.$sales_pd_id.'.pdf'; $pdf_name = strtolower(trim($sales_pd_data[0]['applicant_name']));
$pdf_name = str_replace(' ', '_', $pdf_name);
$key = 'sales_pd/'.$sales_pd_id.'/'.$pdf_name.'.pdf';
if(!file_exists($this->external_path.'/sales_pd/'.$sales_pd_id)) if(!file_exists($this->external_path.'/sales_pd/'.$sales_pd_id))
{ {
@ -144,20 +153,16 @@ class Sales_PD_Controller extends REST_Controller {
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'])
{ {
//echo 'FIRST';
//Get Data from DB and process
//print_r(json_decode($sales_pd_data[0]['pd_json'],true));die();
$json_data = (json_decode($sales_pd_data[0]['pd_json'],true)); $json_data = (json_decode($sales_pd_data[0]['pd_json'],true));
$view_data = array(); $view_data = array();
foreach ($json_data as $sec_key => $section) foreach ($json_data as $sec_key => $section)
{ {
$view_data['section'.$section['section_id'] ] = $this->processSalesPDJSON($section); $view_data['section'.$section['section_id'] ] = $this->processSalesPDJSON($section);
} }
//die();
//print_r($json_data);die(); //$view_name = $sales_pd_data[0]['short_name'].'_'.$sales_pd_data[0]['abbr'];
$view_name = $sales_pd_data[0]['short_name'];
//End of JSON processing
$view_name = $sales_pd_data[0]['short_name'].'_'.$sales_pd_data[0]['abbr'];
$html_content = $this->load->view('sale_pd_templates/'.$view_name,$view_data,true); $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"); $pdf_doc = $this->pdfgenerator->generate($html_content, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait");
@ -170,9 +175,8 @@ class Sales_PD_Controller extends REST_Controller {
if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
{ {
//echo 'SUCESS';
$this->Sales_PD_Model->updateRecords(array('is_pdf' => 1,'is_edited' => 0),SALES_PD_DATA,array('sales_pd_id' => $sales_pd_id)); $this->Sales_PD_Model->updateRecords(array('is_pdf' => 1, 'is_edited' => 0),SALES_PD_DATA,array('sales_pd_id' => $sales_pd_id));
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'30 minutes'); $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'30 minutes');
$data['dataStatus'] = true; $data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK; $data['status'] = REST_Controller::HTTP_OK;
@ -195,8 +199,8 @@ class Sales_PD_Controller extends REST_Controller {
public function listSalesPD_get() public function listSalesPD_get()
{ {
$lender_id = $this->uri->segment(2);//sales_pd_id, pd_json, lender_id, product_id, createdby, updatedby, createdon, updatedon, isactive, is_pdf, is_edited, length(pd_json) $lender_id = $this->uri->segment(2);
$user_id = $this->uri->segment(3);
$columns = array('SALES_PD_DATA.sales_pd_id','SALES_PD_DATA.applicant_name','SALES_PD_DATA.officer_name','SALES_PD_DATA.applicant_id','SALES_PD_DATA.lender_id','SALES_PD_DATA.product_id','SALES_PD_DATA.is_pdf','SALES_PD_DATA.is_edited','ENTITY.short_name','PRODUCT.abbr','SALES_PD_DATA.createdon'); $columns = array('SALES_PD_DATA.sales_pd_id','SALES_PD_DATA.applicant_name','SALES_PD_DATA.officer_name','SALES_PD_DATA.applicant_id','SALES_PD_DATA.lender_id','SALES_PD_DATA.product_id','SALES_PD_DATA.is_pdf','SALES_PD_DATA.is_edited','ENTITY.short_name','PRODUCT.abbr','SALES_PD_DATA.createdon');
$table = SALES_PD_DATA.' as SALES_PD_DATA'; $table = SALES_PD_DATA.' as SALES_PD_DATA';
$joins = array( $joins = array(
@ -213,6 +217,10 @@ class Sales_PD_Controller extends REST_Controller {
{ {
$where_condition_array = array('SALES_PD_DATA.lender_id' => $lender_id); $where_condition_array = array('SALES_PD_DATA.lender_id' => $lender_id);
} }
if($user_id && is_numeric($user_id))
{
$where_condition_array = array('SALES_PD_DATA.createdby' => $user_id);
}
$order_by = 'SALES_PD_DATA.sales_pd_id'; $order_by = 'SALES_PD_DATA.sales_pd_id';
$sales_pd_data = $this->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array); $sales_pd_data = $this->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array);
if(count($sales_pd_data)) if(count($sales_pd_data))
@ -270,6 +278,10 @@ class Sales_PD_Controller extends REST_Controller {
{ {
$temp_array[ $question['question_key'] ] = $this->getMasterData($question['answer_value'],$question['answers']); $temp_array[ $question['question_key'] ] = $this->getMasterData($question['answer_value'],$question['answers']);
} }
if(isset($question['subfield_key']))
{
$temp_array[ $question['question_key'] ] = $question['subfield_value'];
}
} }
else if($question['is_repeatable'] == 1 ) else if($question['is_repeatable'] == 1 )
{ {
@ -285,6 +297,8 @@ class Sales_PD_Controller extends REST_Controller {
//print_r($q_value);die(); //print_r($q_value);die();
//echo $group_key; //echo $group_key;
$group_temp[ $q_value['question_key'] ] = $q_value['answer_value']; $group_temp[ $q_value['question_key'] ] = $q_value['answer_value'];
if(isset($q_value['subfield_key'])){ $group_temp[ $q_value['question_key'] ] = $q_value['"subfield_value"']; }
//print_r($group_temp); //print_r($group_temp);
} }
//print_r($group_temp); //print_r($group_temp);
@ -299,7 +313,8 @@ class Sales_PD_Controller extends REST_Controller {
foreach ($question['questions_group'] as $group_key => $group_value) foreach ($question['questions_group'] as $group_key => $group_value)
{ {
$temp_array[ $group_value['questions'][0]['question_key'] ][] = $group_value['questions'][0]['answer_value']; $temp_array[ $group_value['questions'][0]['question_key'] ][] = isset($group_value['questions'][0]['subfield_key']) ? $group_value['questions'][0]['subfield_value'] : $group_value['questions'][0]['answer_value'];
} }
} }
} }

View File

@ -1,256 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<title></title>
<link href="https://fonts.googleapis.com/css?family=Merriweather" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style type="text/css">
@page {
margin: 100px 50px;
/*font-family:Helvetica,Arial;*/
font-family:Merriweather;
}
.page_break { page-break-before: always; }
#page_break { page-break-before: always; }
/* #########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######### */
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;*/
}
</style>
</head>
<center>
<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>
<table class="scorecard_table">
<tbody>
<tr>
<th colspan="10" >Personal Discussion Sheet - LFMP (For Sales Team)</th>
</tr>
<tr>
<td colspan="3"> Application ID</td>
<td colspan="7"> SAMPLEDATA </td>
</tr>
<tr>
<td colspan="3"> Name of the Company/Firm</td>
<td colspan="7"> SAMPLEDATA</td>
</tr>
<tr>
<td colspan="3">Name of Person Met during visit</td>
<td colspan="7">SAMPLEDATA</td>
</tr>
<tr>
<td colspan="3" rowspan="2" >Address Visited</td>
<td colspan="7">SAMPLEDATA</td>
</tr>
<tr>
<td>City</td>
<td>SAMPLEDATA</td>
<td>State</td>
<td>SAMPLEDATA</td>
<td>PIN</td>
<td colspan="2">SAMPLEDATA</td>
</tr>
</tbody>
</table>
<table class="scorecard_table">
<tbody>
<tr>
<th colspan="10">Fund Requirement</th>
</tr>
<tr>
<td colspan="3" >Loan Amount Applied for (Rs)</td>
<td colspan="3" >SAMPLEDATA</td>
<td colspan="2">Total Fund Requirement (Rs)</td>
<td colspan="2"> SAMPLEDATA</td>
</tr>
<tr>
<td colspan="3" >Loan Tenure (Months)</td>
<td colspan="3" >SAMPLEDATA</td>
<td colspan="2" >Loan Purpose (End-Use)</td>
<td colspan="2" >SAMPLEDATA</td>
</tr>
</tbody>
</table>
<table class="scorecard_table">
<tbody>
<tr>
<th colspan="10" >Details of Key Stakeholders in the Business</th>
</tr>
<tr>
<td colspan="2" >Name</td>
<td colspan="1" >Share Holding</td>
<td colspan="1" >Vintage in Current Biz</td>
<td colspan="1">Total Work Exp</td>
<td colspan="3" >Previous Experience Details</td>
<td colspan="2">Started Biz (Yes / No)</td>
</tr>
<tr>
<td colspan="2" >Kumaralingam</td>
<td colspan="1" >100%</td>
<td colspan="1" >5yrs & 2 Mns</td>
<td colspan="1"> 10 yrs & 6 Mns</td>
<td colspan="3" > >SAMPLEDATA >SAMPLEDATA SAMPLEDATASAMPLEDATA</td>
<td colspan="2">Yes</td>
</tr>
<!-- <tr>
<td colspan="2" height="31" ><br>SAMPLEDATA</td>
<td colspan="2" ><br>SAMPLEDATA</td>
<td colspan="2" ><br>SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
<td colspan="2" ><br>SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
</tr>
<tr>
<td colspan="2" height="31" ><br>SAMPLEDATA</td>
<td colspan="2" ><br>SAMPLEDATA</td>
<td colspan="2" ><br>SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
<td colspan="2" ><br>SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
</tr>
<tr>
<td colspan="2" height="31" ><br>SAMPLEDATA</td>
<td colspan="2" ><br>SAMPLEDATA</td>
<td colspan="2" ><br>SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
<td colspan="2" ><br>SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
</tr>
<tr>
<td colspan="2" height="31" ><br>SAMPLEDATA</td>
<td colspan="2" ><br>SAMPLEDATA</td>
<td colspan="2" ><br>SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
<td colspan="2" ><br>SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
</tr> -->
<tr>
<th colspan="10" >Brief of the Business / Service</th>
</tr>
<tr>
<td colspan="10" ><br>SAMPLEDATA</td>
</tr>
<!-- <tr></tr><tr></tr><tr></tr> -->
</tbody></table>
<div id="page_break"></div>
<table class="scorecard_table">
<tr>
<th colspan="10" >Financial Information</th>
</tr>
<tr>
<td colspan="6" >Name of the Company / Firm whose financials are noted &gt;&gt;</td>
<td colspan="4" ><br>SAMPLEDATA</td>
</tr>
<tr>
<tr>
<td colspan="7" >Particulars of Financials as per books of Accounts (Can be captured prior to PD)</td>
<td >FY 1</td>
<td >FY 2</td>
<td >FY 3</td>
</tr>
<tr>
<td colspan="4">Sales / Revenue (Rs) </td>
<td colspan="3">SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
</tr>
<tr>
<td colspan="4" >Net Profit / (Net Loss) (Rs) </td>
<td colspan="3" >SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
<td ><br>SAMPLEDATA</td>
</tr>
</tbody></table>
</body>
</center></html>

View File

@ -128,7 +128,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</tr> </tr>
</tbody> </tbody>
</table> </table>
<br>
<table class="scorecard_table"> <table class="scorecard_table">
<tbody> <tbody>
<tr> <tr>
@ -148,18 +148,19 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</tr> </tr>
</tbody> </tbody>
</table> </table>
<br>
<table class="scorecard_table"> <table class="scorecard_table">
<tbody> <tbody>
<tr> <tr>
<th colspan="10" >Details of Key Stakeholders in the Business</th> <th colspan="10">Details of Key Stakeholders in the Business</th>
</tr> </tr>
<tr> <tr>
<th colspan="2" >Name</th> <th colspan="2">Name</th>
<th colspan="1" >Share Holding</th> <th colspan="1" >Share Holding</th>
<th colspan="1" >Vintage in Current Biz</th> <th colspan="1" >Vintage in Current Business</th>
<th colspan="1">Total Work Exp</th> <th colspan="1">Total Work Exp</th>
<th colspan="3" >Previous Experience Details</th> <th colspan="3" >Previous Experience Details</th>
<th colspan="2">Started Biz (Yes / No)</th> <th colspan="2" >Started Business</th>
</tr> </tr>
<?php <?php
if($section3) if($section3)
@ -172,7 +173,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
'<td colspan="1">'.$section3_value['vintage_in_current_biz'].'</td>'. '<td colspan="1">'.$section3_value['vintage_in_current_biz'].'</td>'.
'<td colspan="1">'.$section3_value['total_work_exp'].'</td>'. '<td colspan="1">'.$section3_value['total_work_exp'].'</td>'.
'<td colspan="3">'.$section3_value['previous_experience_details'].'</td>'. '<td colspan="3">'.$section3_value['previous_experience_details'].'</td>'.
'<td colspan="1">'.$section3_value['started_biz'].'</td>'. '<td colspan="2" style="text-align: center">'.$section3_value['started_biz'].'</td>'.
'</tr>'; '</tr>';
} }
@ -190,14 +191,14 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</tbody></table> </tbody></table>
<!-- <div id="page_break"></div> --> <!-- <div id="page_break"></div> -->
<br>
<table class="scorecard_table"> <table class="scorecard_table">
<tr> <tr>
<th colspan="10" >Financial Information</th> <th colspan="10" >Financial Information</th>
</tr> </tr>
<tr> <tr>
<td colspan="6" >Name of the Company / Firm whose financials are noted &gt;&gt;</td> <td colspan="6" >Name of the Company / Firm whose financials are noted </td>
<td colspan="4" ><?php echo $section5['name_of_the_company']?></td> <td colspan="4" ><?php echo $section1['company_name']?></td>
</tr> </tr>
@ -249,11 +250,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td colspan="7" >Net Profit or (Net Loss) to Sales % </td> <td colspan="7" >Net Profit or (Net Loss) to Sales % </td>
<?php <?php
foreach ($section5 as $fy_key => $fy_value) foreach ($section5 as $fy_key => $fy_value)
{ {
if(is_numeric($fy_key)) if(is_numeric($fy_key))
{ {
echo '<td colspan="1" >'.($fy_value['net_profit'] ).'</td>'; echo '<td colspan="1" >'.round((($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 ),2).'</td>';
} }
} }
?> ?>
@ -262,11 +264,25 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td colspan="7" >% ( /) in Sales over PY </td> <td colspan="7" >% ( /) in Sales over PY </td>
<?php <?php
$pre_year_sales = 0;
foreach ($section5 as $fy_key => $fy_value) foreach ($section5 as $fy_key => $fy_value)
{ {
if(is_numeric($fy_key)) if(is_numeric($fy_key))
{ {
echo '<td colspan="1" >NA</td>';
if($fy_key == 0)
{
echo '<td colspan="1" >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" >'. (($sales_over_py > 0 )? '<span style="color:green;">↑</span>' : '<span style="color:red;">↓</span>').' ( ' . $sales_over_py. ' )</td>';
}
$pre_year_sales = $fy_value['sales_revenue'];
} }
} }
?> ?>
@ -275,11 +291,22 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td colspan="7" >% ( /) in Net Profit over PY </td> <td colspan="7" >% ( /) in Net Profit over PY </td>
<?php <?php
$pre_year_net_profit = 0;
foreach ($section5 as $fy_key => $fy_value) foreach ($section5 as $fy_key => $fy_value)
{ {
if(is_numeric($fy_key)) if(is_numeric($fy_key))
{ {
echo '<td colspan="1" >NA</td>'; if($fy_key == 0)
{
echo '<td colspan="1" >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" >'. (($net_profit_over_py > 0 )? '<span style="color:green;">↑</span>' : '<span style="color:red;">↓</span>').' ( ' . $net_profit_over_py. ' )</td>';
}
$pre_year_net_profit = $fy_value['net_profit'];
} }
} }
?> ?>
@ -288,25 +315,39 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td colspan="7" >% ( /) in Net Profit % over PY </td> <td colspan="7" >% ( /) in Net Profit % over PY </td>
<?php <?php
$pre_year_net_pro_loss_per = 0;
foreach ($section5 as $fy_key => $fy_value) foreach ($section5 as $fy_key => $fy_value)
{ {
if(is_numeric($fy_key)) if(is_numeric($fy_key))
{ {
echo '<td colspan="1" >NA</td>'; if($fy_key == 0)
{
echo '<td colspan="1" >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" >'. (($year_net_pro_loss_per_over_py > 0 )? '<span style="color:green;">↑</span>' : '<span style="color:red;">↓</span>').' ( ' . $year_net_pro_loss_per_over_py. ' )</td>'; //(($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 )
}
$pre_year_net_pro_loss_per = (($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 );
} }
} }
?> ?>
</tr> </tr>
</tbody></table>
<br>
<table class="scorecard_table">
<tr> <tr>
<td colspan="3">Income to be Considered (Rs Per Annum) &gt;&gt;</td> <td colspan="3">Income to be Considered (Rs Per Annum) </td>
<td colspan="2"><?php echo $section5['income_to_be_considered']?></td> <td colspan="2"><?php echo ($section5['income_considered'] * 12 )?></td>
<td colspan="3" >Income Considered (Rs Per Mth) &gt;&gt;</td> <td colspan="3" >Income Considered (Rs Per Mth) </td>
<td colspan="2"><?php echo $section5['income_considered']?></td> <td colspan="2"><?php echo $section5['income_considered']?></td>
</tr> </tr>
<tr> <tr>
<td colspan="3">Income assessment Program Recommended &gt;&gt;</td> <td colspan="3">Income assessment Program Recommended </td>
<td colspan="2"><?php echo $section5['income_assessment_program_recommended']?></td> <td colspan="2"><?php echo $section5['income_assessment_program_recommended']?></td>
<td colspan="3" >Fixed Obligations (Rs per month) &gt;&gt;</td> <td colspan="3" >Fixed Obligations (Rs per month) </td>
<td colspan="2"><?php echo $section5['fixed_obligations']?></td> <td colspan="2"><?php echo $section5['fixed_obligations']?></td>
</tr> </tr>
</tbody></table> </tbody></table>
@ -316,41 +357,43 @@ if(isset($section6))
{ {
?> ?>
<br>
<table class="scorecard_table"> <table class="scorecard_table">
<tbody> <tbody>
<tr> <tr>
<th colspan="10"> Property Information</th> <th colspan="10"> Property Information</th>
</tr> </tr>
<tr> <tr>
<td colspan="3" >Property Address (With Landmark &amp; PIN)</td> <td colspan="1" >Property Address (With Landmark &amp; PIN)</td>
<td colspan="7" ><?php echo $section6['property_address']?></td> <td colspan="9" ><?php echo $section6['property_address']?></td>
</tr> </tr>
<tr> <tr>
<td colspan="2" >Property Type</td> <td colspan="1" >Property Type</td>
<td colspan="4" ><?php echo $section6['property_type']?></td> <td colspan="4" ><?php echo $section6['property_type']?></td>
<td colspan="2" >Occupancy Status</td> <td colspan="1" >Occupancy Status</td>
<td colspan="2" ><?php echo $section6['occupancy_status']?></td> <td colspan="4" ><?php echo $section6['occupancy_status']?></td>
</tr> </tr>
<tr> <tr>
<td colspan="2" >>Permitted Property Usage</td> <td colspan="1" >Permitted Property Usage</td>
<td colspan="4" ><?php echo $section6['permitted_property_usage']?></td> <td colspan="4" ><?php echo $section6['permitted_property_usage']?></td>
<td colspan="2" >Actual Property Usage</td> <td colspan="1" >Actual Property Usage</td>
<td colspan="2" ><?php echo $section6['actual_property_usage']?></td> <td colspan="4" ><?php echo $section6['actual_property_usage']?></td>
</tr> </tr>
<tr> <tr>
<td colspan="2" >Built-Up Area (Sq. Ft.)</td> <td colspan="1" >Built-Up Area (Sq. Ft.)</td>
<td colspan="4" ><?php echo $section6['built_up_area']?></td> <td colspan="4" ><?php echo $section6['built_up_area']?></td>
<td colspan="2" >Approx Mkt. Val (Rs)</td> <td colspan="1" >Approx Mkt. Val (Rs)</td>
<td colspan="2" ><?php echo $section6['approx_mkt_val']?></td> <td colspan="4" ><?php echo $section6['approx_mkt_val']?></td>
</tr> </tr>
<tr> <tr>
<td colspan="6" >Property Ownership Status (Enter the names of the Property Owner(s) and their relationships)</td> <td colspan="1" >Property Ownership Status (Enter the names of the Property Owner(s) and their relationships)</td>
<td colspan="4"><?php echo $section6['Property_Ownership_Status']?></td> <td colspan="9"><?php echo $section6['Property_Ownership_Status']?></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<?php } <?php }
?> ?>
<br>
<table class="scorecard_table"> <table class="scorecard_table">
<tbody> <tbody>
<tr> <tr>
@ -369,7 +412,7 @@ if(isset($section6))
<td ><?php echo $section7['recommended_roi']?></td> <td ><?php echo $section7['recommended_roi']?></td>
</tr> </tr>
<tr> <tr>
<td colspan="2" >Any Other remarks &gt;&gt;</td> <td colspan="2" >Any Other remarks </td>
<td colspan="8" ><?php echo $section7['any_other_remarks']?></td> <td colspan="8" ><?php echo $section7['any_other_remarks']?></td>
</tr> </tr>
</tbody> </tbody>
@ -378,35 +421,36 @@ if(isset($section6))
<table class="scorecard_table"> <table class="scorecard_table">
<tbody> <tbody>
<tr> <tr>
<td colspan="3" >Name of Sales Team Member &gt;&gt;</td> <td colspan="3" >Name of Sales Team Member </td>
<td colspan="7" ><?php echo $section8['name_of_sales_team_member']?></td> <td colspan="7" ><?php echo $section8['name_of_sales_team_member']?></td>
</tr> </tr>
<tr> <tr>
<td colspan="3" >Designation of Sales Team Member &gt;&gt;</td> <td colspan="3" >Designation of Sales Team Member </td>
<td colspan="7" ><?php echo $section8['designation']?></td> <td colspan="7" ><?php echo $section8['designation']?></td>
</tr> </tr>
<tr> <tr>
<td colspan="3" >Date of PD Visit &gt;&gt;</td> <td colspan="3" >Date of PD Visit </td>
<td colspan="7" ><?php echo $section8['date']?></td> <td colspan="7" ><?php echo $section8['date']?></td>
</tr> </tr>
<tr> <tr>
<td colspan="3">Signature of PD Officer &gt;&gt;</td> <td colspan="3">Signature of PD Officer </td>
<td colspan="7" ></td> <td colspan="7" ></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<table class="scorecard_table"> <br>
<tr><th colspan="10">Photograph`s</th></tr>
<tbody>
<?php <?php
if(isset($section9) && count($section9)) $photos = array();
if(isset($section9) && count($section9))
{ {
foreach ($section9 as $img_key => $img_value) foreach ($section9 as $img_key => $img_value)
{ {
if(!is_array($img_value)) if(!is_array($img_value))
{ {
echo '<tr>'.'<td colspan="3" >'.$img_key.'</td>'.'<td colspan="7" ><img src="'.$img_value.'" height = "100" width="100"></td></tr>'; array_push($photos, array('name' => $img_key, 'img' => $img_value)) ;
} }
else else
{ {
@ -414,16 +458,38 @@ if(isset($section6))
{ {
if($value) if($value)
{ {
echo '<tr>'.'<td colspan="3" >'.$img_key.'-'.($key+1).'</td>'.'<td colspan="7" ><img src="'.$value.'" height = "100" width="100"></td></tr>'; array_push($photos, array('name' => $img_key, 'img' => $value)) ;
} }
} }
} }
} }
}
//print_r($photos);die();
?>
<?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');
if(count($photos))
{
echo '<table class="scorecard_table"><tr><th colspan="10">Photograph`s</th></tr></table><table class="scorecard_table"><tbody>';
foreach ($photos as $p_key => $p_value)
{
if(!($iter % 5)) { echo '<tr>'; }
echo '<td style="text-align:center;"><img src="'.$p_value['img'].'" height = "100" width="100"><br>'.$photo_names [ $p_value['name'] ].'</td>';
if(!($iter % 5) && $iter != 0) { echo '</tr>'; }
$iter++;
}
echo '</tbody></table>';
} }
?> ?>
</tbody>
</table>
</body> </body>
</html> </html>

View File

@ -78,7 +78,7 @@ $score = substr($_SERVER['REQUEST_URI'],(strripos($_SERVER['REQUEST_URI'],"?")+1
aperture: 180, aperture: 180,
minValue: 0, minValue: 0,
maxValue: 100, maxValue: 100,
step: 5, //step: 20,
center: { center: {
visible: false visible: false
}, },
@ -93,7 +93,7 @@ $score = substr($_SERVER['REQUEST_URI'],(strripos($_SERVER['REQUEST_URI'],"?")+1
}] }]
}, },
//labels: ['0', '10', '20','30', '40', '50', '60', '70', '80', '90', '100'], //labels: ['0', '10', '20','30', '40', '50', '60', '70', '80', '90', '100'],
labels: ['0', '10', '10','30', '20', '50', '30', '70', '40', '90', '50'], // labels: ['0', '10', '10','30', '20', '50', '30', '70', '40', '90', '50'],
ring: { ring: {
size: 65, size: 65,
rules: [{ rules: [{