From 3297edbc52bb7e2fa28c7cd325b2b713aed78c02 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 7 Jun 2023 12:55:07 +0530 Subject: [PATCH] Flyhi Satellite fixes : ps --- .../controllers/Flyhi_Controller.php | 27 ++++++++++++++++--- .../views/sale_pd_templates/DemoFSL.php | 2 +- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/api/application/controllers/Flyhi_Controller.php b/api/application/controllers/Flyhi_Controller.php index a2d9e61e..3f47335f 100644 --- a/api/application/controllers/Flyhi_Controller.php +++ b/api/application/controllers/Flyhi_Controller.php @@ -760,12 +760,21 @@ class Flyhi_Controller extends REST_Controller { $view_data['section9'] = $this->Flyhi_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $pd_id,'img_name !=' => 'satellite','isactive' => 1),SALEPD_DOCS); $view_data['product_id'] = $flyhipd_data[0]['product_id']; $view_data['geo_location'] = $flyhipd_data[0]['geo_location']; - $view_data['satellite_image'] = $this->Flyhi_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $pd_id,'img_name' => 'satellite','isactive' => 1),SALEPD_DOCS); + + $satellite_image = $this->Flyhi_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $pd_id,'img_name' => 'satellite','isactive' => 1),SALEPD_DOCS); + if(!empty($satellite_image)){ // checking Entity Available or not + $bucket_name = LENDER_BUCKET_NAME_PREFIX.$flyhipd_data[0]['lender_id']; + $bucket_key = "sales_pd/".$flyhipd_data[0]['sales_pd_id']."/images/satellite.png"; + $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name, $bucket_key,'30 minutes'); + $img_url = 'data:image/gif;base64,'.$singed_uri; + $view_data['satellite_image'] = $img_url; + }else{ $view_data['satellite_image'] = ""; } + // $view_data['satellite_image'] = $this->Flyhi_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $pd_id,'img_name' => 'satellite','isactive' => 1),SALEPD_DOCS); // die(); //$view_name = $flyhipd_data[0]['short_name'].'_'.$flyhipd_data[0]['abbr']; $view_name = $flyhipd_data[0]['short_name']; $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"); //End of PDF Gen using DOM PDF $output_file = $this->external_path ."/sales_pd/" .$pd_id. "/temp.pdf"; @@ -1814,7 +1823,9 @@ class Flyhi_Controller extends REST_Controller { if(!empty($_FILES['video_file'])) { $pd_master_details = $this->Flyhi_Model->selectCustomRecords(array('*'),array('sales_pd_id' => $records['pd_id']),SALES_PD_DATA); - $bucketname = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['lender_id']; + // $bucketname = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['lender_id']; + $old_bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id']; + $new_bucket_name = TWILIO_CONTENT_BUCKET_NAME; $key = 'pd'.$records['pd_id'].'/video/'.$records['filename']; $file_name_wo_extension = explode('.', ($records['filename']))[0]; $file_type = explode('/', ($_FILES['video_file']['type']))[1]; @@ -2623,4 +2634,14 @@ $this->load->view("digital_locker",$view_data); // header('Content-Type: application/pdf'); // readfile($tofile); } +// function dummy_get(){ +// echo getenv('TEST.S3_RESOURCE_KEY'); +// echo "\n"; +// echo getenv('TEST.S3_RESOURCE_SECRET'); +// echo "\n"; +// echo($this->config->item('s3_resource_key')); +// echo "\n"; +// echo($this->config->item('s3_resource_secret')); + +// } }// Class Ends diff --git a/api/application/views/sale_pd_templates/DemoFSL.php b/api/application/views/sale_pd_templates/DemoFSL.php index 68a1cb65..02c7d641 100644 --- a/api/application/views/sale_pd_templates/DemoFSL.php +++ b/api/application/views/sale_pd_templates/DemoFSL.php @@ -390,7 +390,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
Satellite Image of PD Location

GPS Coordinates of location where PD Visit was done :

- PD Visted Location Satellite Image + PD Visted Location Satellite Image Due to location access not provided by loan applicant Geo coordinates on photographs and Satellite image of PD location is not shown

';} ?>