SALES PD IMG IND
This commit is contained in:
parent
3d420c15b5
commit
dd4da8056b
@ -607,6 +607,7 @@ defined('D_BUSINESS_PARTNERS') OR define('D_BUSINESS_PARTNERS','d_business_partn
|
||||
|
||||
defined('SALESPDTEMPLATE') OR define('SALESPDTEMPLATE','m_sales_pd_template');
|
||||
defined('SALES_PD_DATA') OR define('SALES_PD_DATA','t_sales_pd_data');
|
||||
defined('SALEPD_DOCS') OR define('SALEPD_DOCS','t_salepd_docs');
|
||||
|
||||
|
||||
|
||||
|
||||
@ -258,4 +258,5 @@ $route['saveSalesPD'] = 'Sales_PD_Controller/saveSalesPD';
|
||||
$route['(downloadSalesPDReport/:any)'] = 'Sales_PD_Controller/getSalesPDReport';
|
||||
$route['listSalesPD/(:any)'] = 'Sales_PD_Controller/listSalesPD';
|
||||
$route['listSalesPD/(:any)/(:any)'] = 'Sales_PD_Controller/listSalesPD';
|
||||
$route['saveSalesPDImage'] = 'Sales_PD_Controller/saveSalesPDImage';
|
||||
|
||||
|
||||
@ -5952,8 +5952,8 @@ public function getPDFormDetailsJSON_post()
|
||||
file_put_contents(APPPATH.'/views/js/phantomchart.js',$exact_script,LOCK_EX);
|
||||
|
||||
$str = 'phantomjs '.APPPATH.'/views/js/phantomchart.js';
|
||||
exec($str,$ou);
|
||||
exec('phantom.exit();');
|
||||
// exec($str,$ou);
|
||||
// exec('phantom.exit();');
|
||||
|
||||
//print_r($ou);
|
||||
|
||||
|
||||
@ -160,7 +160,8 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
{
|
||||
$view_data['section'.$section['section_id'] ] = $this->processSalesPDJSON($section);
|
||||
}
|
||||
|
||||
|
||||
$view_data['section9'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id),SALEPD_DOCS);
|
||||
//print_r($view_data);die();
|
||||
//$view_name = $sales_pd_data[0]['short_name'].'_'.$sales_pd_data[0]['abbr'];
|
||||
$view_name = $sales_pd_data[0]['short_name'];
|
||||
@ -177,7 +178,7 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
|
||||
{
|
||||
|
||||
// $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');
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
@ -337,6 +338,27 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function saveSalesPDImage_post()
|
||||
{
|
||||
$records = $this->post('records');
|
||||
|
||||
$id = $this->Sales_PD_Model->saveRecords($records,SALEPD_DOCS);
|
||||
if($id)
|
||||
{
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = $id;
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['dataStatus'] = false;
|
||||
$data['status'] = REST_Controller::HTTP_NO_CONTENT;
|
||||
$data['msg'] = 'Something went wrong! Try Later';
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1175,7 +1175,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
|
||||
$loan_amount = MYUTIL::customIndianNumberFormat( $loan_form['loan_amount']);
|
||||
echo '<span contenteditable="true">During the PD visit,</span> '.$main_applicant_name.',<span contenteditable="true"> provided the following information about loan applied for:</span>';
|
||||
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;
|
||||
|
||||
@ -696,7 +696,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
<?php
|
||||
|
||||
//print_r($is_kyc);die();
|
||||
//unset($general_form['individuals'][0]);//die();
|
||||
//print_r($general_form['company_with_relationships']);//die();
|
||||
foreach($general_form['individuals'] as $ind_key => $individual)
|
||||
{
|
||||
|
||||
@ -721,21 +722,25 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
$company_relationship_data = null;
|
||||
//print_r($general_form['company_with_relationships']);
|
||||
foreach($general_form['company_with_relationships'] as $company_with_relationship)
|
||||
foreach($general_form['company_with_relationships'] as $crk => $company_with_relationship)
|
||||
{
|
||||
|
||||
//print_r($company_with_relationship);
|
||||
if($individual['pd_co_applicant_id'] == $company_with_relationship['applicant_name'])
|
||||
|
||||
if($individual['pd_co_applicant_id'] == $company_with_relationship['applicant_name'] && $company_with_relationship['company_name'] != '')
|
||||
{
|
||||
//FInd Company Name from JSON
|
||||
|
||||
//echo "ONCE";
|
||||
$company_relationship_data = ($company_with_relationship['company_relationship_master'] .' '.$company_with_relationship['company_name']);
|
||||
//echo '### '.$crk.'-ICID'.$individual['pd_co_applicant_id'].'--'.$company_with_relationship['applicant_name'].'-'.$company_with_relationship['company_name'];
|
||||
$company_relationship_data .= ($company_with_relationship['company_relationship_master'] .' '.$company_with_relationship['company_name']);
|
||||
|
||||
$company_relationship_data.='<br><center>and</center><br>';
|
||||
//echo $company_relationship_data;
|
||||
}
|
||||
}
|
||||
|
||||
//echo $company_relationship_data;
|
||||
// die();
|
||||
$personal_relationship_data = null;
|
||||
foreach($general_form['persons_with_relationships'] as $persons_with_relationship)
|
||||
{
|
||||
@ -788,6 +793,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
<!-- <p>PD Officers Note (About General Section) :</p> -->
|
||||
<?php
|
||||
echo '<p>'.$general_form['general_remark'].'</p>';
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@ -798,6 +804,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
<!-- ########################### Score Card Section ############################################### -->
|
||||
<?php
|
||||
//print_r($pd_score);die();
|
||||
//die();
|
||||
if( isset($pd_score) && count($pd_score))
|
||||
{
|
||||
echo '<div id="page_break"> </div>';
|
||||
@ -1188,7 +1195,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
//print_r($loan_form);die();
|
||||
$loan_amount = MYUTIL::customIndianNumberFormat($loan_form['loan_amount']);
|
||||
echo '<span contenteditable="true">During the PD visit,</span> '.$main_applicant_name.',<span contenteditable="true"> provided the following information about loan applied for:</span>';
|
||||
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;
|
||||
|
||||
@ -1458,7 +1458,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
//print_r($loan_form);die();
|
||||
$loan_amount = MYUTIL::customIndianNumberFormat($loan_form['loan_amount']);
|
||||
echo '<span contenteditable="true">During the PD visit,</span> '.$main_applicant_name.',<span contenteditable="true"> provided the following information about loan applied for:</span>';
|
||||
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;
|
||||
|
||||
@ -959,7 +959,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
//print_r($loan_form);die();
|
||||
$loan_amount = MYUTIL::customIndianNumberFormat($loan_form['loan_amount']);
|
||||
echo '<span contenteditable="true">During the PD visit,</span> '.$main_applicant_name.',<span contenteditable="true"> provided the following information about loan applied for:</span>';
|
||||
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;
|
||||
|
||||
@ -3,7 +3,7 @@ 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>';
|
||||
$dash = '<span style="color:black;"> </span>';
|
||||
?><!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@ -80,7 +80,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
color: white;page-break-inside: inline;
|
||||
|
||||
}
|
||||
|
||||
/* #########End of Score Card Table Styles######### */
|
||||
|
||||
.tdcenteralign{ text-align: center; }
|
||||
</style>
|
||||
|
||||
|
||||
@ -230,7 +233,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
{
|
||||
if(is_numeric($fy_key))
|
||||
{
|
||||
echo '<td colspan="1" >'.($fy_value['sales_revenue'] ).'</td>';
|
||||
echo '<td colspan="1" class="tdcenteralign">'.($fy_value['sales_revenue'] ).'</td>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -243,7 +246,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
{
|
||||
if(is_numeric($fy_key))
|
||||
{
|
||||
echo '<td colspan="1" >'.($fy_value['net_profit'] ).'</td>';
|
||||
echo '<td colspan="1" class="tdcenteralign">'.($fy_value['net_profit'] ).'</td>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -257,7 +260,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
{
|
||||
if(is_numeric($fy_key))
|
||||
{
|
||||
echo '<td colspan="1" >'.round((($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 ),2).'</td>';
|
||||
echo '<td colspan="1" class="tdcenteralign">'.round((($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 ),2).'</td>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -275,7 +278,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
if($fy_key == 0)
|
||||
{
|
||||
echo '<td colspan="1" >NA</td>';
|
||||
echo '<td colspan="1" class="tdcenteralign">NA</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -283,7 +286,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
$sales_over_py = round( ((($fy_value['sales_revenue'] - $pre_year_sales) / $pre_year_sales ) * 100),2);
|
||||
|
||||
|
||||
echo '<td colspan="1" >'. ((($sales_over_py == 0 ) ? $dash :( $sales_over_py > 0 ? $uparrow : $downarrow))).' ( ' . $sales_over_py. ' )</td>';
|
||||
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'];
|
||||
@ -302,12 +305,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
{
|
||||
if($fy_key == 0)
|
||||
{
|
||||
echo '<td colspan="1" >NA</td>';
|
||||
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" >'. ((($net_profit_over_py == 0 ) ? $dash :( $net_profit_over_py > 0 ? $uparrow : $downarrow))).' ( ' . $net_profit_over_py. ' )</td>';
|
||||
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'];
|
||||
@ -326,14 +329,14 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
{
|
||||
if($fy_key == 0)
|
||||
{
|
||||
echo '<td colspan="1" >NA</td>';
|
||||
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" >'. ((($year_net_pro_loss_per_over_py == 0 ) ? $dash :( $year_net_pro_loss_per_over_py > 0 ? $uparrow : $downarrow))).' ( ' . $year_net_pro_loss_per_over_py. ' )</td>';
|
||||
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 )
|
||||
|
||||
}
|
||||
@ -450,27 +453,27 @@ if(isset($section6))
|
||||
|
||||
|
||||
<?php
|
||||
$photos = array();
|
||||
if(isset($section9) && count($section9))
|
||||
{
|
||||
foreach ($section9 as $img_key => $img_value)
|
||||
{
|
||||
if(!is_array($img_value))
|
||||
{
|
||||
array_push($photos, array('name' => $img_key, 'img' => $img_value)) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($img_value as $key => $value)
|
||||
{
|
||||
if($value)
|
||||
{
|
||||
array_push($photos, array('name' => $img_key, 'img' => $value)) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// $photos = array();
|
||||
// if(isset($section9) && count($section9))
|
||||
// {
|
||||
// foreach ($section9 as $img_key => $img_value)
|
||||
// {
|
||||
// if(!is_array($img_value))
|
||||
// {
|
||||
// array_push($photos, array('name' => $img_key, 'img' => $img_value)) ;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// foreach ($img_value as $key => $value)
|
||||
// {
|
||||
// if($value)
|
||||
// {
|
||||
// array_push($photos, array('name' => $img_key, 'img' => $value)) ;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//print_r($photos);die();
|
||||
?>
|
||||
@ -479,15 +482,16 @@ if(isset($section6))
|
||||
<?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))
|
||||
//if(count($photos))
|
||||
if(count($section9))
|
||||
{
|
||||
echo '<table class="scorecard_table"><tr><th colspan="10">Photograph`s</th></tr></table><br><table ><tbody>';
|
||||
|
||||
foreach ($photos as $p_key => $p_value)
|
||||
foreach ($section9 as $p_key => $p_value)
|
||||
{
|
||||
|
||||
if(!($iter % 3)) { echo '<tr>'; }
|
||||
echo '<td style="text-align:center;border:1px solid;"> <img src="'.$p_value['img'].'" height = "200" width="200"/><br>'.$photo_names [ $p_value['name'] ].'</td>';
|
||||
echo '<td style="text-align:center;border:1px solid;"> <img src="'.$p_value['img'].'" height = "200" width="200"/><br>'.$photo_names [ $p_value['img_name'] ].'</td>';
|
||||
|
||||
if(!($iter % 3) && $iter != 0) { echo '</tr>'; }
|
||||
$iter++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user