From a8a59f74e2c3bac5528b37126be3be0dbfcf7128 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Fri, 9 Jun 2023 19:00:08 +0530 Subject: [PATCH] Code committed : ps --- .../controllers/Flyhi_Controller.php | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/api/application/controllers/Flyhi_Controller.php b/api/application/controllers/Flyhi_Controller.php index 4d847901..0b3111cd 100644 --- a/api/application/controllers/Flyhi_Controller.php +++ b/api/application/controllers/Flyhi_Controller.php @@ -257,14 +257,11 @@ class Flyhi_Controller extends REST_Controller { // ----END OF FILTERING THE LAST 10 DAYS RECORDS--- $pd_lender = $this->getUserAndItsLender(); - $FHFSL_lender = (ENVIRONMENT == 'production' ? 19 : 31); - + $where_condition_array['SALES_PD_DATA.lender_id'] = $pd_lender; + if($user_id && is_numeric($user_id)) { $where_condition_array['SALES_PD_DATA.createdby'] = $user_id; } - - if($pd_lender == $FHFSL_lender) $where_condition_array['SALES_PD_DATA.sales_pd_type in (3,4)'] = null; - else $where_condition_array['SALES_PD_DATA.sales_pd_type in (5)'] = null; $order_by = 'SALES_PD_DATA.sales_pd_id'; $Flyhi_pd_data = $this->Flyhi_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC','',$or_where); @@ -456,9 +453,9 @@ class Flyhi_Controller extends REST_Controller { else if($flyhipd_data[0]['sales_pd_type'] == 4){$pd_type = "Residence FI PD-";} else $pd_type = "Demo PD-"; - // print_r($flyhipd_data);die(); - if($flyhipd_data) - // if(1) + // print_r($flyhipd_data);die();// working fine .. + // if($flyhipd_data) + if(1) { ini_set('max_execution_time', 0); $bucket_name = LENDER_BUCKET_NAME_PREFIX.$flyhipd_data[0]['lender_id']; @@ -476,14 +473,13 @@ class Flyhi_Controller extends REST_Controller { } $all_section_data = $this->Flyhi_Model->selectCustomRecords(array('*'),array('sales_pd_id' => $pd_id,'isactive' => 1),SALESPD_SECTION_DATA,array(),'','section_id','ASC'); - // print_r($all_section_data);die(); - if(!$flyhipd_data[0]['is_pdf'] || $flyhipd_data[0]['is_edited']) - // if(1) + // print_r($all_section_data); + // if(!$flyhipd_data[0]['is_pdf'] || $flyhipd_data[0]['is_edited']) + if(1) { $all_section_data = $this->Flyhi_Model->selectCustomRecords(array('*'),array('sales_pd_id' => $pd_id,'isactive' => 1),SALESPD_SECTION_DATA,array(),'','section_id','ASC'); - - // print_r(json_decode($all_section_data[0]['json'],true));die(); + // print_r(json_decode($all_section_data[0]['json'],true));die(); $view_data['master'] = $flyhipd_data; $common_fields = array('pdid'=>$flyhipd_data[0]['sales_pd_id'], // 'product'=>$flyhipd_data[0]['abbr'], @@ -516,8 +512,11 @@ class Flyhi_Controller extends REST_Controller { $satellite_image = $this->Flyhi_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $pd_id,'img_name' => 'satellite','isactive' => 1),SALEPD_DOCS); $bucket_name = LENDER_BUCKET_NAME_PREFIX.$flyhipd_data[0]['lender_id']; $bucket_key = "sales_pd/".$flyhipd_data[0]['sales_pd_id']."/images/satellite.png"; + log_message('ERROR','#### PREPARE REPORT CALLED bucket_name'.$bucket_name); + log_message('ERROR','#### PREPARE REPORT CALLED bucket_key'.$bucket_key); $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name, $bucket_key,'30 minutes'); $view_data['satellite_image'] = $singed_uri; + log_message('ERROR','#### PREPARE REPORT CALLED st image uri '.$singed_uri); // $view_data['satellite_image'] = $this->Flyhi_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $pd_id,'img_name' => 'satellite','isactive' => 1),SALEPD_DOCS); //$view_name = $flyhipd_data[0]['short_name'].'_'.$flyhipd_data[0]['abbr']; $view_name = $flyhipd_data[0]['short_name']; @@ -530,7 +529,7 @@ class Flyhi_Controller extends REST_Controller { //echo $bytes; //die(); $bucket_data = array('bucket_name'=>$bucket_name,'key'=>$key,'sourcefile'=>$this->external_path.'/sales_pd/'.$pd_id.'/temp.pdf'); - log_message('ERROR','#### '.$pd_type.' REPORT UPLOAD TO S3'.$pd_id); + log_message('ERROR','#### '.$pd_type.'REPORT UPLOAD TO S3'.$pd_id); $s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data); if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) @@ -539,6 +538,7 @@ class Flyhi_Controller extends REST_Controller { $this->Flyhi_Model->updateRecords(array('is_pdf' => 1, 'is_edited' => 0),SALES_PD_DATA,array('sales_pd_id' => $pd_id)); if($api) { + log_message('ERROR','#### PREPARE REPORT CALLED Report Key '.$key); $_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'30 minutes'); $headers = @get_headers($_uri); if($headers && strpos( $headers[0], '200')) { @@ -1346,13 +1346,14 @@ class Flyhi_Controller extends REST_Controller { if($g_key == 'applicant_name'){ $applicant_name = (!empty($g_value)) ? $g_value : null ; } + $flyhi_pd_type = 5; // default demo Type if($g_key == 'verification_type' && $g_value == 'Residence verification'){ $flyhi_pd_type = 4; } - else if($g_key == 'verification_type' && $g_value == 'Office verification'){ + if($g_key == 'verification_type' && $g_value == 'Office verification'){ $flyhi_pd_type = 3; } - else $flyhi_pd_type = 5; + if($g_key == 'Same_as_current_residence_address' && $g_value == 'NO'){ $current_resd_addr_check = 1; }