From 14ce6cc8ca9d76a086cc0a4dfaf3000a31d05d40 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Mon, 16 May 2022 15:32:52 +0530 Subject: [PATCH 01/19] CET credit PD 1 : ps --- api/application/config/constants.php | 7 +- api/application/config/routes.php | 3 +- .../controllers/SMC_Credit_PD_Controller.php | 42 +++++++++--- .../controllers/Sales_PD_Controller.php | 14 ++-- .../helpers/authorization_helper.php | 2 +- .../helpers/cet_creditpd_helper.php | 67 +++++++++++++++++++ ...tapp_helper.php => cet_salespd_helper.php} | 2 +- 7 files changed, 116 insertions(+), 21 deletions(-) create mode 100644 api/application/helpers/cet_creditpd_helper.php rename api/application/helpers/{salespd_cetapp_helper.php => cet_salespd_helper.php} (99%) diff --git a/api/application/config/constants.php b/api/application/config/constants.php index 8d1d5487..c965fff3 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -95,6 +95,7 @@ defined('ROUTE_LOGIN_W') OR define('ROUTE_LOGIN_W', 'saveSalesPDImage'); defined('ROUTE_LOGIN_V') OR define('ROUTE_LOGIN_V', 'generateSatelliteImg'); // no errors defined('ROUTE_LOGIN_U') OR define('ROUTE_LOGIN_U', 'generateOTP'); defined('ROUTE_LOGIN_T') OR define('ROUTE_LOGIN_T', 'verifyOTP'); +defined('ROUTE_LOGIN_C') OR define('ROUTE_LOGIN_C', 'getCreditPDReportforCETApp'); defined('ROUTE_LOGIN_B') OR define('ROUTE_LOGIN_B', 'getSalesPDReportforCETApp'); defined('ROUTE_LOGIN_A') OR define('ROUTE_LOGIN_A', 'getAuditedImages'); // no errors defined('TURN_SERVER_API') OR define('TURN_SERVER_API', 'getServerInfo'); // no errors @@ -124,7 +125,8 @@ defined('OPTIMIZED_IMAGE_BUCKET_NAME') OR define('OPTIMIZED_IMAGE_BUCKET_NAME',' defined('IMAGE_OPTIMIZE_LAMBDA_URL') OR define('IMAGE_OPTIMIZE_LAMBDA_URL','https://wlaax92nne.execute-api.ap-south-1.amazonaws.com/demo'); defined('VIDEO_SHORT_URL') OR define('VIDEO_SHORT_URL','https://lkt.pdgenie.com/'); defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); -defined('CET_CREDIT_PD_INTEGRATION_URL') OR define('CET_CREDIT_PD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); +defined('CET_CREDIT_PD_INTEGRATION_URL') OR define('CET_CREDIT_PD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdData'); +defined('CET_CREDIT_PD_IMG_INTEGRATION_URL') OR define('CET_CREDIT_PD_IMG_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullCreditPdPhotographsData'); } else if(ENVIRONMENT == 'testing') { @@ -144,7 +146,8 @@ else if(ENVIRONMENT == 'testing') defined('IMAGE_OPTIMIZE_LAMBDA_URL') OR define('IMAGE_OPTIMIZE_LAMBDA_URL','https://wlaax92nne.execute-api.ap-south-1.amazonaws.com/demo'); defined('VIDEO_SHORT_URL') OR define('VIDEO_SHORT_URL','https://lkt.pdgenie.com/'); defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); - defined('CET_CREDIT_PD_INTEGRATION_URL') OR define('CET_CREDIT_PD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); + defined('CET_CREDIT_PD_INTEGRATION_URL') OR define('CET_CREDIT_PD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdData'); + defined('CET_CREDIT_PD_IMG_INTEGRATION_URL') OR define('CET_CREDIT_PD_IMG_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullCreditPdPhotographsData'); } else if(ENVIRONMENT == 'production') { diff --git a/api/application/config/routes.php b/api/application/config/routes.php index eeeee154..3b03b974 100755 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -365,4 +365,5 @@ $route['getRequestForDataDump'] = 'Request_DataDump_Controller/getRequestForData $route['GC_addEvent'] = 'GC_Event_Controller/addEvent'; $route['GC_eventList'] = 'GC_Event_Controller/eventList'; -$route['getSalesPDReportforCETApp'] = 'Sales_PD_Controller/getSalesPDReportforCETApp'; \ No newline at end of file +$route['getSalesPDReportforCETApp'] = 'Sales_PD_Controller/getSalesPDReportforCETApp'; +$route['getCreditPDReportforCETApp'] = 'SMC_Credit_PD_Controller/getCreditPDReportforCETApp'; \ No newline at end of file diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 5b444ce5..c42899b7 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -24,8 +24,7 @@ class SMC_Credit_PD_Controller extends REST_Controller { $this->load->library('pdfgenerator'); $this->load->helper('satellite_image'); $this->load->library('phpmailer_library'); - - + $this->load->helper('cet_creditpd'); } public function loadSalesPDTemplate_post() @@ -168,7 +167,6 @@ class SMC_Credit_PD_Controller extends REST_Controller { $where_condition_array = array('SMC_CREDIT_PD.smc_credit_pd' => $smc_credit_pd); $SMC_CREDIT_PD = $this->SMC_Credit_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array); - if($SMC_CREDIT_PD) { ini_set('max_execution_time', 0); @@ -1522,13 +1520,17 @@ public function filterSalesPDList_post() { { $records = $this->post('records'); $this->load->helper('smc_creditpd'); + $this->load->helper('cet_creditpd'); $this->load->helper('smcpdscore'); - + + $view_data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($records['pd_id']); $view_data['applicant_details'] = $this->PD_Model->getApplicantsDetails($records['pd_id']); //$pd_section_data = $this->SMC_Credit_PD_Model->selectCustomRecords(array('*'),array('isactive' => 1,'fk_pd_id' => $records['pd_id']),SMC_CREDIT_PD_SECTION_DATA,array(),'','fk_form_id','ASC'); $pd_section_data = $this->SMC_Credit_PD_Model->getSMCTemplateForPD($records['pd_id'],$view_data['pd_master_details'][0]['fk_product_id'],null,null,'REPORT'); - // print_r ($view_data['pd_master_details']);die(); + $common_fields = array('pdid'=>$view_data['pd_master_details'][0]['pd_id'], + 'product'=>$view_data['pd_master_details'][0]['product_abbr'], + 'caseno'=>$view_data['pd_master_details'][0]['pd_sno']); // print_r($pd_section_data);die(); $forms_data_to_be_get_direct_from_excel_sheet = array(3,9,10,15); @@ -1546,7 +1548,8 @@ public function filterSalesPDList_post() { // if($value['fk_form_id'] == 2){print_r($value['json']);die();} $view_data['pd_section_data'][$value['fk_form_id']] = $value['json']; - // $CETAPP_creditPD_data[$value['form_name']] = $value['json']; + $CETAPP_creditPD_data[$value['form_name']] = $value['json']; + // $CETAPP_creditPD_data[$value['fk_form_id']] = $value['json']; } else { @@ -1556,7 +1559,8 @@ public function filterSalesPDList_post() { $data_from_excel = $this->loadDataFromExcelBusiProcess($view_data['pd_master_details'],$value['fk_form_id']); //print_r($data_from_excel);die(); $view_data['pd_section_data'][$value['fk_form_id']] = $data_from_excel; - // $CETAPP_creditPD_data[$value['form_name']] = $data_from_excel; + $CETAPP_creditPD_data[$value['form_name']] = $data_from_excel; + // $CETAPP_creditPD_data[$value['fk_form_id']]= $data_from_excel; } } @@ -1637,10 +1641,11 @@ public function filterSalesPDList_post() { } } $view_data['pd_section_data'][5]['key_stakeholders'] = $temp_arr; - // $CETAPP_creditPD_data['Key Stakeholders in Business']['key_stakeholders'] = $temp_arr; + $CETAPP_creditPD_data['Key Stakeholders in Business']['key_stakeholders'] = $temp_arr; + // $CETAPP_creditPD_data[5]['key_stakeholders'] = $temp_arr; }// ### LFMP key_stakeholders ends // log_message('ERROR',"SUSEEN".json_encode($CETAPP_creditPD_data));die(); - + cet_creditpd::pushwithcetcreditpdapi($common_fields,$CETAPP_creditPD_data);die(); if($view_data['pd_master_details'][0]['product_abbr'] == "NBFC/MFI"){ $html_content = $this->load->view('smc_creditpd_reports/NBFC',$view_data,true); }else{ @@ -1860,6 +1865,25 @@ public function filterSalesPDList_post() { $this->response($data,REST_Controller::HTTP_OK); } + function getCreditPDReportforCETApp_get(){ + // 3090 + log_message('ERROR','## CreditPDReportforCETApp Fns Entered'); + $get = $this->get('credit_pd_id'); + if(!empty($get)){ + // $data['report'] = $this->prepareSalesPDReport($get); + // $statusMsg = 'Report Generated'; + $this->prepareSalesPDReport($get); + log_message('ERROR',"Credit Report Generated for CET App"); + }else{ + log_message('ERROR','Credit Report Not Available for CET App'); + $statusMsg = 'Report Not Available.'; + } + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['msg'] = $statusMsg; + $this->response($data,REST_Controller::HTTP_OK); + } + } \ No newline at end of file diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index 4a9c83ed..970cfd31 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -9,7 +9,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - require_once APPPATH . '/libraries/REST_Controller.php'; +require_once APPPATH . '/libraries/REST_Controller.php'; include_once APPPATH.'/vendor/autoload.php'; @@ -26,7 +26,7 @@ class Sales_PD_Controller extends REST_Controller { $this->load->helper('satellite_image'); $this->load->helper('camunda'); $this->load->library('phpmailer_library'); - $this->load->helper('salespd_cetapp'); + $this->load->helper('cet_salespd'); } @@ -224,7 +224,7 @@ class Sales_PD_Controller extends REST_Controller { $img_split = explode( ',', $view_data['section9'][$i]['img']); $img_fields['img'] = $img_split[1]; // $img_fields[0]['img'] = $view_data['section9'][$i]['img']; - salespd_cetapp::pushwithcetphotographapi($img_fields,$i); + cet_salespd::pushwithcetphotographapi($img_fields,$i); } // "section9":{"selfie_with_person_met":"SAVED","approach_to_pd_location":["SAVED",""],"name_board_seen":["SAVED",""],"stock_image":["SAVED","SAVED","SAVED","SAVED",""],"workplace_interior_image":["SAVED","SAVED",""]}} // $arr1 =array();$arr2 =array(); @@ -240,13 +240,13 @@ class Sales_PD_Controller extends REST_Controller { // } //} } - salespd_cetapp::pushwithcetsalespdapi($common_fields,$section_fields,1); + cet_salespd::pushwithcetsalespdapi($common_fields,$section_fields,1); $view_data['satellite_image'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name' => 'satellite','isactive' => 1),SALEPD_DOCS); if(!empty($view_data['satellite_image'])){ $stt_fields = $common_fields; $stt_fields['img_name'] = $view_data['satellite_image'][0]['img_name']; $stt_fields['img'] = $view_data['satellite_image'][0]['img']; - salespd_cetapp::pushwithcetphotographapi($stt_fields); + cet_salespd::pushwithcetphotographapi($stt_fields); } $view_data['product_id'] = $sales_pd_data[0]['product_id']; $view_data['geo_location'] = $sales_pd_data[0]['geo_location']; @@ -1380,9 +1380,9 @@ public function filterSalesPDList_post() { $get = $this->get('sales_pd_id'); if(!empty($get)){ $this->prepareSalesPDReport($get); - log_message('ERROR',"Report Generated for CET App"); + log_message('ERROR',"Sales Report Generated for CET App"); }else{ - log_message('ERROR','Report Not Available for CET App'); + log_message('ERROR','Sales Report Not Available for CET App'); $statusMsg = 'Report Not Available.'; } $data['dataStatus'] = true; diff --git a/api/application/helpers/authorization_helper.php b/api/application/helpers/authorization_helper.php index 63988167..be6c69fb 100644 --- a/api/application/helpers/authorization_helper.php +++ b/api/application/helpers/authorization_helper.php @@ -72,7 +72,7 @@ class AUTHORIZATION } - if( $routingName == ROUTE_LOGIN_X || $routingName == ROUTE_LOGIN_Y || $routingName == ROUTE_LOGIN_Z || $routingName == ROUTE_LOGIN_W || $routingName == ROUTE_LOGIN_V || $routingName == ROUTE_LOGIN_A || $routingName == TURN_SERVER_API || $routingName == VIDEO_CHAT_ACCESS_KEY_API || $routingName ==SAVEROOMINFO_API || $routingName ==SAVESMCCREDITPDIMAGE_API || $routingName ==GETSMCPDIMGSECTIONDATA_API || $routingName == ROUTE_LOGIN_T || $routingName == ROUTE_LOGIN_U || $routingName == ROUTE_LOGIN_B) + if( $routingName == ROUTE_LOGIN_X || $routingName == ROUTE_LOGIN_Y || $routingName == ROUTE_LOGIN_Z || $routingName == ROUTE_LOGIN_W || $routingName == ROUTE_LOGIN_V || $routingName == ROUTE_LOGIN_A || $routingName == TURN_SERVER_API || $routingName == VIDEO_CHAT_ACCESS_KEY_API || $routingName ==SAVEROOMINFO_API || $routingName ==SAVESMCCREDITPDIMAGE_API || $routingName ==GETSMCPDIMGSECTIONDATA_API || $routingName == ROUTE_LOGIN_T || $routingName == ROUTE_LOGIN_U || $routingName == ROUTE_LOGIN_B || $routingName == ROUTE_LOGIN_C) { return true; } diff --git a/api/application/helpers/cet_creditpd_helper.php b/api/application/helpers/cet_creditpd_helper.php new file mode 100644 index 00000000..bb85a2c2 --- /dev/null +++ b/api/application/helpers/cet_creditpd_helper.php @@ -0,0 +1,67 @@ +external_path.'/tmp/temp'. $index .date('Y-m-d_h-i-s') .'.png'; + $curlFile = curl_file_create($file); + $success = file_put_contents($file, $data); + $headers = array('Content-Type: multipart/form-data'); + // $headers = array('Content-Type: application/json'); + $ch = curl_init(); + $log_msg = " PullcreditPdPhotographsData api (".$fields['img_name'].")"; + $fields['img'] = $curlFile; + curl_setopt( $ch,CURLOPT_URL, CET_CREDIT_PD_IMG_INTEGRATION_URL); + curl_setopt( $ch,CURLOPT_POST, true ); + curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers ); + curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true ); + // curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, true ); + curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); + $result=curl_exec($ch); + $response = json_decode($result); + log_message('ERROR',"###CET APP PDID (".$pdid.") ".$log_msg."response :".json_encode($response)); + curl_close( $ch ); + unlink($file); + // unlink($file_name_with_full_path); + + } +} + +?> \ No newline at end of file diff --git a/api/application/helpers/salespd_cetapp_helper.php b/api/application/helpers/cet_salespd_helper.php similarity index 99% rename from api/application/helpers/salespd_cetapp_helper.php rename to api/application/helpers/cet_salespd_helper.php index 51b274e8..2c7367d7 100644 --- a/api/application/helpers/salespd_cetapp_helper.php +++ b/api/application/helpers/cet_salespd_helper.php @@ -1,6 +1,6 @@ Date: Mon, 16 May 2022 18:29:06 +0530 Subject: [PATCH 02/19] CET credit PD 2 : ps --- .../controllers/SMC_Credit_PD_Controller.php | 15 ++++++++++++ .../helpers/cet_creditpd_helper.php | 23 ++++++++++++------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index c42899b7..0adf66d6 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1570,6 +1570,21 @@ public function filterSalesPDList_post() { // print_r($view_data['pd_section_data'][15]);die(); $view_data['smc_images'] = $this->SMC_Credit_PD_Model->selectCustomRecords(array('doc_id', 'fk_smc_credit_pd_id','img','img_name','isactive'),array('fk_smc_credit_pd_id' => $records['pd_id'],'isactive' => 1,'img_name!=' => 'satellite'),SMC_CREDIT_PD_DOCS); $view_data['satellite'] = $this->SMC_Credit_PD_Model->selectCustomRecords(array('doc_id', 'fk_smc_credit_pd_id','img','img_name','isactive'),array('fk_smc_credit_pd_id' => $records['pd_id'],'isactive' => 1,'img_name=' => 'satellite'),SMC_CREDIT_PD_DOCS); + if(count($view_data['smc_images']>0)){ + for ($i = 0; $i < count($view_data['smc_images']); $i++){ + $img_fields = $common_fields; + $img_fields['img_name'] = $view_data['smc_images'][$i]['img_name']; + $img_split = explode( ',', $view_data['smc_images'][$i]['img']); + $img_fields['img'] = $img_split[1]; + // $img_fields[0]['img'] = $view_data['section9'][$i]['img']; + cet_creditpd::pushwithcetphotographapi($img_fields,$i); + }} + if(!empty($view_data['satellite'])){ + $stt_fields = $common_fields; + $stt_fields['img_name'] = $view_data['satellite'][0]['img_name']; + $stt_fields['img'] = $view_data['satellite'][0]['img']; + cet_creditpd::pushwithcetphotographapi($stt_fields,0); + } // print_r($view_data['smc_images']);die(); //print_r(count($view_data['smc_images']));die(); diff --git a/api/application/helpers/cet_creditpd_helper.php b/api/application/helpers/cet_creditpd_helper.php index bb85a2c2..2dc1579a 100644 --- a/api/application/helpers/cet_creditpd_helper.php +++ b/api/application/helpers/cet_creditpd_helper.php @@ -8,16 +8,23 @@ class CET_CREDITPD public static function pushwithcetcreditpdapi($fields,$data) { log_message('ERROR','#### Inside cet creditpd helper fns'); - // if(array_key_exists("Photograph's",$data)){ - // unlink($data["Photograph's"]); - // } + if (array_key_exists("Photograph's", $data)) { + unset($data["Photograph's"]); + } + $key_check = array("Supplier details","Clients details","Stock details", "Neighbourhood Details", "Existing Loan Obligations","Business Assets"); + for($i=0;$i Date: Tue, 17 May 2022 13:07:06 +0530 Subject: [PATCH 03/19] cet api 3 :ps --- api/application/config/constants.php | 16 +++++---- .../controllers/SMC_Credit_PD_Controller.php | 2 +- .../helpers/cet_creditpd_helper.php | 2 +- .../helpers/cet_salespd_helper.php | 34 ++++++++++++++----- 4 files changed, 38 insertions(+), 16 deletions(-) diff --git a/api/application/config/constants.php b/api/application/config/constants.php index c965fff3..16396452 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -124,9 +124,10 @@ defined('PDF_ATTACHEMENT_URL') OR define('PDF_ATTACHEMENT_URL','https://apitest. defined('OPTIMIZED_IMAGE_BUCKET_NAME') OR define('OPTIMIZED_IMAGE_BUCKET_NAME','optimized-images-demo'); defined('IMAGE_OPTIMIZE_LAMBDA_URL') OR define('IMAGE_OPTIMIZE_LAMBDA_URL','https://wlaax92nne.execute-api.ap-south-1.amazonaws.com/demo'); defined('VIDEO_SHORT_URL') OR define('VIDEO_SHORT_URL','https://lkt.pdgenie.com/'); -defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); +defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdData'); +defined('CET_SALESPD_INTEGRATION_IMG_URL') OR define('CET_SALESPD_INTEGRATION_IMG_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); defined('CET_CREDIT_PD_INTEGRATION_URL') OR define('CET_CREDIT_PD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdData'); -defined('CET_CREDIT_PD_IMG_INTEGRATION_URL') OR define('CET_CREDIT_PD_IMG_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullCreditPdPhotographsData'); +defined('CET_CREDIT_PD_INTEGRATION_IMG_URL') OR define('CET_CREDIT_PD_INTEGRATION_IMG_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdPhotographsData'); } else if(ENVIRONMENT == 'testing') { @@ -145,9 +146,10 @@ else if(ENVIRONMENT == 'testing') defined('OPTIMIZED_IMAGE_BUCKET_NAME') OR define('OPTIMIZED_IMAGE_BUCKET_NAME','optimized-images-demo'); defined('IMAGE_OPTIMIZE_LAMBDA_URL') OR define('IMAGE_OPTIMIZE_LAMBDA_URL','https://wlaax92nne.execute-api.ap-south-1.amazonaws.com/demo'); defined('VIDEO_SHORT_URL') OR define('VIDEO_SHORT_URL','https://lkt.pdgenie.com/'); - defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); + defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdData'); + defined('CET_SALESPD_INTEGRATION_IMG_URL') OR define('CET_SALESPD_INTEGRATION_IMG_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); defined('CET_CREDIT_PD_INTEGRATION_URL') OR define('CET_CREDIT_PD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdData'); - defined('CET_CREDIT_PD_IMG_INTEGRATION_URL') OR define('CET_CREDIT_PD_IMG_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullCreditPdPhotographsData'); + defined('CET_CREDIT_PD_INTEGRATION_IMG_URL') OR define('CET_CREDIT_PD_INTEGRATION_IMG_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdPhotographsData'); } else if(ENVIRONMENT == 'production') { @@ -166,8 +168,10 @@ else if(ENVIRONMENT == 'production') defined('OPTIMIZED_IMAGE_BUCKET_NAME') OR define('OPTIMIZED_IMAGE_BUCKET_NAME','optimized-images-live'); defined('IMAGE_OPTIMIZE_LAMBDA_URL') OR define('IMAGE_OPTIMIZE_LAMBDA_URL','https://4u9t03hvfb.execute-api.ap-south-1.amazonaws.com/live'); defined('VIDEO_SHORT_URL') OR define('VIDEO_SHORT_URL','https://l.pdgenie.com/'); - defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); - defined('CET_CREDIT_PD_INTEGRATION_URL') OR define('CET_CREDIT_PD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); + defined('CET_SALESPD_INTEGRATION_URL') OR define('CET_SALESPD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdData'); + defined('CET_SALESPD_INTEGRATION_IMG_URL') OR define('CET_SALESPD_INTEGRATION_IMG_URL','https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'); + defined('CET_CREDIT_PD_INTEGRATION_URL') OR define('CET_CREDIT_PD_INTEGRATION_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdData'); + defined('CET_CREDIT_PD_INTEGRATION_IMG_URL') OR define('CET_CREDIT_PD_INTEGRATION_IMG_URL','https://demo.devopsmcfinance.com/cet_creditpd/api/PullCreditPdPhotographsData'); } /*********************END of AWS resources Constants*************************************************/ diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 0adf66d6..8a44da51 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1570,7 +1570,7 @@ public function filterSalesPDList_post() { // print_r($view_data['pd_section_data'][15]);die(); $view_data['smc_images'] = $this->SMC_Credit_PD_Model->selectCustomRecords(array('doc_id', 'fk_smc_credit_pd_id','img','img_name','isactive'),array('fk_smc_credit_pd_id' => $records['pd_id'],'isactive' => 1,'img_name!=' => 'satellite'),SMC_CREDIT_PD_DOCS); $view_data['satellite'] = $this->SMC_Credit_PD_Model->selectCustomRecords(array('doc_id', 'fk_smc_credit_pd_id','img','img_name','isactive'),array('fk_smc_credit_pd_id' => $records['pd_id'],'isactive' => 1,'img_name=' => 'satellite'),SMC_CREDIT_PD_DOCS); - if(count($view_data['smc_images']>0)){ + if(count($view_data['smc_images'])>0){ for ($i = 0; $i < count($view_data['smc_images']); $i++){ $img_fields = $common_fields; $img_fields['img_name'] = $view_data['smc_images'][$i]['img_name']; diff --git a/api/application/helpers/cet_creditpd_helper.php b/api/application/helpers/cet_creditpd_helper.php index 2dc1579a..c4e07112 100644 --- a/api/application/helpers/cet_creditpd_helper.php +++ b/api/application/helpers/cet_creditpd_helper.php @@ -55,7 +55,7 @@ class CET_CREDITPD $ch = curl_init(); $log_msg = " PullcreditPdPhotographsData api (".$fields['img_name'].")"; $fields['img'] = $curlFile; - curl_setopt( $ch,CURLOPT_URL, CET_CREDIT_PD_IMG_INTEGRATION_URL); + curl_setopt( $ch,CURLOPT_URL, CET_CREDIT_PD_INTEGRATION_IMG_URL); curl_setopt( $ch,CURLOPT_POST, true ); curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers ); curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true ); diff --git a/api/application/helpers/cet_salespd_helper.php b/api/application/helpers/cet_salespd_helper.php index 2c7367d7..d6a2b51d 100644 --- a/api/application/helpers/cet_salespd_helper.php +++ b/api/application/helpers/cet_salespd_helper.php @@ -2,7 +2,7 @@ class CET_SALESPD { - public static function pushwithcetsalespdapi($fields,$data,$flag) + public static function pushwithcetsalespdapi_bkup($fields,$data,$flag) { log_message('ERROR','#### pushwithcetsalespdapi Helper FNS'); $fields['data'] = $data; @@ -44,12 +44,33 @@ class CET_SALESPD // log_message('ERROR',"result : ".json_encode($result)); curl_close( $ch ); - } + } + public static function pushwithcetsalespdapi($fields,$data,$flag) + { + log_message('ERROR','#### pushwithcetsalespdapi Helper FNS'); + $fields['data'] = $data; + $pdid = $fields['pdid']; + $headers = array('Content-Type: application/json'); + $ch = curl_init(); + $output_data = json_encode( $fields ); + // log_message('ERROR',"PullSalesPDData api Request Format : ".$output_data); + curl_setopt( $ch,CURLOPT_URL, CET_SALESPD_INTEGRATION_URL); + curl_setopt( $ch,CURLOPT_POST, true ); + curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers ); + curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true ); + curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, true ); + curl_setopt( $ch,CURLOPT_POSTFIELDS, $output_data); + $result = curl_exec($ch ); + $response = json_decode($result); + log_message('ERROR',"CET APP SALES PDID (".$pdid.") ".$log_msg."PullSalesPDData api response :".json_encode($response)); + curl_close( $ch ); + + } // multipart/form-data; public static function pushwithcetphotographapi($fields,$index) { - // log_message('ERROR','#### pushwithcetphotographapi Helper FNS'); + log_message('ERROR','#### pushwithcetphotographapi Helper FNS'); $CI =&get_instance(); $img = $fields['img']; $pdid = $fields['pdid']; @@ -63,10 +84,9 @@ class CET_SALESPD // $headers = array('Content-Type: application/json'); $ch = curl_init(); // $url = 'https://apitest.pdgenie.com/file_receive.php'; - $url = 'https://demo.devopsmcfinance.com/cet_salespd/api/PullSalesPdPhotographsData'; $log_msg = " PullSalesPdPhotographsData api (".$fields['img_name'].")"; $fields['img'] = $curlFile; - curl_setopt( $ch,CURLOPT_URL, $url); + curl_setopt( $ch,CURLOPT_URL, CET_SALESPD_INTEGRATION_IMG_URL); curl_setopt( $ch,CURLOPT_POST, true ); curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers ); curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true ); @@ -74,11 +94,9 @@ class CET_SALESPD curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); $result=curl_exec($ch); $response = json_decode($result); - log_message('ERROR',"###CET APP PDID (".$pdid.") ".$log_msg."response :".json_encode($response)); + log_message('ERROR',"###CET APP SALES PDID (".$pdid.") ".$log_msg."response :".json_encode($response)); curl_close( $ch ); unlink($file); - // unlink($file_name_with_full_path); - } } From 3702d4d36fadef5688a9e1640456d6fdf8901afc Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Tue, 17 May 2022 14:42:52 +0530 Subject: [PATCH 04/19] credit pd report api for cet app : ps --- .../controllers/SMC_Credit_PD_Controller.php | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 8a44da51..17350c5b 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1528,9 +1528,9 @@ public function filterSalesPDList_post() { $view_data['applicant_details'] = $this->PD_Model->getApplicantsDetails($records['pd_id']); //$pd_section_data = $this->SMC_Credit_PD_Model->selectCustomRecords(array('*'),array('isactive' => 1,'fk_pd_id' => $records['pd_id']),SMC_CREDIT_PD_SECTION_DATA,array(),'','fk_form_id','ASC'); $pd_section_data = $this->SMC_Credit_PD_Model->getSMCTemplateForPD($records['pd_id'],$view_data['pd_master_details'][0]['fk_product_id'],null,null,'REPORT'); - $common_fields = array('pdid'=>$view_data['pd_master_details'][0]['pd_id'], + $common_fields = array('pdid'=>111, 'product'=>$view_data['pd_master_details'][0]['product_abbr'], - 'caseno'=>$view_data['pd_master_details'][0]['pd_sno']); + 'caseno'=>'MWISE00840'); // print_r($pd_section_data);die(); $forms_data_to_be_get_direct_from_excel_sheet = array(3,9,10,15); @@ -1667,7 +1667,7 @@ public function filterSalesPDList_post() { $html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true); } - // echo $html_content;exit(); + exit(); $pdf_name = $view_data['pd_master_details'][0]['main_applicant']; $new_pdf_name = "PD_Report_".$view_data['pd_master_details'][0]['main_applicant']; @@ -1885,10 +1885,29 @@ public function filterSalesPDList_post() { log_message('ERROR','## CreditPDReportforCETApp Fns Entered'); $get = $this->get('credit_pd_id'); if(!empty($get)){ - // $data['report'] = $this->prepareSalesPDReport($get); - // $statusMsg = 'Report Generated'; - $this->prepareSalesPDReport($get); - log_message('ERROR',"Credit Report Generated for CET App"); + $pd_master_details = $this->PD_Model->getPDMasterDetails($get); + + $old_pdf_name = $pd_master_details[0]['main_applicant']; + $old_key = 'pd'.$records['pd_id'].'/pd_reports/'.$old_pdf_name.'.pdf'; + + $new_pdf_name = "PD_Report_".$pd_master_details[0]['main_applicant']; + $new_key = 'pd'.$records['pd_id'].'/pd_reports/'.$new_pdf_name.'.pdf'; + + $bucket_name = LENDER_BUCKET_NAME_PREFIX.(ENVIRONMENT == 'production' ? 7 : 35); + + $output_file = $this->external_path ."/pd_reports/" . $get . "/temp.pdf"; + + $_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$old_key,'30 minutes'); + + $headers = @get_headers($_uri); + if($headers && strpos( $headers[0], '200')) { + $singed_uri = $_uri; + }else { + $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$new_key,'30 minutes'); + } + $data['records'] = $singed_uri; + log_message('ERROR',"Credit Report Generated for CET App"); + $statusMsg = 'Report Available.'; }else{ log_message('ERROR','Credit Report Not Available for CET App'); $statusMsg = 'Report Not Available.'; From 985935f9efa9a19fe9946a224a460b56881c8789 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 17 May 2022 09:31:58 +0000 Subject: [PATCH 05/19] SMC_Credit_PD_Controller.php edited online with Bitbucket --- .../controllers/SMC_Credit_PD_Controller.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 17350c5b..bc304032 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1528,9 +1528,12 @@ public function filterSalesPDList_post() { $view_data['applicant_details'] = $this->PD_Model->getApplicantsDetails($records['pd_id']); //$pd_section_data = $this->SMC_Credit_PD_Model->selectCustomRecords(array('*'),array('isactive' => 1,'fk_pd_id' => $records['pd_id']),SMC_CREDIT_PD_SECTION_DATA,array(),'','fk_form_id','ASC'); $pd_section_data = $this->SMC_Credit_PD_Model->getSMCTemplateForPD($records['pd_id'],$view_data['pd_master_details'][0]['fk_product_id'],null,null,'REPORT'); - $common_fields = array('pdid'=>111, - 'product'=>$view_data['pd_master_details'][0]['product_abbr'], - 'caseno'=>'MWISE00840'); + //$common_fields = array('pdid'=>111, + // 'product'=>$view_data['pd_master_details'][0]['product_abbr'], + // 'caseno'=>'MWISE00840'); + $common_fields = array('pdid'=>$view_data['pd_master_details'][0]['pd_id'], + 'product'=>$view_data['pd_master_details'][0]['product_abbr'], + - 'caseno'=>$view_data['pd_master_details'][0]['pd_sno']); // print_r($pd_section_data);die(); $forms_data_to_be_get_direct_from_excel_sheet = array(3,9,10,15); @@ -1667,7 +1670,7 @@ public function filterSalesPDList_post() { $html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true); } - exit(); + // exit(); $pdf_name = $view_data['pd_master_details'][0]['main_applicant']; $new_pdf_name = "PD_Report_".$view_data['pd_master_details'][0]['main_applicant']; From 20a2cf0dfb5c9e726132367d7022dc27fc33bb94 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 17 May 2022 11:03:02 +0000 Subject: [PATCH 06/19] Credit_PD_report for cet : ps --- .../controllers/SMC_Credit_PD_Controller.php | 48 +++++++++++-------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index bc304032..fa38c5b0 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1889,28 +1889,34 @@ public function filterSalesPDList_post() { $get = $this->get('credit_pd_id'); if(!empty($get)){ $pd_master_details = $this->PD_Model->getPDMasterDetails($get); - - $old_pdf_name = $pd_master_details[0]['main_applicant']; - $old_key = 'pd'.$records['pd_id'].'/pd_reports/'.$old_pdf_name.'.pdf'; - - $new_pdf_name = "PD_Report_".$pd_master_details[0]['main_applicant']; - $new_key = 'pd'.$records['pd_id'].'/pd_reports/'.$new_pdf_name.'.pdf'; - - $bucket_name = LENDER_BUCKET_NAME_PREFIX.(ENVIRONMENT == 'production' ? 7 : 35); - - $output_file = $this->external_path ."/pd_reports/" . $get . "/temp.pdf"; - - $_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$old_key,'30 minutes'); - - $headers = @get_headers($_uri); - if($headers && strpos( $headers[0], '200')) { - $singed_uri = $_uri; - }else { - $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$new_key,'30 minutes'); + if($pd_master_details[0]['pd_status'] == "COMPLETED"){ + $old_pdf_name = $pd_master_details[0]['main_applicant']; + $old_key = 'pd'.$get.'/pd_reports/'.$old_pdf_name.'.pdf'; + + $new_pdf_name = "PD_Report_".$pd_master_details[0]['main_applicant']; + $new_key = 'pd'.$get.'/pd_reports/'.$new_pdf_name.'.pdf'; + + $bucket_name = LENDER_BUCKET_NAME_PREFIX.(ENVIRONMENT == 'production' ? 7 : 35); + + $output_file = $this->external_path ."/pd_reports/" . $get . "/temp.pdf"; + + $_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$old_key,'30 minutes'); + + $headers = @get_headers($_uri); + if($headers && strpos( $headers[0], '200')) { + $singed_uri = $_uri; + }else { + $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$new_key,'30 minutes'); + } + $data['records'] = $singed_uri; + log_message('ERROR',"Credit Report Generated for CET App"); + $statusMsg = 'Report Available.'; + }else{ + log_message('ERROR',"Credit Report Is Not Completed Given PDID"); + $statusMsg = 'Report is Not Completed For Given PDID.'; } - $data['records'] = $singed_uri; - log_message('ERROR',"Credit Report Generated for CET App"); - $statusMsg = 'Report Available.'; + + }else{ log_message('ERROR','Credit Report Not Available for CET App'); $statusMsg = 'Report Not Available.'; From 9fd82c836d6b724e3036805ed76114c7f5550199 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 18 May 2022 22:02:55 +0530 Subject: [PATCH 07/19] company name in mail : ps --- api/application/helpers/pdalerts_helper.php | 23 +++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index 8942e430..51a0fb8d 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -756,19 +756,19 @@ class PDALERTS $mail_id = $rcm_mail_id; } log_message('ERROR','#### MW AGENCY-MAIL CALLED TYPE 2(RCM and CM) PD ID :'.$pd_id." and MAIL : ".$mail_id); - $msg = "PD for Loan Application ID-".$core_details[0]['pd_sno']." ".$core_details[0]['applicant_name']." have been triggered to the vendor. "; - $subject = "PD allocated to vendor for application ID - ".$core_details[0]['pd_sno']." ".$core_details[0]['applicant_name']; + $msg = "PD for Loan Application ID-".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']."(".$core_details[0]['pd_sno'].")"." have been triggered to the vendor. "; + $subject = "PD allocated to vendor for application ID - ".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']."(".$core_details[0]['pd_sno'].")"; $ref_str = "vendor email id"; } if($flag == 1){ // Mail Content For - Agency ONLY $mail_id = $core_details[0]['agency_mail']; log_message('ERROR','#### MW AGENCY-MAIL CALLED TYPE 1(AGENCY) PD ID :'.$pd_id." and MAIL : ".$mail_id); - $msg = "PD for Loan Application ID - ".$core_details[0]['pd_sno']." ".$core_details[0]['applicant_name']." have been allocated to you. "; - $subject = "PD allocated for application ID - ".$core_details[0]['pd_sno']." ".$core_details[0]['applicant_name']; + $msg = "PD for Loan Application ID - ".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']."(".$core_details[0]['pd_sno'].") have been allocated to you. "; + $subject = "PD allocated for application ID - ".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']."(".$core_details[0]['pd_sno'].")"; $ref_str = "client email id"; } if($flag == 3){ // Mail Conent For - Allocated Person ONLY - $mail_id = $core_details[0]['allocated_email']; + // $mail_id = $core_details[0]['allocated_email']; log_message('ERROR','#### MW-AGENCY MAIL CALLED TYPE 3(Normal Allocated Person) PD ID : '.$pd_id." and MAIL : ".$mail_id); $CI->db->SELECT("*"); $CI->db->FROM(PDNOTIFICATIONMSG." as PDNOTIFICATIONMSG"); @@ -777,12 +777,12 @@ class PDALERTS $pd_notification_msg = $CI->db->GET()->result_array(); $msg = $pd_notification_msg[0]['lender']; $msg = self::stringReplace($msg,$core_details,'MAIL'); - $subject = "PD allocated for application ID - ".$core_details[0]['pd_sno']." ".$core_details[0]['applicant_name']; + $subject = "PD allocated for application ID - ".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']."(".$core_details[0]['pd_sno'].")"; $ref_str = ""; // $mail->addBCC("sanjeev.p@venbainfotech.com"); } - if(!empty($core_details[0]['excel_file_id']) && $core_details[0]['excel_file_id'] != null){ + // if(!empty($core_details[0]['excel_file_id']) && $core_details[0]['excel_file_id'] != null){ $CI->db->SELECT("PDAPPLICANTSDETAILS.applicant_name,PDAPPLICANTSDETAILS.mobile_no"); $CI->db->FROM(PDAPPLICANTSDETAILS." as PDAPPLICANTSDETAILS"); $CI->db->WHERE("PDAPPLICANTSDETAILS.fk_pd_id",$pd_id); @@ -799,10 +799,10 @@ class PDALERTS $company_name = "-"; $applicant_name = "-"; } - }else{ - $company_name = $core_details[0]['company_name'] ? $core_details[0]['company_name'] : "-"; - $applicant_name = $core_details[0]['applicant_name'] ? $core_details[0]['applicant_name'] : "-"; - } + // }else{ + // $company_name = $core_details[0]['company_name'] ? $core_details[0]['company_name'] : "-"; + // $applicant_name = $core_details[0]['applicant_name'] ? $core_details[0]['applicant_name'] : "-"; + // } // $company_name = $core_details[0]['company_name'] ? $core_details[0]['company_name'] : "-"; $msg .= "

1. Name of the firm : ".$company_name ."
2. Address : ".$core_details[0]['addressline1'].",".$core_details[0]['city_name'].",".$core_details[0]['state_name']."-".$core_details[0]['pincode']."." @@ -813,6 +813,7 @@ class PDALERTS if(!empty($ref_str)){ $msg .= "


This is an automatically generated notification mail. Please contact on ".$ref_str." for any queries/update. "; + // print_r($msg);die(); if(!empty($mail_id)){ $arg = array('mail'=>$mail_id,'pd_id'=>$pd_id,'msg'=>$msg,'subject'=>$subject); SELF::send_smcagencymail($CI,$arg); From 0f9db23eca6beb634a61e572a93d2fbbd581186d Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Thu, 19 May 2022 14:57:59 +0530 Subject: [PATCH 08/19] 7th point added : ps --- api/application/helpers/pdalerts_helper.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index 51a0fb8d..d13b2dd9 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -809,11 +809,12 @@ class PDALERTS ."
3. Loan Amount : ".$core_details[0]['loan_amount'] ."
4. Name of the loan applicant : ".$applicant_name ."
5. Contact Number : ".$core_details[0]['mobile_no'] - ."
6. Case initiated by : ".$case_initiated_by; + ."
6. Case initiated by : ".$case_initiated_by + ."
7. Case allocated to : ".$core_details[0]['pdofficer_name']; if(!empty($ref_str)){ $msg .= "


This is an automatically generated notification mail. Please contact on ".$ref_str." for any queries/update. "; - // print_r($msg);die(); + print_r($msg);die(); if(!empty($mail_id)){ $arg = array('mail'=>$mail_id,'pd_id'=>$pd_id,'msg'=>$msg,'subject'=>$subject); SELF::send_smcagencymail($CI,$arg); From b4166bc5e019d713f6d1541020fb3d04c14510b9 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Thu, 19 May 2022 14:58:42 +0530 Subject: [PATCH 09/19] print_r : ps --- api/application/helpers/pdalerts_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index d13b2dd9..ca1771bf 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -814,7 +814,7 @@ class PDALERTS if(!empty($ref_str)){ $msg .= "


This is an automatically generated notification mail. Please contact on ".$ref_str." for any queries/update. "; - print_r($msg);die(); + // print_r($msg);die(); if(!empty($mail_id)){ $arg = array('mail'=>$mail_id,'pd_id'=>$pd_id,'msg'=>$msg,'subject'=>$subject); SELF::send_smcagencymail($CI,$arg); From e25f8f38f42b620b89744b786d802551bfa5dd10 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 19 May 2022 10:41:44 +0000 Subject: [PATCH 10/19] pdalerts_helper case no removed : ps --- api/application/helpers/pdalerts_helper.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index ca1771bf..e76c0c98 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -756,15 +756,15 @@ class PDALERTS $mail_id = $rcm_mail_id; } log_message('ERROR','#### MW AGENCY-MAIL CALLED TYPE 2(RCM and CM) PD ID :'.$pd_id." and MAIL : ".$mail_id); - $msg = "PD for Loan Application ID-".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']."(".$core_details[0]['pd_sno'].")"." have been triggered to the vendor. "; - $subject = "PD allocated to vendor for application ID - ".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']."(".$core_details[0]['pd_sno'].")"; + $msg = "PD for Loan Application ID-".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']." have been triggered to the vendor. "; + $subject = "PD allocated to vendor for application ID - ".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']; $ref_str = "vendor email id"; } if($flag == 1){ // Mail Content For - Agency ONLY $mail_id = $core_details[0]['agency_mail']; log_message('ERROR','#### MW AGENCY-MAIL CALLED TYPE 1(AGENCY) PD ID :'.$pd_id." and MAIL : ".$mail_id); - $msg = "PD for Loan Application ID - ".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']."(".$core_details[0]['pd_sno'].") have been allocated to you. "; - $subject = "PD allocated for application ID - ".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']."(".$core_details[0]['pd_sno'].")"; + $msg = "PD for Loan Application ID - ".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']." have been allocated to you. "; + $subject = "PD allocated for application ID - ".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']; $ref_str = "client email id"; } if($flag == 3){ // Mail Conent For - Allocated Person ONLY @@ -777,7 +777,7 @@ class PDALERTS $pd_notification_msg = $CI->db->GET()->result_array(); $msg = $pd_notification_msg[0]['lender']; $msg = self::stringReplace($msg,$core_details,'MAIL'); - $subject = "PD allocated for application ID - ".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']."(".$core_details[0]['pd_sno'].")"; + $subject = "PD allocated for application ID - ".$core_details[0]['lender_applicant_id']." ".$core_details[0]['applicant_name']; $ref_str = ""; // $mail->addBCC("sanjeev.p@venbainfotech.com"); } From 773a8703275fdb2fafe9163fa0abad50fc7e8cf9 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Fri, 20 May 2022 13:00:14 +0530 Subject: [PATCH 11/19] - removed : ps --- api/application/controllers/SMC_Credit_PD_Controller.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index fa38c5b0..dfb9169c 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1533,7 +1533,7 @@ public function filterSalesPDList_post() { // 'caseno'=>'MWISE00840'); $common_fields = array('pdid'=>$view_data['pd_master_details'][0]['pd_id'], 'product'=>$view_data['pd_master_details'][0]['product_abbr'], - - 'caseno'=>$view_data['pd_master_details'][0]['pd_sno']); + 'caseno'=>$view_data['pd_master_details'][0]['pd_sno']); // print_r($pd_section_data);die(); $forms_data_to_be_get_direct_from_excel_sheet = array(3,9,10,15); @@ -1663,14 +1663,13 @@ public function filterSalesPDList_post() { // $CETAPP_creditPD_data[5]['key_stakeholders'] = $temp_arr; }// ### LFMP key_stakeholders ends // log_message('ERROR',"SUSEEN".json_encode($CETAPP_creditPD_data));die(); - cet_creditpd::pushwithcetcreditpdapi($common_fields,$CETAPP_creditPD_data);die(); + cet_creditpd::pushwithcetcreditpdapi($common_fields,$CETAPP_creditPD_data); if($view_data['pd_master_details'][0]['product_abbr'] == "NBFC/MFI"){ $html_content = $this->load->view('smc_creditpd_reports/NBFC',$view_data,true); }else{ $html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true); } - // exit(); $pdf_name = $view_data['pd_master_details'][0]['main_applicant']; $new_pdf_name = "PD_Report_".$view_data['pd_master_details'][0]['main_applicant']; From 679d65bfcd9a4d0bca47e1cf6edadd9a9c5804c4 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 20 May 2022 08:15:49 +0000 Subject: [PATCH 12/19] compnay name : ps --- api/application/controllers/SMC_Credit_PD_Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index dfb9169c..2a241382 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1808,7 +1808,7 @@ public function filterSalesPDList_post() { if(!empty($filtered_arr)){ for($i=0;$i Date: Sat, 21 May 2022 07:04:55 +0000 Subject: [PATCH 13/19] 7th point removed : ps --- api/application/helpers/pdalerts_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index e76c0c98..f7488297 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -809,8 +809,8 @@ class PDALERTS ."
3. Loan Amount : ".$core_details[0]['loan_amount'] ."
4. Name of the loan applicant : ".$applicant_name ."
5. Contact Number : ".$core_details[0]['mobile_no'] - ."
6. Case initiated by : ".$case_initiated_by - ."
7. Case allocated to : ".$core_details[0]['pdofficer_name']; + ."
6. Case initiated by : ".$case_initiated_by; + //."
7. Case allocated to : ".$core_details[0]['pdofficer_name']; if(!empty($ref_str)){ $msg .= "


This is an automatically generated notification mail. Please contact on ".$ref_str." for any queries/update. "; From cb5419c0b0dc2971f691f360969d4561381e217f Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Mon, 23 May 2022 12:20:48 +0530 Subject: [PATCH 14/19] mail content : ps --- api/application/helpers/pdalerts_helper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index e76c0c98..6ec8c0bb 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -740,7 +740,7 @@ class PDALERTS $CI->db->FROM(COMMONMASTER.' as COMMONMASTER'); $CI->db->JOIN(USERPROFILE.' as USERPROFILE','COMMONMASTER.fk_createdby = USERPROFILE.userid','LEFT'); $CI->db->WHERE('COMMONMASTER.table_name="'.PDTRIGGER.'" AND COMMONMASTER.primary_key=',$pd_id); - $CI->db->WHERE('COMMONMASTER.old_value ="'.ALLOCATED.'" AND COMMONMASTER.new_value ="'.ALLOCATED_TO_FIA.'"'); + $CI->db->WHERE('COMMONMASTER.new_value ="'.ALLOCATED_TO_FIA.'"'); $CI->db->ORDER_BY('COMMONMASTER.log_id','desc'); $logs = $CI->db->GET()->result_array(); $case_initiated_by = count($logs) > 0 ? $logs[0]['createdby'] : "-"; @@ -810,11 +810,11 @@ class PDALERTS ."
4. Name of the loan applicant : ".$applicant_name ."
5. Contact Number : ".$core_details[0]['mobile_no'] ."
6. Case initiated by : ".$case_initiated_by - ."
7. Case allocated to : ".$core_details[0]['pdofficer_name']; + ."
7. Case allocated to : ".$core_details[0]['agency_name'] ? $core_details[0]['agency_name'] : $core_details[0]['pdofficer_name'] ? $core_details[0]['pdofficer_name'] : "-"; if(!empty($ref_str)){ $msg .= "


This is an automatically generated notification mail. Please contact on ".$ref_str." for any queries/update. "; - // print_r($msg);die(); + if(!empty($mail_id)){ $arg = array('mail'=>$mail_id,'pd_id'=>$pd_id,'msg'=>$msg,'subject'=>$subject); SELF::send_smcagencymail($CI,$arg); From 34a5d94fe7617460b54d12852f54174eee884583 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Mon, 23 May 2022 13:24:54 +0530 Subject: [PATCH 15/19] mail : ps --- api/application/helpers/pdalerts_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index 6ec8c0bb..c16ddb65 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -810,7 +810,7 @@ class PDALERTS ."
4. Name of the loan applicant : ".$applicant_name ."
5. Contact Number : ".$core_details[0]['mobile_no'] ."
6. Case initiated by : ".$case_initiated_by - ."
7. Case allocated to : ".$core_details[0]['agency_name'] ? $core_details[0]['agency_name'] : $core_details[0]['pdofficer_name'] ? $core_details[0]['pdofficer_name'] : "-"; + ."
7. Case allocated to : ".($core_details[0]['agency_name'] ? $core_details[0]['agency_name'] : ($core_details[0]['pdofficer_name'] ? $core_details[0]['pdofficer_name'] : "-")); if(!empty($ref_str)){ $msg .= "


This is an automatically generated notification mail. Please contact on ".$ref_str." for any queries/update. "; From fe632c8cc69153ad8dcdbe373e420e373a817dda Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Mon, 23 May 2022 14:03:37 +0530 Subject: [PATCH 16/19] CreditPD json key added 1 : ps --- api/application/controllers/PD_Controller.php | 54 ++++++++- api/application/helpers/faceapi_helper.php | 106 ++++++++++++++++++ .../helpers/smc_creditpd_helper.php | 6 +- 3 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 api/application/helpers/faceapi_helper.php diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 1c9ca3d5..b714a7a8 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -38,6 +38,7 @@ class PD_Controller extends REST_Controller { $this->load->helper('MYUTIL'); $this->load->helper('satellite_image'); $this->load->library('pdfgenerator'); + $this->load->helper('faceapi'); //$this->load->library('excel'); $this->load->library('phpmailer_library'); @@ -11862,6 +11863,57 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() } $this->response($data,REST_Controller::HTTP_OK); } - + public function facemark_get(){ + $get = $this->get('pd');//pdid 3184 + $bounding_box = array(); + if(!empty($get)){ + $master_details = $this->PD_Model->getPDMasterDetails($get); + if($master_details[0]['pd_status'] !== COMPLETED){ + $db_result = $this->PD_Model->selectCustomRecords(array('faceapi_result'),array('pd_id' => $get),PDTRIGGER); + $string = $db_result[0]['faceapi_result']; + // echo gettype($string); + $my_array = json_decode($string,true); + // echo gettype($my_array); + if(!empty($my_array) && !empty($my_array["FaceMatches"])){ + $arr = $my_array["FaceMatches"]; + for($i=0;$i $get,'isactive' => 1,'image_key' => "selfie_with_person_met"); + $img_result = $this->PD_Model->selectCustomRecords(array('pd_document_id','pd_document_name','pd_document_title','image_key'),$where_condition_array,PDDOCUMENTS); + $image_name = $img_result[0]['pd_document_name']; + $bucketname = LENDER_BUCKET_NAME_PREFIX.$master_details[0]['fk_lender_id']; + $key = 'pd'.$get.'/'.$image_name; + + $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes'); + $destination_path = $this->external_path."/pd_reports/". $get ."/".$image_name; + //$getimage = getcontent first ($singed_uri) + $image_name = file_put_contents($destination_path, file_get_contents($singed_uri)); + // $image_name = "sample.png"; + // $destination_path = $this->external_path."/pd_reports/". $get ."/".$image_name; + + faceapi::toMakeFaceBoundingBox($image_name,$bounding_box,$destination_path); + // save table s3 + + + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['msg'] = 'Given PDID '; + $data['details'] = $bounding_box; + }else{ + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NO_CONTENT; + $data['msg'] = 'Given PDID is Not in Completed Status'; + } + }else{ + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NO_CONTENT; + $data['msg'] = 'PDID is Not Available'; + } + $this->response($data,REST_Controller::HTTP_OK); + + } } \ No newline at end of file diff --git a/api/application/helpers/faceapi_helper.php b/api/application/helpers/faceapi_helper.php new file mode 100644 index 00000000..eb8cd8b0 --- /dev/null +++ b/api/application/helpers/faceapi_helper.php @@ -0,0 +1,106 @@ + \ No newline at end of file diff --git a/api/application/helpers/smc_creditpd_helper.php b/api/application/helpers/smc_creditpd_helper.php index 27b38faf..b406f971 100644 --- a/api/application/helpers/smc_creditpd_helper.php +++ b/api/application/helpers/smc_creditpd_helper.php @@ -34,6 +34,7 @@ class smc_creditpd break; case 8://assest $return_data = SELF::getAssestSectionData($section); + // print_r($return_data); break; case 11://supplier @@ -185,7 +186,9 @@ class smc_creditpd $seven_row = ''.' Is there a Loan Against the Asset? (Yes / No) '; foreach ($json['business_assets_details'] as $key => $value) { - + $json['business_assets_details'][$key]['business_assets_mode_name'] = ( $value['business_assets_mode'] == 1 ? $value['other_asset_description'] : $asset_type [ $value['business_assets_mode'] ]); + $json['business_assets_details'][$key]['business_owner_name'] = (isset($value['business_name_of_the_owner']) ? (applicantname_grabber::getApplicantsNameById($value['business_name_of_the_owner'],$applicant_details)): 'NA'); + $description = $value['other_asset_description']; if(isset($value['property_type'])) { @@ -381,6 +384,7 @@ class smc_creditpd $eight_row = ''.' Balance Tenure (Mnts) '; foreach ($json['existing_loan_details'] as $key => $value) { + $json['existing_loan_details'][$key]['business_owner_name'] = (isset($value['business_name_of_the_owner']) ? (applicantname_grabber::getApplicantsNameById($value['business_name_of_the_owner'],$applicant_details)): 'NA'); $header_row .= 'Loan '.($key + 1).''; $first_row .= ''. $value['loan_type'] .''; From 193a93a123c02f50f948f86e0b798e65c9973439 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Mon, 23 May 2022 17:08:55 +0530 Subject: [PATCH 17/19] finalremarks : ps --- api/application/helpers/smc_creditpd_helper.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/api/application/helpers/smc_creditpd_helper.php b/api/application/helpers/smc_creditpd_helper.php index b406f971..eff46d62 100644 --- a/api/application/helpers/smc_creditpd_helper.php +++ b/api/application/helpers/smc_creditpd_helper.php @@ -24,7 +24,8 @@ class smc_creditpd case 14://future case 18://credit case 19://final remarks - $return_data = json_decode($section['json'],true); + // $return_data = json_decode($section['json'],true); + $return_data = SELF::getFinalRemarksSectionData($section); break; case 3://fund $return_data = SELF::getLoanSectionData($section); @@ -537,6 +538,17 @@ class smc_creditpd return $json; } + static function getFinalRemarksSectionData($section) + { + $json = json_decode($section['json'],true); + $customer_behaviour = array(1 => 'Others',2 => 'Rude',3 => 'Polite'); + $pd_officer_recommandations = array(2=>'Positive',3=>'Negative',5=>'Refer to Credit',0=>'Others'); + $json['pd_officer_recommendation_name'] = isset($value['pd_officer_recommendation'])? $pd_officer_recommandations [ $value['pd_officer_recommendation_name'] ] : 'NA'; + $json['customer_behaviour_name'] = (isset($value['customer_behaviour']) ? $customer_behaviour [ $value['customer_behaviour'] ] : 'NA'); + // echo 'json***'; + // print_r($json); + return $json; + } } ?> \ No newline at end of file From 3d8d0a7e0d2058b7a2a70cb2892c51fe60e7e528 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Tue, 24 May 2022 13:13:57 +0530 Subject: [PATCH 18/19] Face API : ps --- api/application/controllers/PD_Controller.php | 78 +++++++++++-------- api/application/helpers/faceapi_helper.php | 55 ++++++------- .../helpers/smc_creditpd_helper.php | 4 +- api/application/models/PD_Model.php | 2 +- 4 files changed, 78 insertions(+), 61 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index b714a7a8..ddad5c91 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -984,6 +984,7 @@ class PD_Controller extends REST_Controller { { $pd_details['complete_override_data'] = json_encode($pd_details['complete_override_data']); $pd_details['completed_on'] = date('Y-m-d H:i:s'); + $this->toMakeFaceBoundingBox($exist_pd_details); } if(array_key_exists('link',$pd_details)) @@ -11863,13 +11864,15 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() } $this->response($data,REST_Controller::HTTP_OK); } - public function facemark_get(){ - $get = $this->get('pd');//pdid 3184 + // public function facemark_get(){ + public function toMakeFaceBoundingBox($master_details){ + // $pdid = $this->get('pd');//pdid 3184 comment this + $pdid = $master_details[0]['pd_id']; $bounding_box = array(); - if(!empty($get)){ - $master_details = $this->PD_Model->getPDMasterDetails($get); - if($master_details[0]['pd_status'] !== COMPLETED){ - $db_result = $this->PD_Model->selectCustomRecords(array('faceapi_result'),array('pd_id' => $get),PDTRIGGER); + if(!empty($pdid)){ + // $master_details = $this->PD_Model->getPDMasterDetails($pdid);//comment this + if($master_details[0]['pd_status'] == COMPLETED && $master_details[0]['facemark_image_generated'] == 0){ + $db_result = $this->PD_Model->selectCustomRecords(array('faceapi_result'),array('pd_id' => $pdid),PDTRIGGER); $string = $db_result[0]['faceapi_result']; // echo gettype($string); $my_array = json_decode($string,true); @@ -11881,38 +11884,49 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() $bounding_box[$i]['Similarity'] = $arr[$i]['Similarity']; } } - $where_condition_array = array('fk_pd_id' => $get,'isactive' => 1,'image_key' => "selfie_with_person_met"); + $where_condition_array = array('fk_pd_id' => $pdid,'isactive' => 1,'image_key' => "selfie_with_person_met"); $img_result = $this->PD_Model->selectCustomRecords(array('pd_document_id','pd_document_name','pd_document_title','image_key'),$where_condition_array,PDDOCUMENTS); - $image_name = $img_result[0]['pd_document_name']; - $bucketname = LENDER_BUCKET_NAME_PREFIX.$master_details[0]['fk_lender_id']; - $key = 'pd'.$get.'/'.$image_name; + $bucketname = LENDER_BUCKET_NAME_PREFIX.$master_details[0]['fk_lender_id']; + $key = 'pd'.$pdid.'/'.$img_result[0]['pd_document_name']; $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes'); - $destination_path = $this->external_path."/pd_reports/". $get ."/".$image_name; - //$getimage = getcontent first ($singed_uri) - $image_name = file_put_contents($destination_path, file_get_contents($singed_uri)); - // $image_name = "sample.png"; - // $destination_path = $this->external_path."/pd_reports/". $get ."/".$image_name; + + // $temp_image_name = "sample.png"; + $temp_image_name = "face_api_image.png"; + $destination_path = $this->external_path."/pd_reports/". $pdid ."/".$temp_image_name; + file_put_contents($destination_path, file_get_contents($singed_uri)); + + faceapi::toMakeFaceBoundingBox($temp_image_name,$bounding_box,$destination_path); - faceapi::toMakeFaceBoundingBox($image_name,$bounding_box,$destination_path); - // save table s3 - - - $data['dataStatus'] = true; - $data['status'] = REST_Controller::HTTP_OK; - $data['msg'] = 'Given PDID '; - $data['details'] = $bounding_box; - }else{ - $data['dataStatus'] = false; - $data['status'] = REST_Controller::HTTP_NO_CONTENT; - $data['msg'] = 'Given PDID is Not in Completed Status'; + $key = 'pd'.$pdid.'/'.$temp_image_name; + $sourcefile = $destination_path; + + $bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>$sourcefile); + $s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data); + + // print_r($s3result);die(); + if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) + { + $this->db->WHERE('pd_id',$pdid)->UPDATE(PDTRIGGER,array('facemark_image_generated' => 1)); + unlink($destination_path); + } + // $data['dataStatus'] = true; + // $data['status'] = REST_Controller::HTTP_OK; + // $data['msg'] = 'Given PDID '; + // $data['details'] = $bounding_box; } - }else{ - $data['dataStatus'] = false; - $data['status'] = REST_Controller::HTTP_NO_CONTENT; - $data['msg'] = 'PDID is Not Available'; + // else{ + // $data['dataStatus'] = false; + // $data['status'] = REST_Controller::HTTP_NO_CONTENT; + // $data['msg'] = 'Given PDID is Not in Completed Status'; + // } } - $this->response($data,REST_Controller::HTTP_OK); + // else{ + // $data['dataStatus'] = false; + // $data['status'] = REST_Controller::HTTP_NO_CONTENT; + // $data['msg'] = 'PDID is Not Available'; + // } + // $this->response($data,REST_Controller::HTTP_OK); } diff --git a/api/application/helpers/faceapi_helper.php b/api/application/helpers/faceapi_helper.php index eb8cd8b0..ca03da2b 100644 --- a/api/application/helpers/faceapi_helper.php +++ b/api/application/helpers/faceapi_helper.php @@ -2,18 +2,17 @@ class faceapi { - private static $current_pd_id = null; public static function toMakeFaceBoundingBox($image_name,$BoundingBox,$destination_path){ - $get_image_format = explode(".",$image_name); - $image_format = $get_image_format[1]; - if($image_format == 'png'){ - $img = imagecreatefrompng($destination_path); - }else if($image_format == 'jpeg'){ - $img = imagecreatefromjpeg($destination_path); - }else if($image_format == 'jpg'){ - $img = imagecreatefromjpg($destination_path); - } + // $image_format = $get_image_format[1]; + $img = imagecreatefrompng($destination_path); + // if($image_format == 'png'){ + // $img = imagecreatefrompng($destination_path); + // }else if($image_format == 'jpeg'){ + // $img = imagecreatefromjpeg($destination_path); + // }else if($image_format == 'jpg'){ + // $img = imagecreatefromjpg($destination_path); + // } $red = imagecolorallocate($img, 255, 0, 0); @@ -30,21 +29,25 @@ class faceapi $Top_coordinate = ($BoundingBox[$i]['Top'] * $imageheight) ; $Face_width = ($BoundingBox[$i]['Width'] * $imagewidth) ; $Face_height = ($BoundingBox[$i]['Height'] * $imageheight) ; - $Similarity = round($BoundingBox[$i]['Similarity'])."%"; + $Similarity = round($BoundingBox[$i]['Similarity']); + $x1 = $Left_coordinate; $y1 = $Top_coordinate; - self::DrawLine($x1,$y1,$Face_width,$Face_height,$Similarity,$img,$image_format,$destination_path); + self::DrawLine($x1,$y1,$Face_width,$Face_height,$Similarity,$img,$destination_path); } } - public static function DrawLine($x1,$y1,$Face_width,$Face_height,$Similarity,$img,$image_format,$destination_path){ - // 70 - green - // 70 below red - $color = imagecolorallocate($img, 0, 153, 0); + public static function DrawLine($x1,$y1,$Face_width,$Face_height,$Similarity,$img,$destination_path){ + if($Similarity >= 70 ){// above 70 green + $color = imagecolorallocate($img, 0, 153, 0); + }else if($Similarity < 70 ){// below 70 red + $color = imagecolorallocate($img, 255, 0, 0); + } + $Similarity = $Similarity." %"; //TOP LINe $t_x1 = $x1; $t_y1 = $y1; @@ -62,17 +65,17 @@ class faceapi $imgl = self::imagelinethick($img,$t_x1,$t_y1,$b_x1,$b_y1,$color,7);//left line $imgl = self::imagelinethick($img,$t_x2,$t_y2,$b_x2,$b_y2,$color,7);//right line // apppath / doc la roboto.tff - $string = str_replace("sample.png", "roboto.ttf", $destination_path); - imagettftext($img, 20, 0, ($t_x1), ($t_y1-5), $color,$string, $Similarity); - + $font = APPPATH."docs/roboto.ttf"; + imagettftext($img, 20, 0, ($t_x1), ($t_y1-5), $color,$font, $Similarity); + imagepng($img, $destination_path); // imagepng($img, "face4.png"); - if($image_format == 'png'){ - imagepng($img, $destination_path); - }else if($image_format == 'jpeg'){ - imagejpeg($img, $destination_path); - }else if($image_format == 'jpg'){ - imagejpg($img, $destination_path); - } + // if($image_format == 'png'){ + // imagepng($img, $destination_path); + // }else if($image_format == 'jpeg'){ + // imagejpeg($img, $destination_path); + // }else if($image_format == 'jpg'){ + // imagejpg($img, $destination_path); + // } } diff --git a/api/application/helpers/smc_creditpd_helper.php b/api/application/helpers/smc_creditpd_helper.php index eff46d62..841bfb9a 100644 --- a/api/application/helpers/smc_creditpd_helper.php +++ b/api/application/helpers/smc_creditpd_helper.php @@ -541,8 +541,8 @@ class smc_creditpd static function getFinalRemarksSectionData($section) { $json = json_decode($section['json'],true); - $customer_behaviour = array(1 => 'Others',2 => 'Rude',3 => 'Polite'); - $pd_officer_recommandations = array(2=>'Positive',3=>'Negative',5=>'Refer to Credit',0=>'Others'); + $customer_behaviour = array("1" => 'Others',"2" => 'Rude',"3" => 'Polite'); + $pd_officer_recommandations = array("2"=>'Positive',"3"=>'Negative',"5"=>'Refer to Credit',"0"=>'Others'); $json['pd_officer_recommendation_name'] = isset($value['pd_officer_recommendation'])? $pd_officer_recommandations [ $value['pd_officer_recommendation_name'] ] : 'NA'; $json['customer_behaviour_name'] = (isset($value['customer_behaviour']) ? $customer_behaviour [ $value['customer_behaviour'] ] : 'NA'); // echo 'json***'; diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 9e8ae855..ef853bb8 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -1054,7 +1054,7 @@ class PD_Model extends SPARQ_Model { */ public function getPDMasterDetails($pdid,$random_string = null) { - $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno,PDTRIGGER.fk_lender_id,PDTRIGGER.sub_entity_id,SUBENTITY.short_name as sub_entity_short_name,PDTRIGGER.imgc_fin_institute,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name,ENTITY.is_score_card_enabled,ENTITY.is_otp_enabled, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PRODUCTS.prod_catagory,PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %h:%i:%s %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",IFNULL(USERPROFILE.last_name,"")) as createdby,concat(USERPROFILE1.first_name," ",IFNULL(USERPROFILE1.last_name,"")) as updatedby,DESIGNATION.designation as updatedby_designation,PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.is_qc_enabled,AGENCY.full_name as agency_name,AGENCY.short_name as agency_short_name,PDTRIGGER.vendor_pdofficer,concat(VENDORPDOFFICER.first_name," ",VENDORPDOFFICER.last_name) as vendor_pdofficer_name,PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.lender_sales_person,concat(LENDERSALESPERSON.first_name," ",LENDERSALESPERSON.last_name) as lender_sales_person_name,LENDERSALESPERSON.mobile_no as lender_sales_contact_mobileno,LENDERSALESPERSON.email as lender_sales_person_email,PDTRIGGER.lender_credit_person,concat(LENDERCREDITPERSON.first_name," ",LENDERCREDITPERSON.last_name) as lender_credit_person_name,LENDERCREDITPERSON.mobile_no as lender_credit_person_contact_mobileno,LENDERCREDITPERSON.email as lender_credit_person_email,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,OTPREJECTION.rejection_reason,PDTRIGGER.otp_reject_other_reason,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited,PDTRIGGER.is_zip_created,PDTRIGGER.pd_qc_note,ENTITY.is_sms_enabled,ENTITY.is_mail_enabled,ENTITY.is_app_notify_enabled,AGENCY.is_vendor_visit_disabled,PDTRIGGER.is_notify_enabled,ENTITYFININSTITUTION.institute_name as fin_institute_name,PDTRIGGER.is_img_pdf_created,PDTRIGGER.is_video_merged,PDTRIGGER.vendor_status,PDTRIGGER.vendor_scheduled_on as vendor_scheduled_on_validation,DATE_FORMAT(PDTRIGGER.vendor_scheduled_on,"%d/%m/%Y %h:%i %p") as vendor_scheduled_on,PDTRIGGER.complete_override_data,PDTRIGGER.excel_file_id,SMC_EXCEL_FILELIST.file_name,SMC_EXCEL_FILELIST.modified_fname,PDTRIGGER.mwise_sales_person,PDTRIGGER.is_field_visit_done,PDTRIGGER.cancel_pd_remark,if(SMC_EXCEL_FILELIST_RE_UPLOAD.fk_pd_id is not null,"1","0") as re_uploaded,SMC_EXCEL_FILELIST_RE_UPLOAD.modified_fname as re_uploaded_file_name,ROLES.role_id as pd_allocated_to_role_id,AGENCYLIST.agency_name as SMC_vendor_agency_name,AGENCYLIST.agency_abbr as SMC_vendor_agency_short_name'); + $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno,PDTRIGGER.fk_lender_id,PDTRIGGER.sub_entity_id,SUBENTITY.short_name as sub_entity_short_name,PDTRIGGER.imgc_fin_institute,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name,ENTITY.is_score_card_enabled,ENTITY.is_otp_enabled, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PRODUCTS.prod_catagory,PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %h:%i:%s %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",IFNULL(USERPROFILE.last_name,"")) as createdby,concat(USERPROFILE1.first_name," ",IFNULL(USERPROFILE1.last_name,"")) as updatedby,DESIGNATION.designation as updatedby_designation,PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.is_qc_enabled,AGENCY.full_name as agency_name,AGENCY.short_name as agency_short_name,PDTRIGGER.vendor_pdofficer,concat(VENDORPDOFFICER.first_name," ",VENDORPDOFFICER.last_name) as vendor_pdofficer_name,PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.lender_sales_person,concat(LENDERSALESPERSON.first_name," ",LENDERSALESPERSON.last_name) as lender_sales_person_name,LENDERSALESPERSON.mobile_no as lender_sales_contact_mobileno,LENDERSALESPERSON.email as lender_sales_person_email,PDTRIGGER.lender_credit_person,concat(LENDERCREDITPERSON.first_name," ",LENDERCREDITPERSON.last_name) as lender_credit_person_name,LENDERCREDITPERSON.mobile_no as lender_credit_person_contact_mobileno,LENDERCREDITPERSON.email as lender_credit_person_email,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,OTPREJECTION.rejection_reason,PDTRIGGER.otp_reject_other_reason,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited,PDTRIGGER.is_zip_created,PDTRIGGER.pd_qc_note,ENTITY.is_sms_enabled,ENTITY.is_mail_enabled,ENTITY.is_app_notify_enabled,AGENCY.is_vendor_visit_disabled,PDTRIGGER.is_notify_enabled,ENTITYFININSTITUTION.institute_name as fin_institute_name,PDTRIGGER.is_img_pdf_created,PDTRIGGER.is_video_merged,PDTRIGGER.vendor_status,PDTRIGGER.vendor_scheduled_on as vendor_scheduled_on_validation,DATE_FORMAT(PDTRIGGER.vendor_scheduled_on,"%d/%m/%Y %h:%i %p") as vendor_scheduled_on,PDTRIGGER.complete_override_data,PDTRIGGER.excel_file_id,SMC_EXCEL_FILELIST.file_name,SMC_EXCEL_FILELIST.modified_fname,PDTRIGGER.mwise_sales_person,PDTRIGGER.is_field_visit_done,PDTRIGGER.cancel_pd_remark,if(SMC_EXCEL_FILELIST_RE_UPLOAD.fk_pd_id is not null,"1","0") as re_uploaded,SMC_EXCEL_FILELIST_RE_UPLOAD.modified_fname as re_uploaded_file_name,ROLES.role_id as pd_allocated_to_role_id,AGENCYLIST.agency_name as SMC_vendor_agency_name,AGENCYLIST.agency_abbr as SMC_vendor_agency_short_name,PDTRIGGER.facemark_image_generated'); $this->db->FROM(PDTRIGGER.' as PDTRIGGER'); $this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id ','LEFT'); $this->db->JOIN(ENTITY.' as SUBENTITY','PDTRIGGER.sub_entity_id = SUBENTITY.entity_id ','LEFT'); From 3979ab9031580e858d5a96373d187e8ecf979fe3 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Tue, 24 May 2022 14:31:02 +0530 Subject: [PATCH 19/19] face api image on report : ps --- api/application/controllers/PD_Controller.php | 13 +++++++++++-- api/application/models/PD_Model.php | 2 +- .../views/report_templates/JSONTOREPORT_CLIX.php | 4 ++++ .../report_templates/JSONTOREPORT_CLIX_SMARTPD.php | 4 ++++ .../report_templates/JSONTOREPORT_CLIX_TELE_PD.php | 4 ++++ .../views/report_templates/JSONTOREPORT_DI_AI.php | 4 ++++ .../report_templates/JSONTOREPORT_DI_AI_ADDON.php | 4 ++++ .../report_templates/JSONTOREPORT_DI_AI_SMARTPD.php | 4 ++++ .../report_templates/JSONTOREPORT_DI_AI_TELE_PD.php | 4 ++++ .../views/report_templates/JSONTOREPORT_RI.php | 4 ++++ .../report_templates/JSONTOREPORT_RI_SMARTPD.php | 4 ++++ .../report_templates/JSONTOREPORT_RI_TELE_PD.php | 4 ++++ .../views/report_templates/JSONTOREPORT_SAL.php | 4 ++++ .../report_templates/JSONTOREPORT_SAL_SMARTPD.php | 4 ++++ .../report_templates/JSONTOREPORT_SAL_TELE_PD.php | 4 ++++ 15 files changed, 64 insertions(+), 3 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index ddad5c91..dad5c83d 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -5097,6 +5097,7 @@ public function getPDFormDetailsJSON_post() } $data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($pdid,$random_string); + // print_r($data['pd_master_details']);die; $data['pd_master_details'][0]['pd_report_generated_date'] = date('d/m/Y g:i:s A'); @@ -5188,9 +5189,17 @@ public function getPDFormDetailsJSON_post() } $t = 'DEFAULT DATA'; // if(!count($add_on_pd)) - // { - + // { + if($data['pd_master_details'][0]['facemark_image_generated'] == 1 && $data['pd_master_details'][0]['is_face_api_enabled'] == 1){ + $bucket_name = LENDER_BUCKET_NAME_PREFIX.$data['pd_master_details'][0]['fk_lender_id']; + $destination_path = $this->external_path."/pd_reports/". $pdid ."/face_api_image.png"; + // $bucket_name = LENDER_BUCKET_NAME_PREFIX."3"; + // $destination_path = $this->external_path."/pd_reports/". "3184" ."/face_api_image.png"; + $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$destination_path,'+10 minutes'); + $data['pd_master_details'][0]['face_api_image'] = $singed_uri; + } + if($data['pd_master_details'][0]['fk_pd_type'] == 1) //Full PD { diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index ef853bb8..6ec382f7 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -1054,7 +1054,7 @@ class PD_Model extends SPARQ_Model { */ public function getPDMasterDetails($pdid,$random_string = null) { - $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno,PDTRIGGER.fk_lender_id,PDTRIGGER.sub_entity_id,SUBENTITY.short_name as sub_entity_short_name,PDTRIGGER.imgc_fin_institute,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name,ENTITY.is_score_card_enabled,ENTITY.is_otp_enabled, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PRODUCTS.prod_catagory,PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %h:%i:%s %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",IFNULL(USERPROFILE.last_name,"")) as createdby,concat(USERPROFILE1.first_name," ",IFNULL(USERPROFILE1.last_name,"")) as updatedby,DESIGNATION.designation as updatedby_designation,PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.is_qc_enabled,AGENCY.full_name as agency_name,AGENCY.short_name as agency_short_name,PDTRIGGER.vendor_pdofficer,concat(VENDORPDOFFICER.first_name," ",VENDORPDOFFICER.last_name) as vendor_pdofficer_name,PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.lender_sales_person,concat(LENDERSALESPERSON.first_name," ",LENDERSALESPERSON.last_name) as lender_sales_person_name,LENDERSALESPERSON.mobile_no as lender_sales_contact_mobileno,LENDERSALESPERSON.email as lender_sales_person_email,PDTRIGGER.lender_credit_person,concat(LENDERCREDITPERSON.first_name," ",LENDERCREDITPERSON.last_name) as lender_credit_person_name,LENDERCREDITPERSON.mobile_no as lender_credit_person_contact_mobileno,LENDERCREDITPERSON.email as lender_credit_person_email,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,OTPREJECTION.rejection_reason,PDTRIGGER.otp_reject_other_reason,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited,PDTRIGGER.is_zip_created,PDTRIGGER.pd_qc_note,ENTITY.is_sms_enabled,ENTITY.is_mail_enabled,ENTITY.is_app_notify_enabled,AGENCY.is_vendor_visit_disabled,PDTRIGGER.is_notify_enabled,ENTITYFININSTITUTION.institute_name as fin_institute_name,PDTRIGGER.is_img_pdf_created,PDTRIGGER.is_video_merged,PDTRIGGER.vendor_status,PDTRIGGER.vendor_scheduled_on as vendor_scheduled_on_validation,DATE_FORMAT(PDTRIGGER.vendor_scheduled_on,"%d/%m/%Y %h:%i %p") as vendor_scheduled_on,PDTRIGGER.complete_override_data,PDTRIGGER.excel_file_id,SMC_EXCEL_FILELIST.file_name,SMC_EXCEL_FILELIST.modified_fname,PDTRIGGER.mwise_sales_person,PDTRIGGER.is_field_visit_done,PDTRIGGER.cancel_pd_remark,if(SMC_EXCEL_FILELIST_RE_UPLOAD.fk_pd_id is not null,"1","0") as re_uploaded,SMC_EXCEL_FILELIST_RE_UPLOAD.modified_fname as re_uploaded_file_name,ROLES.role_id as pd_allocated_to_role_id,AGENCYLIST.agency_name as SMC_vendor_agency_name,AGENCYLIST.agency_abbr as SMC_vendor_agency_short_name,PDTRIGGER.facemark_image_generated'); + $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno,PDTRIGGER.fk_lender_id,PDTRIGGER.sub_entity_id,SUBENTITY.short_name as sub_entity_short_name,PDTRIGGER.imgc_fin_institute,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name,ENTITY.is_score_card_enabled,ENTITY.is_otp_enabled, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PRODUCTS.prod_catagory,PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %h:%i:%s %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",IFNULL(USERPROFILE.last_name,"")) as createdby,concat(USERPROFILE1.first_name," ",IFNULL(USERPROFILE1.last_name,"")) as updatedby,DESIGNATION.designation as updatedby_designation,PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.is_qc_enabled,AGENCY.full_name as agency_name,AGENCY.short_name as agency_short_name,PDTRIGGER.vendor_pdofficer,concat(VENDORPDOFFICER.first_name," ",VENDORPDOFFICER.last_name) as vendor_pdofficer_name,PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.lender_sales_person,concat(LENDERSALESPERSON.first_name," ",LENDERSALESPERSON.last_name) as lender_sales_person_name,LENDERSALESPERSON.mobile_no as lender_sales_contact_mobileno,LENDERSALESPERSON.email as lender_sales_person_email,PDTRIGGER.lender_credit_person,concat(LENDERCREDITPERSON.first_name," ",LENDERCREDITPERSON.last_name) as lender_credit_person_name,LENDERCREDITPERSON.mobile_no as lender_credit_person_contact_mobileno,LENDERCREDITPERSON.email as lender_credit_person_email,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,OTPREJECTION.rejection_reason,PDTRIGGER.otp_reject_other_reason,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited,PDTRIGGER.is_zip_created,PDTRIGGER.pd_qc_note,ENTITY.is_sms_enabled,ENTITY.is_mail_enabled,ENTITY.is_app_notify_enabled,AGENCY.is_vendor_visit_disabled,PDTRIGGER.is_notify_enabled,ENTITYFININSTITUTION.institute_name as fin_institute_name,PDTRIGGER.is_img_pdf_created,PDTRIGGER.is_video_merged,PDTRIGGER.vendor_status,PDTRIGGER.vendor_scheduled_on as vendor_scheduled_on_validation,DATE_FORMAT(PDTRIGGER.vendor_scheduled_on,"%d/%m/%Y %h:%i %p") as vendor_scheduled_on,PDTRIGGER.complete_override_data,PDTRIGGER.excel_file_id,SMC_EXCEL_FILELIST.file_name,SMC_EXCEL_FILELIST.modified_fname,PDTRIGGER.mwise_sales_person,PDTRIGGER.is_field_visit_done,PDTRIGGER.cancel_pd_remark,if(SMC_EXCEL_FILELIST_RE_UPLOAD.fk_pd_id is not null,"1","0") as re_uploaded,SMC_EXCEL_FILELIST_RE_UPLOAD.modified_fname as re_uploaded_file_name,ROLES.role_id as pd_allocated_to_role_id,AGENCYLIST.agency_name as SMC_vendor_agency_name,AGENCYLIST.agency_abbr as SMC_vendor_agency_short_name,PDTRIGGER.facemark_image_generated,ENTITY.is_face_api_enabled'); $this->db->FROM(PDTRIGGER.' as PDTRIGGER'); $this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id ','LEFT'); $this->db->JOIN(ENTITY.' as SUBENTITY','PDTRIGGER.sub_entity_id = SUBENTITY.entity_id ','LEFT'); diff --git a/api/application/views/report_templates/JSONTOREPORT_CLIX.php b/api/application/views/report_templates/JSONTOREPORT_CLIX.php index 7e2f2cfc..3f379801 100644 --- a/api/application/views/report_templates/JSONTOREPORT_CLIX.php +++ b/api/application/views/report_templates/JSONTOREPORT_CLIX.php @@ -711,6 +711,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } + if(isset($pd_master_details[0]['face_api_image'])) + { + echo ''; + } echo ''; echo '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_CLIX_SMARTPD.php b/api/application/views/report_templates/JSONTOREPORT_CLIX_SMARTPD.php index 8fb360c8..f134965a 100644 --- a/api/application/views/report_templates/JSONTOREPORT_CLIX_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_CLIX_SMARTPD.php @@ -718,6 +718,10 @@ font-weight: bolder;; } + if(isset($pd_master_details[0]['face_api_image'])) + { + echo ''; + } echo ''; echo '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_CLIX_TELE_PD.php b/api/application/views/report_templates/JSONTOREPORT_CLIX_TELE_PD.php index c5721290..12e374bd 100644 --- a/api/application/views/report_templates/JSONTOREPORT_CLIX_TELE_PD.php +++ b/api/application/views/report_templates/JSONTOREPORT_CLIX_TELE_PD.php @@ -712,6 +712,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } + if(isset($pd_master_details[0]['face_api_image'])) + { + echo ''; + } echo ''; echo '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php index 648bd960..4f21200e 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php @@ -708,6 +708,10 @@ if ( isset($pdf) ) { } + if(isset($pd_master_details[0]['face_api_image'])) + { + echo ''; + } echo ''; echo '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php index a011279e..ea404569 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php @@ -691,6 +691,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } + if(isset($pd_master_details[0]['face_api_image'])) + { + echo ''; + } echo ""; echo '
'; diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI_SMARTPD.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI_SMARTPD.php index 3cce5ca5..ab951371 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_SMARTPD.php @@ -712,6 +712,10 @@ if ( isset($pdf) ) { } + if(isset($pd_master_details[0]['face_api_image'])) + { + echo ''; + } echo ''; echo '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php index 6b435183..2a58b28f 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php @@ -710,6 +710,10 @@ if ( isset($pdf) ) { } + if(isset($pd_master_details[0]['face_api_image'])) + { + echo ''; + } echo ''; echo '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_RI.php b/api/application/views/report_templates/JSONTOREPORT_RI.php index e8510f48..3f35704a 100644 --- a/api/application/views/report_templates/JSONTOREPORT_RI.php +++ b/api/application/views/report_templates/JSONTOREPORT_RI.php @@ -678,6 +678,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } + if(isset($pd_master_details[0]['face_api_image'])) + { + echo ''; + } echo ''; echo '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_RI_SMARTPD.php b/api/application/views/report_templates/JSONTOREPORT_RI_SMARTPD.php index 8e42d623..335c3569 100644 --- a/api/application/views/report_templates/JSONTOREPORT_RI_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_RI_SMARTPD.php @@ -678,6 +678,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } + if(isset($pd_master_details[0]['face_api_image'])) + { + echo ''; + } echo ''; echo '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_RI_TELE_PD.php b/api/application/views/report_templates/JSONTOREPORT_RI_TELE_PD.php index 9ff42f7b..eaf748ab 100644 --- a/api/application/views/report_templates/JSONTOREPORT_RI_TELE_PD.php +++ b/api/application/views/report_templates/JSONTOREPORT_RI_TELE_PD.php @@ -679,6 +679,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } + if(isset($pd_master_details[0]['face_api_image'])) + { + echo ''; + } echo ''; echo '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_SAL.php b/api/application/views/report_templates/JSONTOREPORT_SAL.php index 631d821c..9ffcf710 100644 --- a/api/application/views/report_templates/JSONTOREPORT_SAL.php +++ b/api/application/views/report_templates/JSONTOREPORT_SAL.php @@ -682,6 +682,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } //echo ''; } + if(isset($pd_master_details[0]['face_api_image'])) + { + echo ''; + } echo '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php b/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php index 7776dc0b..77da3251 100644 --- a/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php @@ -689,6 +689,10 @@ font-weight: bolder;; } //echo ''; } + if(isset($pd_master_details[0]['face_api_image'])) + { + echo ''; + } echo '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_SAL_TELE_PD.php b/api/application/views/report_templates/JSONTOREPORT_SAL_TELE_PD.php index aa4e8a51..5458f0f8 100644 --- a/api/application/views/report_templates/JSONTOREPORT_SAL_TELE_PD.php +++ b/api/application/views/report_templates/JSONTOREPORT_SAL_TELE_PD.php @@ -680,6 +680,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); //echo count($person_met_data) != ($pk+1)? '
':''; + } + if(isset($pd_master_details[0]['face_api_image'])) + { + echo ''; } echo ''; }