diff --git a/api/application/config/constants.php b/api/application/config/constants.php index 8d1d5487..16396452 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 @@ -123,8 +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_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'); } else if(ENVIRONMENT == 'testing') { @@ -143,8 +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_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'); } else if(ENVIRONMENT == 'production') { @@ -163,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/config/routes.php b/api/application/config/routes.php index 6466be75..cbbed1fb 100755 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -363,7 +363,6 @@ $route['sendNotificationToOfficers'] = 'PD_Controller/sendNotificationToOfficers $route['getMasterForDataDump'] = 'Request_DataDump_Controller/getMasterForDataDump'; $route['getRequestForDataDump'] = 'Request_DataDump_Controller/getRequestForDataDump'; - $route['addgoogleCalenderEvent'] = 'GC_Event_Controller/addGoogleCalenterEvent';//dummy checking purpose $route['getEventList'] = 'GC_Event_Controller/getGoogleCalenderEventList';//dummy checking purpose $route['getEvent'] = 'GC_Event_Controller/getEventFromGoogleCalender';//dummy checking purpose @@ -371,4 +370,6 @@ $route['getEvent'] = 'GC_Event_Controller/getEventFromGoogleCalender';//dummy ch $route['createGmeetLink'] = 'PD_Controller/createGmeetLink'; //only developer testing, not for APP use $route['deleteCalenderEvent'] = 'PD_Controller/deleteCalenderEvent'; //only developer testing, not for APP use -$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'; + diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 59200487..02428358 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'); @@ -988,6 +989,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)) @@ -5104,6 +5106,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'); @@ -5195,9 +5198,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 { @@ -11870,6 +11881,7 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() } } $this->response($data,REST_Controller::HTTP_OK); + } /**** @@ -11915,4 +11927,72 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() } + + // 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($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); + // echo gettype($my_array); + if(!empty($my_array) && !empty($my_array["FaceMatches"])){ + $arr = $my_array["FaceMatches"]; + for($i=0;$i $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); + + $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'); + + // $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); + + $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'] = '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/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 5b444ce5..dfb9169c 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,20 @@ 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'=>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); @@ -1546,7 +1551,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 +1562,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; } } @@ -1566,6 +1573,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(); @@ -1637,17 +1659,17 @@ 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); 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); } - // echo $html_content;exit(); $pdf_name = $view_data['pd_master_details'][0]['main_applicant']; $new_pdf_name = "PD_Report_".$view_data['pd_master_details'][0]['main_applicant']; @@ -1860,6 +1882,50 @@ 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)){ + $pd_master_details = $this->PD_Model->getPDMasterDetails($get); + 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.'; + } + + + }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..c4e07112 --- /dev/null +++ b/api/application/helpers/cet_creditpd_helper.php @@ -0,0 +1,74 @@ +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_INTEGRATION_IMG_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 CREDIT 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 71% rename from api/application/helpers/salespd_cetapp_helper.php rename to api/application/helpers/cet_salespd_helper.php index 51b274e8..d6a2b51d 100644 --- a/api/application/helpers/salespd_cetapp_helper.php +++ b/api/application/helpers/cet_salespd_helper.php @@ -1,8 +1,8 @@ = 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; + $t_x2 = ($x1+$Face_width); + $t_y2 = $y1; + + //bottom line + $b_x1 = $x1; + $b_y1 = ($y1+$Face_height); + $b_x2 = ($x1+$Face_width); + $b_y2 = ($y1+$Face_height); + + $imgl = self::imagelinethick($img,$t_x1,$t_y1,$t_x2,$t_y2,$color,7);//top line + $imgl = self::imagelinethick($img,$b_x1,$b_y1,$b_x2,$b_y2,$color,7);//bottom line + $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 + $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); + // } + + } + + public static function imagelinethick($image, $x1, $y1, $x2, $y2, $color, $thick = 1) +{ + /* this way it works well only for orthogonal lines + imagesetthickness($image, $thick); + return imageline($image, $x1, $y1, $x2, $y2, $color); + */ + if ($thick == 1) { + return imageline($image, $x1, $y1, $x2, $y2, $color); + } + $t = $thick / 2 - 0.5; + if ($x1 == $x2 || $y1 == $y2) { + return imagefilledrectangle($image, round(min($x1, $x2) - $t), round(min($y1, $y2) - $t), round(max($x1, $x2) + $t), round(max($y1, $y2) + $t), $color); + } + $k = ($y2 - $y1) / ($x2 - $x1); //y = kx + q + $a = $t / sqrt(1 + pow($k, 2)); + $points = array( + round($x1 - (1+$k)*$a), round($y1 + (1-$k)*$a), + round($x1 - (1-$k)*$a), round($y1 - (1+$k)*$a), + round($x2 + (1+$k)*$a), round($y2 - (1-$k)*$a), + round($x2 + (1-$k)*$a), round($y2 + (1+$k)*$a), + ); + imagefilledpolygon($image, $points, 4, $color); + return imagepolygon($image, $points, 4, $color); +} + + +} +?> \ No newline at end of file diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index 8942e430..c16ddb65 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'] : "-"; @@ -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']." 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]['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']." 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 - $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']; $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,20 +799,22 @@ 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']."." ."
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]['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. "; + if(!empty($mail_id)){ $arg = array('mail'=>$mail_id,'pd_id'=>$pd_id,'msg'=>$msg,'subject'=>$subject); SELF::send_smcagencymail($CI,$arg); diff --git a/api/application/helpers/smc_creditpd_helper.php b/api/application/helpers/smc_creditpd_helper.php index 27b38faf..841bfb9a 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); @@ -34,6 +35,7 @@ class smc_creditpd break; case 8://assest $return_data = SELF::getAssestSectionData($section); + // print_r($return_data); break; case 11://supplier @@ -185,7 +187,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 +385,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'] .''; @@ -533,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 diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 9db9cc6e..6457d14b 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -1054,7 +1054,8 @@ 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.gmeet_code,PDTRIGGER.gmeet_id'); + + $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.gmeet_code,PDTRIGGER.gmeet_id,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 ''; }