From 60d0722edee3a2b35fdebbd3a1b1d44682c30002 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 25 May 2022 18:54:23 +0530 Subject: [PATCH] Face Image : ps --- api/application/config/routes.php | 2 ++ api/application/controllers/PD_Controller.php | 34 +++++++++---------- .../controllers/SMC_Credit_PD_Controller.php | 25 ++++++++++++-- api/application/helpers/faceapi_helper.php | 21 +++++++----- .../helpers/smc_creditpd_helper.php | 6 ++-- .../report_templates/JSONTOREPORT_CLIX.php | 18 +++++++--- .../JSONTOREPORT_CLIX_SMARTPD.php | 18 +++++++--- .../JSONTOREPORT_CLIX_TELE_PD.php | 20 ++++++++--- .../report_templates/JSONTOREPORT_DI_AI.php | 19 ++++++++--- .../JSONTOREPORT_DI_AI_ADDON.php | 18 +++++++--- .../JSONTOREPORT_DI_AI_SMARTPD.php | 19 ++++++++--- .../JSONTOREPORT_DI_AI_TELE_PD.php | 19 ++++++++--- .../report_templates/JSONTOREPORT_RI.php | 19 ++++++++--- .../JSONTOREPORT_RI_SMARTPD.php | 19 ++++++++--- .../JSONTOREPORT_RI_TELE_PD.php | 15 ++++++-- .../report_templates/JSONTOREPORT_SAL.php | 19 ++++++++--- .../JSONTOREPORT_SAL_SMARTPD.php | 19 ++++++++--- .../JSONTOREPORT_SAL_TELE_PD.php | 19 ++++++++--- 18 files changed, 249 insertions(+), 80 deletions(-) diff --git a/api/application/config/routes.php b/api/application/config/routes.php index cbbed1fb..c2c7e0d1 100755 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -373,3 +373,5 @@ $route['deleteCalenderEvent'] = 'PD_Controller/deleteCalenderEvent'; //only deve $route['getSalesPDReportforCETApp'] = 'Sales_PD_Controller/getSalesPDReportforCETApp'; $route['getCreditPDReportforCETApp'] = 'SMC_Credit_PD_Controller/getCreditPDReportforCETApp'; +// $route['faceMarkImage'] = 'PD_Controller/toMakeFaceBoundingBox'; + diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 02428358..8ee382fe 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -5196,18 +5196,11 @@ public function getPDFormDetailsJSON_post() { $data['pd_images']['common_images'] = $this->PD_Model->getSignedPDDocsURL($pdid,null,null,'common',null,'report'); } + // echo "i ahve image"; + // print_r($data['pd_images']);die(); $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 { @@ -6483,6 +6476,8 @@ public function getPDFormDetailsJSON_post() $data['pd_images']['common_images'] = $this->PD_Model->getSignedPDDocsURL($pdid,null,null,'common',null,'report'); } + // echo "i ahve image"; + // print_r($data['pd_images']);die(); // die(); //print_r(json_decode($data['pd_processed_forms'][24][0]['processed_json']));//die(); @@ -11928,7 +11923,7 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() - // public function facemark_get(){ + // public function toMakeFaceBoundingBox_get(){ public function toMakeFaceBoundingBox($master_details){ // $pdid = $this->get('pd');//pdid 3184 comment this $pdid = $master_details[0]['pd_id']; @@ -11956,7 +11951,7 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes'); // $temp_image_name = "sample.png"; - $temp_image_name = "face_api_image.png"; + $temp_image_name = "face_api_image.jpeg"; $destination_path = $this->external_path."/pd_reports/". $pdid ."/".$temp_image_name; file_put_contents($destination_path, file_get_contents($singed_uri)); @@ -11971,7 +11966,12 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() // print_r($s3result);die(); if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) { + //Update $this->db->WHERE('pd_id',$pdid)->UPDATE(PDTRIGGER,array('facemark_image_generated' => 1)); + + $record_data = array('fk_pd_id' => $pdid,'pd_document_title'=>'face_api_result_image','pd_document_name'=>$temp_image_name); + $this->PD_Model->saveRecords($record_data,PDDOCUMENTS); + unlink($destination_path); } // $data['dataStatus'] = true; @@ -11980,15 +11980,15 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() // $data['details'] = $bounding_box; } // else{ - // $data['dataStatus'] = false; - // $data['status'] = REST_Controller::HTTP_NO_CONTENT; - // $data['msg'] = 'Given PDID is Not in Completed Status'; + // $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'; + // $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/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index fa1bc610..e155a704 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1540,7 +1540,8 @@ public function filterSalesPDList_post() { // Using borrower_details in $pd_section_data To Get the company name for SMC Credit PD => MWISE; $companylist = $this->getCompanyName($pd_section_data[0]); $view_data['company'] = $companylist ; - + $filter_form_id =array(); + // $officerdetails_form_id =array(1,4,21); if(count($pd_section_data)) { foreach ($pd_section_data as $key => $value) @@ -1548,7 +1549,7 @@ public function filterSalesPDList_post() { if(isset($value['json']) && $value['json'] != '') { $value['json'] = smc_creditpd::getSMCCreditPDReportContent($value,$records['pd_id'],$companylist); - + $filter_form_id[$key] = $value['fk_form_id']; // 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']; @@ -1562,6 +1563,7 @@ 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; + $filter_form_id[$key] = $value['fk_form_id']; $CETAPP_creditPD_data[$value['form_name']] = $data_from_excel; // $CETAPP_creditPD_data[$value['fk_form_id']]= $data_from_excel; @@ -1570,6 +1572,8 @@ public function filterSalesPDList_post() { //die(); } } + + // print_r($filter_form_id);die(); // 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); @@ -1663,7 +1667,24 @@ 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(); + if((in_array(1,$filter_form_id)) && (in_array(4,$filter_form_id))) + // && (in_array(21,$filter_form_id))) + { + $officer_id = $view_data['pd_master_details'][0]['fk_updatedby']; + $visit_date = $view_data['pd_master_details'][0]['pd_visit_date']; + + $officer_details = $this->SMC_Credit_PD_Model->selectCustomRecords(array('userid as officer_id', 'email','mobile_no','concat(first_name," ",last_name) as officer'),array('userid' => $officer_id),USERPROFILE); + if(!empty($officer_details)){ + foreach($officer_details as $key=>$value) { + $CETAPP_creditPD_data['Officer Details'] = $value; + $CETAPP_creditPD_data['Officer Details']['pd_visit_date'] = $visit_date; + } + } + } 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{ diff --git a/api/application/helpers/faceapi_helper.php b/api/application/helpers/faceapi_helper.php index ca03da2b..ac3734a2 100644 --- a/api/application/helpers/faceapi_helper.php +++ b/api/application/helpers/faceapi_helper.php @@ -67,15 +67,20 @@ class faceapi // 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, $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); - // } + $get_image_format = explode(".",$destination_path); + $image_format = $get_image_format[1]; + + if($image_format == 'png'){ + $destination_path = $get_image_format[0].".jpeg"; + imagepng($img, $destination_path); + }else if($image_format == 'jpeg'){ + imagejpeg($img, $destination_path); + }else if($image_format == 'jpg'){ + $destination_path = $get_image_format[0].".jpeg"; + imagepng($img, $destination_path); + } } diff --git a/api/application/helpers/smc_creditpd_helper.php b/api/application/helpers/smc_creditpd_helper.php index 66fff635..ccf662f8 100644 --- a/api/application/helpers/smc_creditpd_helper.php +++ b/api/application/helpers/smc_creditpd_helper.php @@ -70,7 +70,7 @@ class smc_creditpd break; case 13://stock - $return_data = SELF::getStockSectionData($section); + $return_data = SELF::getStockSectionData($section,$company); break; case 15://existing loan @@ -577,8 +577,8 @@ class smc_creditpd $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'); + $json['pd_officer_recommendation_name'] = isset($json['pd_officer_recommendation'])? $pd_officer_recommandations[$json['pd_officer_recommendation']] : 'NA'; + $json['customer_behaviour_name'] = (isset($json['customer_behaviour']) ? $customer_behaviour[ $json['customer_behaviour'] ] : 'NA'); // echo 'json***'; // print_r($json); return $json; diff --git a/api/application/views/report_templates/JSONTOREPORT_CLIX.php b/api/application/views/report_templates/JSONTOREPORT_CLIX.php index 3f379801..9d0161c0 100644 --- a/api/application/views/report_templates/JSONTOREPORT_CLIX.php +++ b/api/application/views/report_templates/JSONTOREPORT_CLIX.php @@ -711,10 +711,20 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } - if(isset($pd_master_details[0]['face_api_image'])) - { - echo ''; - } + $faceimage_url = ''; + if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $pd_master_details[0]['facemark_image_generated'] == 1 && $pd_master_details[0]['is_face_api_enabled'] == 1) + { + foreach($pd_images['common_images'] as $com_key => $com_value) + { + if($com_value['pd_document_title'] == 'face_api_result_image') + { + $faceimage_url = $com_value['doc_url'];break; + } + } + } + if(!empty($faceimage_url)){ + 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 f134965a..4bcf0aef 100644 --- a/api/application/views/report_templates/JSONTOREPORT_CLIX_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_CLIX_SMARTPD.php @@ -718,10 +718,20 @@ font-weight: bolder;; } - if(isset($pd_master_details[0]['face_api_image'])) - { - echo ''; - } + $faceimage_url = ''; + if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $pd_master_details[0]['facemark_image_generated'] == 1 && $pd_master_details[0]['is_face_api_enabled'] == 1) + { + foreach($pd_images['common_images'] as $com_key => $com_value) + { + if($com_value['pd_document_title'] == 'face_api_result_image') + { + $faceimage_url = $com_value['doc_url'];break; + } + } + } + if(!empty($faceimage_url)){ + 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 12e374bd..3ad97edf 100644 --- a/api/application/views/report_templates/JSONTOREPORT_CLIX_TELE_PD.php +++ b/api/application/views/report_templates/JSONTOREPORT_CLIX_TELE_PD.php @@ -712,10 +712,22 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } - if(isset($pd_master_details[0]['face_api_image'])) - { - echo ''; - } + $faceimage_url = ''; + if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $pd_master_details[0]['facemark_image_generated'] == 1 && $pd_master_details[0]['is_face_api_enabled'] == 1) + { + foreach($pd_images['common_images'] as $com_key => $com_value) + { + if($com_value['pd_document_title'] == 'face_api_result_image') + { + $faceimage_url = $com_value['doc_url'];break; + } + } + } + if(!empty($faceimage_url)){ + 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 4f21200e..d1545529 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php @@ -708,10 +708,21 @@ if ( isset($pdf) ) { } - if(isset($pd_master_details[0]['face_api_image'])) - { - echo ''; - } + $faceimage_url = ''; + // if(isset($pd_images['common_images']) && count($pd_images['common_images'])) + if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $pd_master_details[0]['facemark_image_generated'] == 1 && $pd_master_details[0]['is_face_api_enabled'] == 1) + { + foreach($pd_images['common_images'] as $com_key => $com_value) + { + if($com_value['pd_document_title'] == 'face_api_result_image') + { + $faceimage_url = $com_value['doc_url'];break; + } + } + } + if(!empty($faceimage_url)){ + 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 ea404569..8d8ae3e5 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php @@ -691,10 +691,20 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } - if(isset($pd_master_details[0]['face_api_image'])) - { - echo ''; - } + $faceimage_url = ''; + if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $pd_master_details[0]['facemark_image_generated'] == 1 && $pd_master_details[0]['is_face_api_enabled'] == 1) + { + foreach($pd_images['common_images'] as $com_key => $com_value) + { + if($com_value['pd_document_title'] == 'face_api_result_image') + { + $faceimage_url = $com_value['doc_url'];break; + } + } + } + if(!empty($faceimage_url)){ + 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 ab951371..d84772d8 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_SMARTPD.php @@ -712,10 +712,21 @@ if ( isset($pdf) ) { } - if(isset($pd_master_details[0]['face_api_image'])) - { - echo ''; - } + $faceimage_url = ''; + // if(isset($pd_images['common_images']) && count($pd_images['common_images'])) + if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $pd_master_details[0]['facemark_image_generated'] == 1 && $pd_master_details[0]['is_face_api_enabled'] == 1) + { + foreach($pd_images['common_images'] as $com_key => $com_value) + { + if($com_value['pd_document_title'] == 'face_api_result_image') + { + $faceimage_url = $com_value['doc_url'];break; + } + } + } + if(!empty($faceimage_url)){ + 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 2a58b28f..19f3bbba 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,10 +710,21 @@ if ( isset($pdf) ) { } - if(isset($pd_master_details[0]['face_api_image'])) - { - echo ''; - } + $faceimage_url = ''; + // if(isset($pd_images['common_images']) && count($pd_images['common_images'])) + if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $pd_master_details[0]['facemark_image_generated'] == 1 && $pd_master_details[0]['is_face_api_enabled'] == 1) + { + foreach($pd_images['common_images'] as $com_key => $com_value) + { + if($com_value['pd_document_title'] == 'face_api_result_image') + { + $faceimage_url = $com_value['doc_url'];break; + } + } + } + if(!empty($faceimage_url)){ + echo ''; + } echo ''; echo '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_RI.php b/api/application/views/report_templates/JSONTOREPORT_RI.php index 3f35704a..fbe821dc 100644 --- a/api/application/views/report_templates/JSONTOREPORT_RI.php +++ b/api/application/views/report_templates/JSONTOREPORT_RI.php @@ -678,10 +678,21 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } - if(isset($pd_master_details[0]['face_api_image'])) - { - echo ''; - } + $faceimage_url = ''; + // if(isset($pd_images['common_images']) && count($pd_images['common_images'])) + if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $pd_master_details[0]['facemark_image_generated'] == 1 && $pd_master_details[0]['is_face_api_enabled'] == 1) + { + foreach($pd_images['common_images'] as $com_key => $com_value) + { + if($com_value['pd_document_title'] == 'face_api_result_image') + { + $faceimage_url = $com_value['doc_url'];break; + } + } + } + if(!empty($faceimage_url)){ + 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 335c3569..ca52f3a6 100644 --- a/api/application/views/report_templates/JSONTOREPORT_RI_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_RI_SMARTPD.php @@ -678,10 +678,21 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } - if(isset($pd_master_details[0]['face_api_image'])) - { - echo ''; - } + $faceimage_url = ''; + // if(isset($pd_images['common_images']) && count($pd_images['common_images'])) + if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $pd_master_details[0]['facemark_image_generated'] == 1 && $pd_master_details[0]['is_face_api_enabled'] == 1) + { + foreach($pd_images['common_images'] as $com_key => $com_value) + { + if($com_value['pd_document_title'] == 'face_api_result_image') + { + $faceimage_url = $com_value['doc_url'];break; + } + } + } + if(!empty($faceimage_url)){ + 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 eaf748ab..1f0cca5b 100644 --- a/api/application/views/report_templates/JSONTOREPORT_RI_TELE_PD.php +++ b/api/application/views/report_templates/JSONTOREPORT_RI_TELE_PD.php @@ -679,10 +679,21 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } - if(isset($pd_master_details[0]['face_api_image'])) + $faceimage_url = ''; + // if(isset($pd_images['common_images']) && count($pd_images['common_images'])) + if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $pd_master_details[0]['facemark_image_generated'] == 1 && $pd_master_details[0]['is_face_api_enabled'] == 1) + { + foreach($pd_images['common_images'] as $com_key => $com_value) { - echo ''; + if($com_value['pd_document_title'] == 'face_api_result_image') + { + $faceimage_url = $com_value['doc_url'];break; + } } + } + if(!empty($faceimage_url)){ + echo ''; + } echo ''; echo '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_SAL.php b/api/application/views/report_templates/JSONTOREPORT_SAL.php index 9ffcf710..b4b6a6de 100644 --- a/api/application/views/report_templates/JSONTOREPORT_SAL.php +++ b/api/application/views/report_templates/JSONTOREPORT_SAL.php @@ -682,10 +682,21 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } //echo ''; } - if(isset($pd_master_details[0]['face_api_image'])) - { - echo ''; - } + $faceimage_url = ''; + // if(isset($pd_images['common_images']) && count($pd_images['common_images'])) + if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $pd_master_details[0]['facemark_image_generated'] == 1 && $pd_master_details[0]['is_face_api_enabled'] == 1) + { + foreach($pd_images['common_images'] as $com_key => $com_value) + { + if($com_value['pd_document_title'] == 'face_api_result_image') + { + $faceimage_url = $com_value['doc_url'];break; + } + } + } + if(!empty($faceimage_url)){ + 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 77da3251..b541cd3d 100644 --- a/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php @@ -689,10 +689,21 @@ font-weight: bolder;; } //echo ''; } - if(isset($pd_master_details[0]['face_api_image'])) - { - echo ''; - } + $faceimage_url = ''; + // if(isset($pd_images['common_images']) && count($pd_images['common_images'])) + if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $pd_master_details[0]['facemark_image_generated'] == 1 && $pd_master_details[0]['is_face_api_enabled'] == 1) + { + foreach($pd_images['common_images'] as $com_key => $com_value) + { + if($com_value['pd_document_title'] == 'face_api_result_image') + { + $faceimage_url = $com_value['doc_url'];break; + } + } + } + if(!empty($faceimage_url)){ + 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 5458f0f8..4e925012 100644 --- a/api/application/views/report_templates/JSONTOREPORT_SAL_TELE_PD.php +++ b/api/application/views/report_templates/JSONTOREPORT_SAL_TELE_PD.php @@ -681,10 +681,21 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } - if(isset($pd_master_details[0]['face_api_image'])) - { - echo ''; - } + $faceimage_url = ''; + // if(isset($pd_images['common_images']) && count($pd_images['common_images'])) + if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $pd_master_details[0]['facemark_image_generated'] == 1 && $pd_master_details[0]['is_face_api_enabled'] == 1) + { + foreach($pd_images['common_images'] as $com_key => $com_value) + { + if($com_value['pd_document_title'] == 'face_api_result_image') + { + $faceimage_url = $com_value['doc_url'];break; + } + } + } + if(!empty($faceimage_url)){ + echo ''; + } echo ''; } echo '
';