PD REPORT AND QC

This commit is contained in:
velz 2019-05-25 22:41:37 +05:30
parent 74eb3e1d51
commit 9d6f8a127a
10 changed files with 111 additions and 79 deletions

View File

@ -21,6 +21,7 @@ class PD_Controller extends REST_Controller {
{
// Construct the parent class
parent::__construct();
$this->load->model('PD_Model');
$this->load->library('AWS_S3');
$this->load->library('AWS_SNS');
@ -44,7 +45,7 @@ class PD_Controller extends REST_Controller {
for ($i = 0; $i < 5; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
$temp_file_name = $randomString.date('Y-m-d-H:m:s');
$temp_file_name = $randomString.date('Y-m-d-h:i:s');
$ifp = fopen( $output_file, 'wb' );
@ -531,7 +532,7 @@ class PD_Controller extends REST_Controller {
// for ($i = 0; $i < 5; $i++) {
// $randomString .= $characters[rand(0, $charactersLength - 1)];
// }
// $temp_file_name = $randomString.date('Y-m-d-H:m:s').'.png';
// $temp_file_name = $randomString.date('Y-m-d-h:i:s').'.png';
// $ifp = fopen( $output_file, 'wb' );
@ -730,7 +731,7 @@ class PD_Controller extends REST_Controller {
{
$pd_details['start_location'] = $pd_details['link'];
$pd_details['pd_visit_date'] = date('Y-m-d h:m:s');
$pd_details['pd_visit_date'] = date('Y-m-d h:i:s');
unset($pd_details['link']);
$string2 = str_shuffle('1234567890');
$OTP = substr($string2,0,6);
@ -1108,7 +1109,7 @@ class PD_Controller extends REST_Controller {
$updatePd['pd_status'] = INPROGRESS;
$updatePd['is_otp_done'] = 1;
$updatePd['fk_updatedby'] = $pdotp['fk_updatedby'];
$updatePd['updatedon'] = date('Y-m-d h:m:00');
//$updatePd['updatedon'] = date('Y-m-d h:i:00');
if($pdotpStatus != 0 || $pdotpStatus != '' && count($pdotpStatus) != 0)
{
@ -1136,7 +1137,7 @@ class PD_Controller extends REST_Controller {
$updatePd['is_otp_done'] = 0;
$updatePd['otp_reject_reason'] = $pdotp['reason'];
$updatePd['otp_reject_other_reason'] = $pdotp['other_reason'];
$updatePd['updatedon'] = date('Y-m-d h:m:00');
//$updatePd['updatedon'] = date('Y-m-d h:m:00');
$updatePd['fk_updatedby'] = $pdotp['fk_updatedby'];
$where_condition_array = array('pd_id' => $pdotp['pd_id']);
@ -1374,7 +1375,7 @@ class PD_Controller extends REST_Controller {
//$id = $this->PD_Model->saveRecords($records,PDSCHEDULE);
$where_condition_array = array('pd_id' => $records['fk_pd_id']);
$temp_array = array('pd_status' => SCHEDULED,'fk_updatedby'=>$records['fk_scheduled_by'],'updatedon'=>date('Y-m-d H:m:i'),'scheduled_on'=>$records['schedule_time']);
$temp_array = array('pd_status' => SCHEDULED,'fk_updatedby'=>$records['fk_scheduled_by'],'scheduled_on'=>$records['schedule_time']);
$pd_id_modified = $this->PD_Model->updateRecords($temp_array,PDTRIGGER,$where_condition_array);
/******* Code Snippt for Save Template Category Weightage info to PD category Info*/
@ -2011,7 +2012,7 @@ class PD_Controller extends REST_Controller {
for ($i = 0; $i < 5; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
$temp_file_name = $randomString.date('Y-m-d-H:m:s').'.png';
$temp_file_name = $randomString.date('Y-m-d-H:i:s').'.png';
$ifp = fopen( $output_file, 'wb' );
@ -2110,7 +2111,7 @@ class PD_Controller extends REST_Controller {
for ($i = 0; $i < 5; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
$temp_file_name = $randomString.date('Y-m-d-H:m:s').'.png';
$temp_file_name = $randomString.date('Y-m-d-H:i:s').'.png';
$ifp = fopen( $output_file, 'wb' );
@ -3414,7 +3415,7 @@ class PD_Controller extends REST_Controller {
}
// Get all assigned pd forms associated with this pd from template_forms table
if($template_id != null)
if($template_id == null)
{
$columns = array('TEMPLATEFORMS.form_id','PDFORMS.pd_form_name');
$table = TEMPLATEFORMS.' as TEMPLATEFORMS';
@ -3935,7 +3936,7 @@ class PD_Controller extends REST_Controller {
$is_qc_edited = 1;
}
if($is_qc_edited)
if($is_qc_edited == 1 || $is_qc_edited == 2)
{
//Get Latest PD Report Html file and convert it into PDF
$latest_pd_report_html_file_name = $pd_master_details[0]['pd_report_html_filename'];
@ -4018,7 +4019,7 @@ class PD_Controller extends REST_Controller {
//Generate Report as HTML File
public function generatePDReport_post()
{
{
$records = $this->post('records');
$pdid = $records['pd_id'];
$fk_createdby = $records['fk_createdby'];
@ -4080,7 +4081,7 @@ class PD_Controller extends REST_Controller {
if (!is_dir(APPPATH.'views/pd_reports/'.$pdid)) {
$dust = mkdir(APPPATH.'views/pd_reports/'.$pdid, 0777, TRUE);
}
$pd_report_time = date('Y-m-d-h-m-s');
$pd_report_time = date('Y-m-d-h-i-s');
$pd_report_store = APPPATH.'views/pd_reports/'.$pdid.'/'.$pd_report_time.'.html';
$is_write_done = file_put_contents($pd_report_store,$temp);
@ -4090,7 +4091,7 @@ class PD_Controller extends REST_Controller {
//$update = $this->PD_Model->updateRecords(array('pd_report_html_filename' => $pd_report_time),PDTRIGGER,array('pd_id' => $pdid));
$where_condition_array = array("pd_id" => $pdid);
$temp_array = array('is_original_report_created'=>1,'pd_report_html_filename' => $pd_report_time,'pd_report_generated_date' => date('Y-m-d h:m:s'));
$temp_array = array('is_original_report_created'=>1,'pd_report_html_filename' => $pd_report_time,'pd_report_generated_date' => date('Y-m-d h:i:s'),'is_qc_edited' => 2);
$id = $this->PD_Model->updateRecords($temp_array,PDTRIGGER,$where_condition_array);
@ -4847,7 +4848,7 @@ class PD_Controller extends REST_Controller {
for($i = 1;$i < 3;$i++)
{
// Incase running from local windows (Velz sys)
// Incase running from local windows
//$dsc_script_from_db = $this->PD_Model->selectCustomRecords(array('*'),array('script_name' => 'phantom_dsc_local'),SCRIPTS);
$dsc_script_from_db = $this->PD_Model->selectCustomRecords(array('*'),array('script_name' => DETAILED_SCORE_CARD_IMAGE_LOCATION),SCRIPTS);
@ -4867,7 +4868,7 @@ class PD_Controller extends REST_Controller {
$dsc_script_from_db = str_replace('{{html_content}}',$html_content,$dsc_script_from_db);
$dsc_script_from_db = $i == 1 ? str_replace('{{img_name}}','dsc_business',$dsc_script_from_db) : str_replace('{{img_name}}','dsc_general',$dsc_script_from_db);
$logger = MYLOG::logFunction();
$logger->info('Score Card Graphical Representation called',array('card_type' => $i,'script' => $dsc_script_from_db));
//echo $dsc_script_from_db;
//echo "*************";
@ -4925,9 +4926,7 @@ class PD_Controller extends REST_Controller {
public function codeigniterViewTest_post()
{
//echo MYUTIL::customIndianNumberFormat(145263.45896);die();
$records = $this->post('records');
$pdid = $records['pd_id'];
@ -4945,7 +4944,7 @@ class PD_Controller extends REST_Controller {
$data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid);
$data['score_questions_display'] = $this->PD_Model->getScoreableQuestionToDispaly();
$data['pd_score'] = $this->calculateScore($pdid);
//print_r($data['pd_score']);
//print_r($data['pd_score']);
//die();
$data['assessed_income_details'] = $this->getAssessedIncomeForPDReport($pdid);
@ -5011,7 +5010,7 @@ class PD_Controller extends REST_Controller {
if (!is_dir(APPPATH.'views/pd_reports/'.$pdid)) {
$dust = mkdir(APPPATH.'views/pd_reports/'.$pdid, 0777, TRUE);
}
$pd_report_time = date('Y-m-d-h-m-s');
$pd_report_time = date('Y-m-d-h-i-s');
$pd_report_store = APPPATH.'views/pd_reports/'.$pdid.'/'.$pd_report_time.'.html';
file_put_contents($pd_report_store,$t);
@ -6001,7 +6000,7 @@ class PD_Controller extends REST_Controller {
for ($i = 0; $i < 5; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
$temp_file_name = $randomString.date('Y-m-d-H:m:s').'.png';
$temp_file_name = $randomString.date('Y-m-d-H:i:s').'.png';
$ifp = fopen( $output_file, 'wb' );
@ -6396,11 +6395,11 @@ class PD_Controller extends REST_Controller {
$over_all_asset_value = 0;
if(array_key_exists('assets_details',$other_asset_form))
{
//print_r($other_asset_form);
//print_r($other_asset_form['assets_details']);die();
foreach($other_asset_form['assets_details'] as $asset)
{
//echo 'Value - '.$asset['approximate_market_value'];
$over_all_asset_value += $asset['approximate_market_value'] ;
$over_all_asset_value += is_numeric($asset['approximate_market_value']) ? $asset['approximate_market_value'] : 0 ;
if($asset['assets_mode'] == 6)//LIC
{
$over_all_asset_value += $asset['details'][0]['sum_assured'];
@ -6573,7 +6572,7 @@ class PD_Controller extends REST_Controller {
$pdid = $records['pdid'];
$content = $records['content'];
$fk_createdby = $records['fk_createdby'];
$pd_report_time = date('Y-m-d-h-m-s');
$pd_report_time = date('Y-m-d-h-i-s');
$pd_report_store = APPPATH.'views/pd_reports/'.$pdid.'/'.$pd_report_time.'.html';
file_put_contents($pd_report_store,$content);
@ -6602,6 +6601,8 @@ class PD_Controller extends REST_Controller {
public function getPDReportHTML_get()
{
$pdid = $this->uri->segment(2);
//date_default_timezone_set("Asia/Kolkata");
//echo date('Y-m-d h:i:s');die();
if(($pdid != null || $pdid != "") && (strlen($pdid) == 16) &&(is_string($pdid)))
{
$pd_data = $this->PD_Model->selectCustomRecords(array('pd_id','pd_report_html_filename'),array('random_string' => $pdid),PDTRIGGER);
@ -6612,7 +6613,7 @@ class PD_Controller extends REST_Controller {
}
else
{
echo "<h1> Not Found</h1>";
echo "<h1> DNot Found</h1>";
}
}
else

View File

@ -10,7 +10,7 @@ public static function getBusinessBankingDetails($values){
$count_vintage = $tag['vintage_year'] >0 ? $tag['vintage_year'] :"";
$count_vintage .= ($tag['vintage_year'] == 1) ? " Year" : (($tag['vintage_year'] > 1) ? " Years" : "");
$count_vintage.=' ';
$count_vintage .=$tag['vintage_month'] >0 ? ' and ' . $tag['vintage_month'] : "";
$count_vintage .=$tag['vintage_month'] >0 ? ($tag['vintage_year'] >0 ? ' and ' . $tag['vintage_month'] : $tag['vintage_month']) : "";
$count_vintage .=($tag['vintage_month'] == 1) ? " Month" : (($tag['vintage_month'] > 1) ? " Months" : "");
return array(
'account_name' => $tag['applicant_name']['id']==0 ? $tag['other_applicant'] : $tag['applicant_name']['name'],

View File

@ -391,7 +391,7 @@ public static function getActivityDetails($values,$type){
// get business peak period details
public static function getBusinessPeakDetails($details){
$getRow='The Business has major changes,';
$getRow='The Business has maximum sales/services during,';
$getRow.= count($details) >1 ?' the periods of ' :' the period of ';
foreach($details as $key=>$value){
$getRow=$getRow;
@ -435,7 +435,7 @@ public static function getBusinessPeakDetails($details){
break;
}
}
$getRow .=' maximum sales/services done.';
$getRow .='.';
return $getRow;
}
}

View File

@ -62,7 +62,7 @@ class PDSCORE
$supplir_client_answer_scores = array('Provided' => 10, 'Not Provided' => 0,'Not Applicable' => 0);
$otp_done = array('Yes' => 10, 'No' => 0);
$qualification = array( 'name_score' => array('Completed Professinal Course' => 10,'Completed Post Graduation' => 8, 'Completed Graduation' => 6,'Completed Schooling' => 4,'Not Completed Schooling' => 2,'No Formal Education' => 0),
$qualification = array( 'name_score' => array('Completed Professional Course' => 10,'Completed Post Graduation' => 8, 'Completed Graduation' => 6,'Completed Schooling' => 4,'Not Completed Schooling' => 2,'No Formal Education' => 0),
'id_score' => array('1' => 10,'2' => 8,'3' => 6,'4' => 4,'5' => 2,'6' => 0));
/*-------- BUSNIESS --------------*/
@ -207,6 +207,8 @@ class PDSCORE
//echo 'loan_amount - '.$loan_amount;
$avg_expected_value_of_assets = $personal_asset_grid['master_grid'][0]['avg_expected_value_assets'];
//print_r($personal_asset_grid);
//echo $avg_expected_value_of_assets;
$asset_calculation_details['avg_expected_value_of_assets'] = round($avg_expected_value_of_assets,2);
//echo "avg_expected_value_of_assets - ".$avg_expected_value_of_assets;
//$expected_value_of_assets = ($avg_expected_value_of_assets / 100 ) * $personal_asset_grid['master_grid'][0]['loan_amount_to'];
@ -223,7 +225,10 @@ class PDSCORE
//echo 'actual_value_of_assets_percentage--'.$actual_value_of_assets_percentage;
$variance = (($actual_value_of_assets_percentage - $avg_expected_value_of_assets)/$avg_expected_value_of_assets )* 100 ;
//echo 'varience--'.$variance;
//die();
$asset_calculation_details['variance'] = round($variance,2);
$final_asset_attributed_score = 0;

View File

@ -1 +1 @@
var page = require('webpage').create();page.viewportSize = { width: 600, height: 350 };page.clipRect = { top: 0, left: 0, width: 600, height: 350 };var score = 53.4;var url = 'http://localhost/sparqtest/api?'+score;var image_url = '/opt/lampp/htdocs/sparqtest/api/application/views/report_templates/chart.png';page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});
var page = require('webpage').create();page.viewportSize = { width: 600, height: 350 };page.clipRect = { top: 0, left: 0, width: 600, height: 350 };var score = 89;var url = 'http://localhost:9999/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/chart.png' ;page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});

View File

@ -1 +1 @@
var wpage = require('webpage').create();var Content = '<html><head><script src="https://cdn.zingchart.com/zingchart.min.js"></script><link href="https://fonts.googleapis.com/css?family=Merriweather" rel="stylesheet"> <script>zingchart.MODULESDIR = "https://cdn.zingchart.com/modules/";ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "ee6b7db5b51705a13dc2339db3edaf6d"];</script><style>#myChart-wrapper {margin: auto;}.zc-ref {display: none;}</style></head><body><div id="myChart"><a class="zc-ref" href="https://www.zingchart.com/">Powered by ZingChart</a></div><script>var myConfig = {"type": "hbar","font-family": "Helvetica","title": {"text": "Other PD Parameters","font-family": "Arial","background-color": "none","font-color": "#00","font-size":"18px"},"plot": {"borderRadius": 8,"hover-state": {"visible": false},},"plotarea": {"margin": "60px 70px 20px 300px"},"scale-x": {"line-color": "","values": ["Asset Value by Loan Amount % >>","Business Board Sighted >>","Neighbourhood check >>","Customer Behaviour >>","Approach to PD location >>","Comment on Locality >>","Qualification of Loan Applicants >>","Is person Met, a loan applicant >>","OTP authentication done >>",],"tick": {"visible": false},"guide": {"visible": false},"item": {"font-size": "12px","padding-right": "0px","auto-align": true,"font-color": "#000"}},"scale-y": {"visible": false,"guide": {"visible": false}},"series": [ {"values": [100,100,0,0,70,70,60,100,100,],"bar-width": "25px","max-trackers": 0,"value-box": {"placement": "top","text": "%v%","decimals": 2,"font-color": "#000","font-size": "12px"},"rules": [{"rule": "%v <= 50","background-color": "#E53935"}, {"rule": "%v >= 50 && %i <= 70","background-color": "#ff9900"}, {"rule": "%v >= 70 && %i <= 80","background-color": "#99ff66"}, {"rule": "%v >= 80","background-color": "#33cc33"}]}]};zingchart.render({id: "myChart",data: myConfig,width: 800});</script></body></html>';var pageurl = '/opt/lampp/htdocs/sparqapi/api/application/views/report_templates/dsc.html'; wpage.viewportSize = { width: 810, height: 250 };wpage.setContent(Content, pageurl); wpage.onLoadFinished = function(status){wpage.render('/opt/lampp/htdocs/sparqtest/api/application/views/report_templates/dsc_general.png'); phantom.exit();};
var wpage = require('webpage').create();var Content = '<html><head><script src="https://cdn.zingchart.com/zingchart.min.js"></script><link href="https://fonts.googleapis.com/css?family=Merriweather" rel="stylesheet"> <script>zingchart.MODULESDIR = "https://cdn.zingchart.com/modules/";ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "ee6b7db5b51705a13dc2339db3edaf6d"];</script><style>#myChart-wrapper {margin: auto;}.zc-ref {display: none;}</style></head><body><div id="myChart"><a class="zc-ref" href="https://www.zingchart.com/">Powered by ZingChart</a></div><script>var myConfig = {"type": "hbar","font-family": "Helvetica","title": {"text": "Other PD Parameters","font-family": "Arial","background-color": "none","font-color": "#00","font-size":"18px"},"plot": {"borderRadius": 8,"hover-state": {"visible": false},},"plotarea": {"margin": "60px 70px 20px 300px"},"scale-x": {"line-color": "","values": ["Asset Value by Loan Amount % >>","Business Board Sighted >>","Neighbourhood check >>","Customer Behaviour >>","Approach to PD location >>","Comment on Locality >>","Qualification of Loan Applicants >>","Is person Met, a loan applicant >>","OTP authentication done >>",],"tick": {"visible": false},"guide": {"visible": false},"item": {"font-size": "12px","padding-right": "0px","auto-align": true,"font-color": "#000"}},"scale-y": {"visible": false,"guide": {"visible": false}},"series": [ {"values": [100,100,100,100,70,70,100,100,100,],"bar-width": "25px","max-trackers": 0,"value-box": {"placement": "top","text": "%v%","decimals": 2,"font-color": "#000","font-size": "12px"},"rules": [{"rule": "%v <= 50","background-color": "#E53935"}, {"rule": "%v >= 50 && %i <= 70","background-color": "#ff9900"}, {"rule": "%v >= 70 && %i <= 80","background-color": "#99ff66"}, {"rule": "%v >= 80","background-color": "#33cc33"}]}]};zingchart.render({id: "myChart",data: myConfig,width: 800});</script></body></html>';var pageurl = 'C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/dsc.html'; wpage.viewportSize = { width: 810, height: 250 };wpage.setContent(Content, pageurl); wpage.onLoadFinished = function(status){wpage.render('C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/dsc_general.png'); phantom.exit();};

View File

@ -318,7 +318,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<table>
<tbody>
<?php
echo "<tr><td>PD Initiated Date </td> <td> </td> <td> ".$pd_master_details[0]['pd_date_of_initiation']."</td></tr>";
echo "<tr><td>PD Initiated Date </td> <td> </td> <td> ".$pd_master_details[0]['createdon']."</td></tr>";
echo "<tr><td>PD Vist Date </td> <td> </td> <td> ".$pd_master_details[0]['pd_visit_date']."</td></tr>";
echo "<tr><td>PD Report Date </td> <td> </td> <td>".$pd_master_details[0]['pd_report_generated_date']."</td>";
echo "<tr><td>PD Initiated by </td> <td> </td> <td>".$pd_master_details[0]['branch_name']." Branch</td></tr>";
@ -393,7 +393,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
{
if($individual['pd_co_applicant_id'] == $persons_with_relationship['pd_co_applicant_id'] && isset($persons_with_relationship['relationship']))
{
$RSNA = isset($persons_with_relationship['relation_to_master']) ? $persons_with_relationship['relation_to_master'] : " Could Not Find";
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;
@ -401,6 +405,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$personal_relationship_data.=', ';
}
}
}
}
@ -488,7 +493,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</table>-->
<br>
<p><b>Loan Applicants:</b></p>
<p contenteditable="true"><b>Loan Applicants:</b></p>
<table class="scorecard_table">
<tr> <th>Name</th> <th>Age<br>(Yrs)</th> <th>Qualification</th> <th>Relationships</th> </tr>
@ -540,13 +545,17 @@ defined('BASEPATH') OR exit('No direct script access allowed');
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']))
{
$RSNA = isset($persons_with_relationship['relation_to_master']) ? $persons_with_relationship['relation_to_master'] : " Could Not Find";
if(isset($persons_with_relationship['relationship_master']))
if( isset($persons_with_relationship['relation_to_master']))
{
$personal_relationship_data .= $persons_with_relationship['relationship_master'] .' of '. $RSNA;
$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.='<br><center>and</center><br>';
}
}
}
}
$company_relationship_data .= $personal_relationship_data;
@ -576,7 +585,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if($is_show_scorecard)
{
echo "<h2>PD Score Summary</h2>";
echo '<h2 contenteditable="true">PD Score Summary</h2>';
?>
<table class="scorecard_table">
@ -677,10 +686,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '<span contenteditable="true">The </span><span contenteditable="false">'.$address_type.'</span><span contenteditable="true"> is </span><span contenteditable="false">'.$property_owner_type.'</span><span contenteditable="true"> and the business has been in operation from here for the last</span> <span contenteditable="false">'.$yrs_being_run.'.</span>';
echo '<br><br>The '.$address_type.' is located in '.$locality.' and the estimated area of the '.$address_type.' is '.$estimated_area.' .';
echo '<br><br>The PD location was '. $pd_address['pd_location_master'].'. ' . 'As Per PD Offcier, the '.$address_type .' is situated in '.$comment_locality_master .' Locality.';
echo '<br><br>The PD officer also made the following observations:' ;
echo '<br><br><span contenteditable="true">The PD officer also made the following observations:</span>' ;
echo '<br><ul>';
echo '<li> The location of the '.$address_type.' is '.$address_type_remarks_caption [ $final_remark_data['is_service_provided'] ].' to the nature of business. </li>';
echo '<li><span contenteditable="true"> The location of the</span> '.$address_type.' <span contenteditable="true">is</span> '.$address_type_remarks_caption [ $final_remark_data['is_service_provided'] ].' <span contenteditable="true">to the nature of business. </span></li>';
if($business_assets_details['business_assets_for_address'][0]['business_is_pd_visited'] == 'yes')
{
echo '<li>Business Activity was seen during visit.</li>';
@ -705,12 +714,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<!-- ####################### Loan Details Details Section ############################-->
<p><b>LOAN DETAILS:</b></p>
<p contenteditable="true"><b>LOAN DETAILS:</b></p>
<?php
$loan_amount = MYUTIL::customIndianNumberFormat($loan_form['loan_amount']);
echo "During the PD visit, ".$main_applicant_name.", provided the following information about loan applied for:";
echo '<span contenteditable="true">During the PD visit,</span> '.$main_applicant_name.',<span contenteditable="true"> provided the following information about loan applied for:</span>';
$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']).')');
@ -870,7 +879,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$bindEachResult['business_peak_details']=Businessform::getBusinessPeakDetails($businessRow['peak_period_of_business']);
}
else{
$bindEachResult['business_peak_details']='The Business has no major changes in sales across season.';
$bindEachResult['business_peak_details']='The Business has no major changes in sales across seasons.';
}
$bindEachResult['company_employees'] = '';
@ -938,7 +947,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
//print_r($businessResult['visit_documents']);die();
?>
<h3>BUSINESS INFORMATION:</h3>
<h3 contenteditable="true">BUSINESS INFORMATION:</h3>
<?php
foreach($businessResult as $bKey=>$fetchRow){
?>
@ -1333,7 +1342,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if(count($businessAssetResult)>0){ ?>
<div class="page_break"> <div>
<br>
<h3>Assets used in Buisness</h3>
<h3 contenteditable="true">Assets used in Buisness</h3>
<?php foreach($businessAssetResult as $iterateAsset){ ?>
<p><?php echo $iterateAsset['company_name']; ?></p>
<table class="scorecard_table">
@ -1477,7 +1486,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?>
<div id='page_break'></div>
<h3>Financial Information</h3>
<h3 contenteditable="true">Financial Information</h3>
<?php foreach($businessFinancialResult as $iterateFinance){
if($iterateFinance['is_statement'])
@ -1645,7 +1654,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
//print_r($bankingResult);die();
if(count($bankingResult)>0){ ?>
<div class="page_break"></div>
<p><strong>Business Banking:</strong></p>
<p contenteditable="true"><strong>Business Banking:</strong></p>
<table class="scorecard_table">
<thead>
<tr>
@ -1858,6 +1867,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php
if($to_no_of_clients > 0 )
{
echo '<div id="page_break"></div>';
echo "<h3>Client Details</h3>";
?>
@ -1920,7 +1931,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$supplier_second_row = '<tr><td class="customtd">2</td><td class="customtd_leftalign">Contact Person </td>';
$supplier_second_row .= isset($raw['person_title_name_master']) ? '<td class="customtd">' . $raw['person_title_name_master']: '<td class="customtd">' . '';
$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'] : ' ';//
@ -1970,7 +1981,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$supplier_second_row = '<tr><td class="customtd">2</td><td class="customtd_leftalign">Contact Person </td>';
$supplier_second_row .= isset($tradeRow['person_title_name_master']) ? '<td class="customtd">' . $tradeRow['person_title_name_master']: '<td class="customtd">' . '';
$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'] : ' ';//
@ -2010,11 +2021,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if(count($supplierResult))
{
?>
<h3>Supplier Details</h3>
<h3 contenteditable="true">Supplier Details</h3>
<?php
foreach($supplierResult as $k => $fetchRow){
echo '<br>Supplier '.($k+1).':';
?>
<div id="page_break"> </div>
<table class="scorecard_table">
<thead>
@ -2098,7 +2110,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if(count($stockResult)){
$stock_sr_no = 0;
?>
<h3>Stock Details</h3>
<div id="page_break"></div>
<h3 contenteditable="true">Stock Details</h3>
<?php foreach($stockResult as $getstRow) { ?>
<h3><?php echo $getstRow['company_name']; ?></h3>
@ -2350,7 +2363,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
//die();
if(isset($ai_core_details) && count($ai_core_details['sales_calculated_by_itemwise']))
{
echo '<p>Sales Itemwise : </p>';
echo '<p contenteditable="true">Sales Itemwise : </p>';
echo '<table class="scorecard_table">';
echo '<thead>';
echo $ai_core_details_processed['sales_calculated_by_itemwise_header'];
@ -2374,7 +2387,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if(isset($ai_core_details) && count($ai_core_details['sales_items_by_monthwise']))
{
echo "<br>";
echo "<p>Kuchha Sales Book/Bills : </p>";
echo '<p contenteditable="true">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)
@ -2450,7 +2463,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
//die();
if(isset($ai_core_details) && count($ai_core_details['business_expenses']))
{
echo '<p>Business Expenses Details :</p>';
echo '<p contenteditable="true">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>';
@ -2466,7 +2479,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if(isset($ai_core_details) && count($ai_core_details['house_hold_expenses']))
{
echo '<p>Household Expenses Details :</p>';
echo '<p contenteditable="true">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>';
@ -2483,7 +2496,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if(isset($ai_core_details) && count($ai_summary_details_processed))
{
echo '<p>The Summary of Income :</p>';
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'];
@ -2540,7 +2553,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
}
?>
<h3>Personal Assets</h3>
<div id="page_break"></div>
<h3 contenteditable="">Personal Assets</h3>
<?php
//print_r($otherAssetResult);die();
if(count($otherAssetResult)>0){ ?>
@ -2593,7 +2607,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?>
<h3>Personal Banking: </h3>
<h3 contenteditable="true">Personal Banking: </h3>
<?php if(count($bankingResult)>0){
//print_r($bankingResult);
?>
@ -2650,7 +2664,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php if(count($otherIncomeResult)>0){
//print_r($otherIncomeResult);
?>
<h3>Other Sources of Income of Individual Loan Applicants:</h3>
<h3 contenteditable="true">Other Sources of Income of Individual Loan Applicants:</h3>
<table class="scorecard_table">
<thead>
@ -2697,14 +2711,14 @@ defined('BASEPATH') OR exit('No direct script access allowed');
//print_r($familyResult);die();
?>
<div id='page_break'></div>
<h3>Family Information:</h3>
<h3 contenteditable="true">Family Information:</h3>
<?php foreach($familyResult as $fmKey => $fmValue) { ?>
<!-- <p><strong><?php //echo ($fmKey+1).'. '.$fmValue['selected_person']; ?></strong></p> -->
<?php
$intro_text = $fmValue['selected_person_title'].$fmValue['selected_person'].", who is an applicant in the case, resides at ".$fmValue['residency_address'].'.';
$intro_text = $fmValue['selected_person_title'].$fmValue['selected_person'].', <span contenteditable="true">who is an applicant in the case, resides at </span>'.$fmValue['residency_address'].'<span contenteditable="true">.</span>';
$residence_text = "This is a ". $fmValue['residence_ownership']." residence, where the applicant has been staying for ". $fmValue['residence_No_of_years'].'.';
$residence_text .= (!strcasecmp($fmValue['residence_ownership'],'rented')) ? 'The rent paid Rs.'.$fmValue['rent'].'per month.' : '';
$residence_text ='<span contenteditable="true">This is a </span>'. $fmValue['residence_ownership'].' <span contenteditable="true">residence, where the applicant has been staying for </span>'. $fmValue['residence_No_of_years'].'<span contenteditable="true">.</span>';
$residence_text .= (!strcasecmp($fmValue['residence_ownership'],'rented')) ? '<span contenteditable="true">The rent paid Rs.</span>'.$fmValue['rent'].'<span contenteditable="true">per month.</span>' : '';
echo $intro_text;echo "<br>";echo $residence_text;
@ -2764,7 +2778,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
//print_r($existLoanResult);die();
?>
<h3>Existing Loan Obligation</h3>
<div id="page_break"></div>
<h3 contenteditable="true">Existing Loan Obligation</h3>
<p>The table below lists the details of Existing Loan Obligations of the Loan Applicants.</p>
<table class="scorecard_table">
@ -2861,7 +2876,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<!-- #################Final Remarks Section#################-->
<div class="page_break"></div>
<h3>PD OFFICERS REMARKS ON CUSTOMER BEHAVOUR, BUSINESS LOCATION & OVERALL PD STATUS</h3>
<h3 contenteditable="true">PD OFFICERS REMARKS ON CUSTOMER BEHAVOUR, BUSINESS LOCATION & OVERALL PD STATUS</h3>
<?php
//print_r($final_remark_data);die();
$polite = null;$rude = null; $other_behaviour = null;$other_behaviour_remarks = null;
@ -2890,9 +2905,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$other_pd_officer_command = 1;
$other_command_remark = $final_remark_data['others_pd_officers_recommendation'];
}
//$pd_officer_final_remark = $final_remark_data['final_form_remarks'];
$pd_officer_final_remark = $final_remark_data['final_form_remarks'];
//if(is_null($other_behaviour)){ echo 'null'; } die();
?>
<div>
@ -2919,20 +2934,22 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td style="padding-left:50px;">
<div id="first_div" style="border-color:red;color:red;">Rude</div> <div id="tick_div" style="border-color:red;color:red;"><?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:red;">Others*</div> <div id="tick_div" style="border-color:red;color:red;"><?php if($other_behaviour){ echo $tick_mark; } ?></div>
</td>
<?php } ?>
</tr>
</table>
<br>
<?php if($other_behaviour){
echo "*".$other_behaviour_remarks;
}?>
<br>
<br><br>
<li>Suitability of Business Location: </li>
<br>
<table>
<!-- <tr>
@ -2957,7 +2974,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</table>
<br>
<li>PD Officers overall assessment: </li>
<br>
<table >
<!-- <tr>
@ -2973,6 +2992,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?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>
@ -2983,24 +3003,26 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<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 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_pd_officer_command){ echo $tick_mark; } ?></div>
<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>
<?php if(!$other_pd_officer_command){?>
<p>PD officer recommendation is <?php
<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:15px;color:'.$color_for_pd_offcier_recom.';">'.$fo_diplay.'</span></strong>';?>. The following key points were considered while arriving at the aforementioned status.</p>
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
//die();
if($positive){ echo "<ul>"; foreach($final_remark_data['recommendation_positive'] as $pos){ echo "<li>".$pos['reason_for_positive']."</li>";}
@ -3011,7 +3033,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
echo "</ul>";
?>
<?php } else{ echo "<p>".$other_command_remark."</p>";} ?>
<?php } else{ echo "<p>".$other_command_remark."</p>";}
echo '<p style="text-align:justify;">'.$pd_officer_final_remark.'</p>'
?>
<div id="page_break"></div>
<!-- #################End Final Remarks Section#################-->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB