TELE PD REPORT FEEDBACK

This commit is contained in:
Velz2020 2020-05-27 23:53:51 +05:30
parent 48dc954952
commit 0a6f3fd9cb
3 changed files with 56 additions and 30 deletions

View File

@ -5886,7 +5886,7 @@ public function getPDFormDetailsJSON_post()
{ {
//print_r($this->aws_s3->createNewBucket('xmldatatest007'));die(); //print_r($this->aws_s3->createNewBucket('xmldatatest007'));die();
//satellite_image::getSatelliteImage(1213);die(); //satellite_image::getSatelliteImage(1704);die();
//echo $this->assignPDTempalate(1325);die(); //echo $this->assignPDTempalate(1325);die();
//$this->getSatelliteImage(342);die();//velmurugan.s@venbainfotech.com //$this->getSatelliteImage(342);die();//velmurugan.s@venbainfotech.com
// PDALERTS::sendSalesPDMail($this,2);die(); // PDALERTS::sendSalesPDMail($this,2);die();
@ -5903,7 +5903,7 @@ public function getPDFormDetailsJSON_post()
// $con = json_decode(json_encode($new),true); // $con = json_decode(json_encode($new),true);
// print_r($con) ; // print_r($con) ;
// die(); // die();
set_time_limit(60); //set_time_limit(60);
$records = $this->post('records'); $records = $this->post('records');
$pdid = $records['pd_id']; $pdid = $records['pd_id'];
@ -6027,14 +6027,14 @@ public function getPDFormDetailsJSON_post()
$data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid); $data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid);
$data['score_questions_display'] = $this->PD_Model->getScoreableQuestionToDispaly(); $data['score_questions_display'] = $this->PD_Model->getScoreableQuestionToDispaly();
//print_r($data['pd_score']); // print_r($data['pd_score']);
//die(); // die();
$data['assessed_income_details'] = $this->getAssessedIncomeForPDReport($pdid); $data['assessed_income_details'] = $this->getAssessedIncomeForPDReport($pdid);
//print_r($data['pd_master_details'][0]['is_score_card_enabled']);die(); //print_r($data['pd_master_details'][0]['is_score_card_enabled']);die();
// echo "**************************"; // echo "**************************";
//$data['dsc_cards'] = $this->getDetailedScoreCardChart( $data['pd_score'] ); //$data['dsc_cards'] = $this->getDetailedScoreCardChart( $data['pd_score'] );
if($data['pd_master_details'][0]['is_score_card_enabled'] == 0 && ($data['pd_master_details'][0]['customer_segment_abbr'] != "SAL"))// && $data['pd_master_details'][0]['customer_segment_abbr'] != "SAL-CHQ")) //&& ($data['pd_master_details'][0]['customer_segment_abbr'] != '')) if($data['pd_master_details'][0]['is_score_card_enabled'] == 1 && ($data['pd_master_details'][0]['customer_segment_abbr'] != "SAL"))// && $data['pd_master_details'][0]['customer_segment_abbr'] != "SAL-CHQ")) //&& ($data['pd_master_details'][0]['customer_segment_abbr'] != ''))
{ {
//echo $data['pd_master_details'][0]['is_score_card_enabled'].'-'.$data['pd_master_details'][0]['customer_segment_abbr'];die(); //echo $data['pd_master_details'][0]['is_score_card_enabled'].'-'.$data['pd_master_details'][0]['customer_segment_abbr'];die();
$data['pd_score'] = $this->calculateScore($pdid); $data['pd_score'] = $this->calculateScore($pdid);
@ -7437,7 +7437,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$loan_amt_from_loam_form = $loan_amt_from_loam_form['loan_amount']; $loan_amt_from_loam_form = $loan_amt_from_loam_form['loan_amount'];
//echo $loan_amt_from_loam_form; //echo $loan_amt_from_loam_form;
//seperate PD Scorable quesitons from JSON //seperate PD Scorable quesitons from JSON
$score_questions = $this->seperateScoreQuestions($form_data,$pd_master_details[0]['is_otp_done']); $score_questions = $this->seperateScoreQuestions($form_data,$pd_master_details);
//print_r($score_questions);die(); //print_r($score_questions);die();
// echo "###################################"; // echo "###################################";
//Get Pesrsonal Assets Grid Masters Details //Get Pesrsonal Assets Grid Masters Details
@ -7504,10 +7504,11 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
//Get All Score able Question from various PD Forms - 3 Questions Pending //Get All Score able Question from various PD Forms - 3 Questions Pending
public function seperateScoreQuestions($form_data,$OTP) public function seperateScoreQuestions($form_data,$pd_master_details)
{ {
$score_questions = array(); $score_questions = array();
$OTP = $pd_master_details[0]['is_otp_done'];
$is_this_tele_pd = $pd_master_details[0]['fk_pd_type'] == 3 ? true : null;
#####General Form Questions######## #####General Form Questions########
$general_form = (json_decode($form_data[18][0]['processed_json'],true)); $general_form = (json_decode($form_data[18][0]['processed_json'],true));
// echo "seperateScoreQuestions"; // echo "seperateScoreQuestions";
@ -7530,6 +7531,9 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$score_questions['general']['person_met_is_applicant'] = 'yes'; $score_questions['general']['person_met_is_applicant'] = 'yes';
} }
} }
//if tele pd remove person_met_is_applicant
if($is_this_tele_pd){ unset($score_questions['general']['person_met_is_applicant']);}
//print_r($qualification_temp_array); //print_r($qualification_temp_array);
$qualification_temp_array = array_map(function($item){ $qualification_temp_array = array_map(function($item){
return $item != "" || $item != null ? $item : 6; return $item != "" || $item != null ? $item : 6;
@ -7558,10 +7562,14 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
if(isset($address_form['is_pd_done_on_initiated_address']) && $address_form['is_pd_done_on_initiated_address'] != 1) if(isset($address_form['is_pd_done_on_initiated_address']) && $address_form['is_pd_done_on_initiated_address'] != 1)
{ {
if(!$is_this_tele_pd)
{
// 4 - QNO(1.2) - Comment on locality // 4 - QNO(1.2) - Comment on locality
$score_questions['general']['comment_locality'] = $address_form['alternative_addresses'][0]['comment_locality_master']; $score_questions['general']['comment_locality'] = $address_form['alternative_addresses'][0]['comment_locality_master'];
// 5 - QNO(1.3) - pd location approach // 5 - QNO(1.3) - pd location approach
$score_questions['general']['pd_location_approach'] = $address_form['alternative_addresses'][0]['pd_location_master']; $score_questions['general']['pd_location_approach'] = $address_form['alternative_addresses'][0]['pd_location_master'];
}
} }
else //get it from alternative address else //get it from alternative address
@ -7583,23 +7591,32 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
// 6 - QNO(1.4) - customer behaviour // 6 - QNO(1.4) - customer behaviour
$score_questions['general']['customer_behaviour'] = $final_remarks_form['final_custormer_remark_type_master']; $score_questions['general']['customer_behaviour'] = $final_remarks_form['final_custormer_remark_type_master'];
// 7 - QNO(3.1) - pd_officer_recommadations // 7 - QNO(3.1) - pd_officer_recommadations
$score_questions['final_remarks']['pd_officer_recommandations'] = $final_remarks_form['pd_officers_recommendation_master']; $score_questions['final_remarks']['pd_officer_recommandations'] = $final_remarks_form['pd_officers_recommendation_master'];
// 8 - QNO(2.11) - pd location approach // 8 - QNO(2.11) - pd location approach
if(!$is_this_tele_pd)
{
$score_questions['business']['location_suited_for_busienss'] = $final_remarks_form['is_service_provided']; $score_questions['business']['location_suited_for_busienss'] = $final_remarks_form['is_service_provided'];
}
#####End of Final Remarks Form Questions######## #####End of Final Remarks Form Questions########
#####Neighbourhood Form Questions######## #####Neighbourhood Form Questions########
if(!$is_this_tele_pd)
{
$neighbourhood_form = (json_decode($form_data[19][0]['processed_json'],true)); $neighbourhood_form = (json_decode($form_data[19][0]['processed_json'],true));
//print_r($neighbourhood_form); //print_r($neighbourhood_form);
// 9 - QNO(1.5) - neibourhood_check_as_per_pd_officer // 9 - QNO(1.5) - neibourhood_check_as_per_pd_officer
$score_questions['general']['neibourhood_check_as_per_pd_officer'] = isset($neighbourhood_form['neighbourhood_status']) ? $neighbourhood_form['neighbourhood_status'] : 'Negative'; $score_questions['general']['neibourhood_check_as_per_pd_officer'] = isset($neighbourhood_form['neighbourhood_status']) ? $neighbourhood_form['neighbourhood_status'] : 'Negative';
}
#####End of Neighbourhood Form Questions######## #####End of Neighbourhood Form Questions########
@ -7614,7 +7631,10 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$score_questions['business']['business_seasonality'] = $business_form['seasonality']; $score_questions['business']['business_seasonality'] = $business_form['seasonality'];
// 12 - QNO(2.3) - employees_total // 12 - QNO(2.3) - employees_total
if(!$is_this_tele_pd)
{
$score_questions['business']['employees_total'] = $business_form['employees_total']; $score_questions['business']['employees_total'] = $business_form['employees_total'];
}
// 13 - QNO(2.4) - all business certificate // 13 - QNO(2.4) - all business certificate
@ -7663,9 +7683,13 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$score_questions['business']['owned_property'] = $property_count ? 'yes':'no'; $score_questions['business']['owned_property'] = $property_count ? 'yes':'no';
// 15 - QNO(2.6) - owned_vechile // 15 - QNO(2.6) - owned_vechile
$score_questions['business']['owned_vechile'] = $vechile_count ? 'yes':'no'; $score_questions['business']['owned_vechile'] = $vechile_count ? 'yes':'no';
// - QNO (2.12) - business_activity seen // - QNO (2.12) - business_activity seen
if(!$is_this_tele_pd)
{
$score_questions['business']['business_activity_has_seen'] = isset($business_assest_form['business_assets_for_address'][0]['business_is_pd_visited'])? $business_assest_form['business_assets_for_address'][0]['business_is_pd_visited']: 'no'; $score_questions['business']['business_activity_has_seen'] = isset($business_assest_form['business_assets_for_address'][0]['business_is_pd_visited'])? $business_assest_form['business_assets_for_address'][0]['business_is_pd_visited']: 'no';
} }
}
#####End of Business Assets Form Questions######## #####End of Business Assets Form Questions########
@ -8876,6 +8900,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
//update geo location to pd master table //update geo location to pd master table
$this->PD_Model->updateRecords(array('start_location' => $records['link']),PDTRIGGER,array('pd_id' => $records['fk_pd_id'])); $this->PD_Model->updateRecords(array('start_location' => $records['link']),PDTRIGGER,array('pd_id' => $records['fk_pd_id']));
satellite_image::getSatelliteImage($records['fk_pd_id']);
} }
else if(strpos($records['image_key'], 'common_image') !== false) else if(strpos($records['image_key'], 'common_image') !== false)
{ {

View File

@ -56,12 +56,12 @@ class satellite_image
} }
$geo_location = preg_replace('/\s+/', '', $geo_location);
$url = "https://maps.googleapis.com/maps/api/staticmap?center=".$geo_location."&zoom=14&markers=color:red|".$geo_location."&size=800x300&maptype=roadmap&key=".$google_map_static_api_key; $url = "https://maps.googleapis.com/maps/api/staticmap?center=".$geo_location."&zoom=14&markers=color:red|".$geo_location."&size=800x300&maptype=roadmap&key=".$google_map_static_api_key;
//echo $url; //echo $url;
$ou = file_put_contents($path_to_check.'/satellite.png', file_get_contents($url)); $ou = file_put_contents($path_to_check.'/satellite.png', file_get_contents($url));
$satellite_script = $url; $satellite_script = $url;
//echo $url;
// //convert as base 64 image. // //convert as base 64 image.

View File

@ -542,10 +542,11 @@ if ( isset($pdf) ) {
<?php <?php
echo '<tr><td>PD Initiated Date </td> <td style="width:2%;">:</td> <td> '.$pd_master_details[0]['createdon'].'</td></tr>'; echo '<tr><td>PD Initiated Date </td> <td style="width:2%;">:</td> <td> '.$pd_master_details[0]['createdon'].'</td></tr>';
echo '<tr><td>PD Type </td> <td style="width:2%;">:</td> <td> Telephonic </td></tr>';
echo '<tr><td>Tele PD Date </td> <td style="width:2%;">:</td> <td> '.$pd_master_details[0]['pd_visit_date'].'</td></tr>'; echo '<tr><td>Tele PD Date </td> <td style="width:2%;">:</td> <td> '.$pd_master_details[0]['pd_visit_date'].'</td></tr>';
echo '<tr><td>PD Report Date </td> <td style="width:2%;">:</td> <td>'.$pd_master_details[0]['pd_report_generated_date'].'</td></tr>'; echo '<tr><td>PD Report Date </td> <td style="width:2%;">:</td> <td>'.$pd_master_details[0]['pd_report_generated_date'].'</td></tr>';
echo '<tr><td>PD Initiated by </td> <td style="width:2%;">:</td> <td>'.$pd_master_details[0]['branch_name'].' Branch</td></tr>'; echo '<tr><td>PD Initiated by </td> <td style="width:2%;">:</td> <td>'.$pd_master_details[0]['branch_name'].' Branch</td></tr>';
echo '<tr><td>PD Type </td> <td style="width:2%;">:</td> <td> Telephonic </td></tr>';
echo '<tr><td>Loan Application ID </td> <td style="width:2%;">:</td> <td> '.$pd_master_details[0]['lender_applicant_id'].'</td></tr>'; echo '<tr><td>Loan Application ID </td> <td style="width:2%;">:</td> <td> '.$pd_master_details[0]['lender_applicant_id'].'</td></tr>';
echo '<tr><td>Product </td> <td style="width:2%;">:</td> <td>'.$pd_master_details[0]['product_name'].'</td></tr>'; echo '<tr><td>Product </td> <td style="width:2%;">:</td> <td>'.$pd_master_details[0]['product_name'].'</td></tr>';
echo '<tr><td>Customer Segment </td> <td style="width:2%;">:</td> <td>'.(explode('-',$pd_master_details[0]['customer_segment_name'])[0]).'</td></tr>'; echo '<tr><td>Customer Segment </td> <td style="width:2%;">:</td> <td>'.(explode('-',$pd_master_details[0]['customer_segment_name'])[0]).'</td></tr>';
@ -1089,7 +1090,7 @@ if ( isset($pdf) ) {
<img border="3" src = "<?php echo $satellite_url;?>" alt=" Satellite Image of location of Where PD was Done" style="width:100%;height:300px;border-color:#0191ed" /><br><br><br> <img border="3" src = "<?php echo $satellite_url;?>" alt=" Satellite Image of location of Where PD was Done" style="width:100%;height:300px;border-color:#0191ed" /><br><br><br>
<?php if($name_board_seen_img_url != "") {?> <?php if($name_board_seen_img_url != "") {?>
<table> <table align="center">
<thead> <thead>
<tr> <th>Name Board of Business/Entrance</th> </tr> <tr> <th>Name Board of Business/Entrance</th> </tr>
</thead> </thead>
@ -2288,7 +2289,7 @@ if($total_no_of_business > 0) {
} }
else{ echo "<p>Financial statements not provided by Loan Applicants to PD officer. </p>";} //else{ echo "<p>Financial statements not provided by Loan Applicants to PD officer. </p>";}
?> ?>
@ -2434,7 +2435,7 @@ if($total_no_of_business > 0) {
if($financial_kuccha_info['kuccha_records_shown'] == 'yes') if($financial_kuccha_info['kuccha_records_shown'] == 'yes')
{ {
echo '<br><br>Photograph of Kuchha Bills Allowed (Yes/No) : '. ($financial_kuccha_info['kuccha_bill_allowed'] == 'yes' ? 'Yes, enclosed with report': 'No'); echo '<br><br>Photograph of Kuchha Bills Shared (Yes/No) : '. ($financial_kuccha_info['kuccha_bill_allowed'] == 'yes' ? 'Yes, enclosed with report': 'No');
// echo '<br><br>Number of Kuccha Bills and Values therein, justifies the customer declared turnover (Yes / No): '. ( $financial_kuccha_info['customer_declared_turnover'] == 'yes' ? 'Yes': 'No'); // echo '<br><br>Number of Kuccha Bills and Values therein, justifies the customer declared turnover (Yes / No): '. ( $financial_kuccha_info['customer_declared_turnover'] == 'yes' ? 'Yes': 'No');
} }
@ -2557,7 +2558,7 @@ if($total_no_of_business > 0) {
<?php } <?php }
else else
{ {
echo '<p>As per person met, Applicant does not have any business account.</p>'; echo '<p>As per loan applicant(s), Applicant does not have any business account.</p>';
} }
if($business_banking_common_remarks != ""){ echo '<p>'.$business_banking_common_remarks.'</p>'; } if($business_banking_common_remarks != ""){ echo '<p>'.$business_banking_common_remarks.'</p>'; }
@ -4281,7 +4282,7 @@ if($total_no_of_business > 0) {
<!-- #################Final Remarks Section#################--> <!-- #################Final Remarks Section#################-->
<div class="page_break"></div> <div class="page_break"></div>
<br><h3 contenteditable="true">PD OFFICER`S REMARKS ON CUSTOMER BEHAVIOUR, BUSINESS LOCATION & OVERALL PD STATUS</h3> <br><h3 contenteditable="true">PD OFFICER`S REMARKS ON CUSTOMER BEHAVIOUR & OVERALL PD STATUS</h3>
<?php <?php
//print_r($final_remark_data); //print_r($final_remark_data);
$polite = null;$rude = null; $other_behaviour = null;$other_behaviour_remarks = null; $polite = null;$rude = null; $other_behaviour = null;$other_behaviour_remarks = null;