From 7bef442a8a397f7d218fd5fb9411769e1e2cde27 Mon Sep 17 00:00:00 2001
From: VE10-Sanjeev
Date: Wed, 14 Dec 2022 20:00:09 +0530
Subject: [PATCH] FI changes Feedback -1 : ps
---
.../controllers/Flyhi_Controller.php | 4 +--
api/application/controllers/PD_Controller.php | 28 +++++++++++++++----
api/application/models/PD_Model.php | 12 ++++++++
.../JSONTOREPORT_FI_OV_DI.php | 6 ++--
.../JSONTOREPORT_FI_OV_SAL.php | 3 +-
.../report_templates/JSONTOREPORT_FI_RV.php | 5 ++--
6 files changed, 44 insertions(+), 14 deletions(-)
diff --git a/api/application/controllers/Flyhi_Controller.php b/api/application/controllers/Flyhi_Controller.php
index 06006c59..52da93a9 100644
--- a/api/application/controllers/Flyhi_Controller.php
+++ b/api/application/controllers/Flyhi_Controller.php
@@ -2343,7 +2343,7 @@ class Flyhi_Controller extends REST_Controller {
if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
{
- $pd_document_data = array('fk_pd_id' => $pd_id,'img_type' => 2,'pd_document_title'=>$doc_renamed,'pd_document_name'=>$doc_renamed,'fk_form_id'=>18,'co_applicant_id'=>$applicant_id);
+ $pd_document_data = array('fk_pd_id' => $pd_id,'img_type' => 2,'pd_document_title'=>$doc_renamed,'pd_document_name'=>$doc_renamed,'fk_form_id'=>18,'co_applicant_id'=>$applicant_id,'image_key' => 'person_met_id','content_type'=>3);
$pd_document_id = $this->Flyhi_Model->saveRecords($pd_document_data,PDDOCUMENTS);
if($pd_document_id != "" || $pd_document_id != null){ $temp_flag++; }
unlink($src_local_file);
@@ -2527,7 +2527,7 @@ $this->load->view("digital_locker",$view_data);
if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
{
- $pd_document_data = array('fk_pd_id' => $pd_id,'img_type' => 2,'pd_document_title'=>$doc_renamed,'pd_document_name'=>$doc_renamed,'fk_form_id'=>18,'co_applicant_id'=>$applicant_id);
+ $pd_document_data = array('fk_pd_id' => $pd_id,'img_type' => 2,'pd_document_title'=>$doc_renamed,'pd_document_name'=>$doc_renamed,'fk_form_id'=>18,'co_applicant_id'=>$applicant_id,'image_key' => 'person_met_id','content_type'=>3);
$pd_document_id = $this->Flyhi_Model->saveRecords($pd_document_data,PDDOCUMENTS);
if($pd_document_id != "" || $pd_document_id != null){ $temp_flag++; }
// unlink($src_local_file);
diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php
index cfe32f36..87724af6 100644
--- a/api/application/controllers/PD_Controller.php
+++ b/api/application/controllers/PD_Controller.php
@@ -929,6 +929,17 @@ class PD_Controller extends REST_Controller
log_message('ERROR','####COMPLETE SMC IMAGE PDF = '.$PDF);
unset($pd_details['is_this_smc_pd']);
}
+ if($exist_pd_details[0]['fk_pd_type'] == 4){
+ $random_string = $this->PD_Model->selectCustomRecords(array('random_string'),array('pd_id' => $pd_details['pd_id']),PDTRIGGER);
+ $random_string = $random_string[0]['random_string'];
+ $regenerate = 0 ;
+ $this->load->helper('photo_zip_creator');
+ $this->load->helper('photo_pdf_converter');
+ $ZIP = (new photo_zip_creator)->covertImgs2ZIP($pd_details['pd_id'], $random_string, array(), $regenerate);
+ $PDF = (new photo_pdf_converter)->covertImgs2PDF($pd_details['pd_id'], $random_string, array(), $regenerate);
+ log_message('ERROR','####COMPLETE FI IMAGE ZIP = '.$ZIP);
+ log_message('ERROR','####COMPLETE FI IMAGE PDF = '.$PDF);
+ }
}
@@ -4422,7 +4433,7 @@ class PD_Controller extends REST_Controller
$is_generate = isset($records['is_generate']) ? 1 : 0;
$random_string = $records['random_string'];
$is_qc_edited = 0;
- //echo "step1.Function Entered";
+ // echo "step1.Function Entered";die();
$this->load->helper('report_attachments');
@@ -4431,7 +4442,7 @@ class PD_Controller extends REST_Controller
}
$pd_master_details = $this->PD_Model->getPDMasterDetails($pdid, $random_string);
- // print_r($pd_master_details);
+ //print_r($pd_master_details);
// var_dump($pd_master_details[0]['is_img_pdf_created']);
// check img zip link, img pdf link and vide links
if (!$pd_master_details[0]['is_img_pdf_created']) {
@@ -4441,7 +4452,7 @@ class PD_Controller extends REST_Controller
if (!$pd_master_details[0]['is_zip_created']) {
$data['msg'] = isset($data['msg']) ? ($data['msg'] . 'Image ZIP' . ', ') : 'Image ZIP, ';
}
-
+//echo $data['msg'];die();
// if($pd_master_details[0]['fk_pd_type'] == 2)
// {
// $video_status = $this->PD_Model->selectCustomRecords(array('count(*) as count'),array('isactive' => 1,'twilo_status' => 'enqueued','fk_pd_id' => $pdid),VIDEO_ROOM_INFO);
@@ -5578,7 +5589,9 @@ class PD_Controller extends REST_Controller
public function codeigniterViewTest_post()
{
-
+ // echo CI_VERSION;
+ // echo phpversion();
+ // die();
// echo "i am here";
// exit();
// $host = getenv('DB_HOST');
@@ -5834,10 +5847,11 @@ class PD_Controller extends REST_Controller
{
$data['pd_images']['common_images'] = $this->PD_Model->getSignedPDDocsURL($pdid, null, null, null, null, 'report');
} else {
+ // echo "i am in else";
$data['pd_images']['common_images'] = $this->PD_Model->getSignedPDDocsURL($pdid, null, null, 'common', null, 'report');
}
- // echo "i ahve image";
- // print_r($data['pd_images']);die();
+
+
// die();
//print_r(json_decode($data['pd_processed_forms'][24][0]['processed_json']));//die();
@@ -6958,6 +6972,8 @@ class PD_Controller extends REST_Controller
public function savePDPhotos_post()
{
+ //content_type 1 means IMAGES , 2 means VIDEO , 3 means PDF.
+
$records = $this->post('records');
$company_id = isset($records['company_id']) && $records['company_id'] ? $records['company_id'] : null;
diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php
index 76b50f4a..c62d0b8c 100644
--- a/api/application/models/PD_Model.php
+++ b/api/application/models/PD_Model.php
@@ -459,10 +459,22 @@ class PD_Model extends SPARQ_Model {
if($value['content_type'] == 1){
$profilepics3path = 'pd'.$pdid.'/'.$value['pd_document_name'];}elseif($value['content_type'] == 2){
$profilepics3path = 'pd'.$pdid.'/video/'.$value['pd_document_name'];
+ }else if($value['content_type'] == 3){
+ $bucket_name = LENDER_BUCKET_NAME_PREFIX.$lender_id[0]['fk_lender_id'];
+ $profilepics3path = 'pd'.$pdid.'/'.$value['pd_document_name'];
}
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$profilepics3path,$time);
$document_lists[$key]['doc_url'] = $singed_uri;
+ // if($value['content_type'] == 3)
+ // {
+ // // $pth = file_get_contents(base_url()."path/to/the/file.pdf");
+ // // $nme = "sample_file.pdf";
+ // // force_download($nme, $pth);
+ // $output_file = $this->external_path ."/tmp/".$value['pd_document_name'];
+ // file_put_contents($output_file, $singed_uri);
+ // }
+
}
}
diff --git a/api/application/views/report_templates/JSONTOREPORT_FI_OV_DI.php b/api/application/views/report_templates/JSONTOREPORT_FI_OV_DI.php
index 7c63dff6..42afa6c0 100644
--- a/api/application/views/report_templates/JSONTOREPORT_FI_OV_DI.php
+++ b/api/application/views/report_templates/JSONTOREPORT_FI_OV_DI.php
@@ -306,7 +306,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
$value = $general_form['json'];
$all_applicant_details = $applicants_details;
if (strtoupper($value['is_person_met']) == 'YES') {
- echo '' . 'Applicant (' . $value['Name_of_the_Person_met_master'] . ') was met at the visited address.' . '
';
+ echo '' . 'Applicant (' . isset($value['Name_of_the_Person_met_master']) ? $value['Name_of_the_Person_met_master'] : $value['Name_of_the_Person_met'] . ') was met at the visited address.' . '
';
} else if (strtoupper($value['is_person_met']) == 'NO') {
echo '' . '(' . $value['Name_of_the_Person'] . ') (' . $value['designation_person_met_master'] . ') was met at the visited address during visit.' . '
';
}
@@ -321,7 +321,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
echo '
';
$address_form = json_decode($pd_processed_forms[28][0]['processed_json'], true);
$address_value = $address_form['json'];
- // print_r($address_value);
+ // print_r($address_value);die();
if (!empty($address_value)) {
echo 'ADDRESS DETAILS:
';
if (strtoupper($address_value['is_pd_done_on_initiated_address']) == 'YES') {
@@ -334,7 +334,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
Address Where Visit was actually done: ' . $address_value['actual_pd_address'] . ' , ' . $address_value['city2_master'] . ' , ' . $address_value['state2_master'] . ' , ' . $address_value['pincode2_master'] . '.
Reason for change in Visit address: ' . $address_value['end_use'] . '.
';
}
- echo '' . 'The Field Visit was done at ' . $address_value['address_type_master'] . ' of the loan applicants. The ' . $address_value['address_type_master'] . ' is located in a ' . $address_value['locality_master'] . ' and the estimated area of the ' . $address_value['address_type_master'] . ' is ' . $address_value['uom_master'] . '. The location was ' . $address_value['Approach_to_PD_location'] . '. As Per Officer, the ' . $address_value['address_type_master'] . ' is situated in a ' . $address_value['comment_locality_master'] . ' Locality. ' . '
';
+ echo '' . 'The Field Visit was done at ' . $address_value['address_type_master'] . ' of the loan applicants. The ' . $address_value['address_type_master'] . ' is located in a ' . $address_value['locality_master'] . ' and the estimated area of the ' . $address_value['address_type_master'] . ' is ' .$address_value['estimated_area'].' '. $address_value['uom_master'] . '. The location was ' . $address_value['pd_location_master'] . '. As Per Officer, the ' . $address_value['address_type_master'] . ' is situated in a ' . $address_value['comment_locality_master'] . ' Locality. ' . '
';
}
?>
diff --git a/api/application/views/report_templates/JSONTOREPORT_FI_OV_SAL.php b/api/application/views/report_templates/JSONTOREPORT_FI_OV_SAL.php
index 1c07b5fd..9747c894 100644
--- a/api/application/views/report_templates/JSONTOREPORT_FI_OV_SAL.php
+++ b/api/application/views/report_templates/JSONTOREPORT_FI_OV_SAL.php
@@ -306,7 +306,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
$value = $general_form['json'];
$all_applicant_details = $applicants_details;
if (strtoupper($value['is_person_met']) == 'YES') {
- echo '' . 'Applicant (' . $value['Name_of_the_Person_met_master'] . ') was met at the visited address.' . '
';
+ echo '' . 'Applicant (' . isset($value['Name_of_the_Person_met_master']) ? $value['Name_of_the_Person_met_master'] : $value['Name_of_the_Person_met'] . ') was met at the visited address.' . '
';
} else if (strtoupper($value['is_person_met']) == 'NO') {
echo '' . 'During PD (' . $value['Name_of_the_Person'] . ') (' . $value['designation_person_met_master'] . ') was met at the visited address during visit.' . '
';
}
@@ -321,6 +321,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
echo '
';
$address_form = json_decode($pd_processed_forms[28][0]['processed_json'], true);
$address_value = $address_form['json'];
+ // print_r($address_value);die();
if (!empty($address_value)) {
echo 'ADDRESS DETAILS:
';
if (strtoupper($address_value['is_pd_done_on_initiated_address']) == 'YES') {
diff --git a/api/application/views/report_templates/JSONTOREPORT_FI_RV.php b/api/application/views/report_templates/JSONTOREPORT_FI_RV.php
index 3689fce1..8f36bd3c 100644
--- a/api/application/views/report_templates/JSONTOREPORT_FI_RV.php
+++ b/api/application/views/report_templates/JSONTOREPORT_FI_RV.php
@@ -306,7 +306,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
$value = $general_form['json'];
$all_applicant_details = $applicants_details;
if (strtoupper($value['is_person_met']) == 'YES') {
- echo '' . 'Applicant (' . $value['Name_of_the_Person_met_master'] . ') was met at the visited address.' . '
';
+ echo '' . 'Applicant (' . isset($value['Name_of_the_Person_met_master']) ? $value['Name_of_the_Person_met_master'] : $value['Name_of_the_Person_met'] . ') was met at the visited address.' . '
';
} else if (strtoupper($value['is_person_met']) == 'NO') {
echo '' . '(' . $value['Name_of_the_Person'] . ') (' . $value['designation_person_met_master'] . ') was met at the visited address during visit.' . '
';
}
@@ -321,6 +321,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
echo '
';
$address_form = json_decode($pd_processed_forms[28][0]['processed_json'], true);
$address_value = $address_form['json'];
+ // print_r($address_value);die();
if (!empty($address_value)) {
echo 'ADDRESS DETAILS:
';
if (strtoupper($address_value['is_pd_done_on_initiated_address']) == 'YES') {
@@ -333,7 +334,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
Address Where Visit was actually done: ' . $address_value['actual_pd_address'] . ' , ' . $address_value['city2_master'] . ' , ' . $address_value['state2_master'] . ' , ' . $address_value['pincode2_master'] . '.
Reason for change in Visit address: ' . $address_value['end_use'] . '.';
}
- echo '' . 'The Field Visit was done at ' . $address_value['address_type_master'] . ' of the loan applicants. The ' . $address_value['address_type_master'] . ' is located in a ' . $address_value['locality_master'] . ' and the estimated area of the ' . $address_value['address_type_master'] . ' is ' . $address_value['uom_master'] . '. The location was ' . $address_value['Approach_to_PD_location'] . '. As Per Officer, the ' . $address_value['address_type_master'] . ' is situated in a ' . $address_value['comment_locality_master'] . ' Locality. ' . '
';
+ echo '' . 'The Field Visit was done at ' . $address_value['address_type_master'] . ' of the loan applicants. The ' . $address_value['address_type_master'] . ' is located in a ' . $address_value['locality_master'] . ' and the estimated area of the ' . $address_value['address_type_master'] . ' is ' .$address_value['estimated_area'].' '. $address_value['uom_master'] . '. The location was ' . $address_value['pd_location_master'] . '. As Per Officer, the ' . $address_value['address_type_master'] . ' is situated in a ' . $address_value['comment_locality_master'] . ' Locality. ' . '
';
}
?>