From 215faf61c01ebb1ba5a38a877866c0016a01bec5 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Tue, 11 Oct 2022 09:25:06 +0530 Subject: [PATCH] Face Crop Issues Fixes : ps --- api/application/controllers/PD_Controller.php | 66 ++++++++++--------- api/application/helpers/faceapi_helper.php | 16 ++--- .../report_templates/JSONTOREPORT_CLIX.php | 26 ++++---- .../JSONTOREPORT_CLIX_SMARTPD.php | 27 ++++---- .../JSONTOREPORT_CLIX_TELE_PD.php | 30 ++++----- .../report_templates/JSONTOREPORT_DI_AI.php | 58 +++++----------- .../JSONTOREPORT_DI_AI_ADDON.php | 27 ++++---- .../JSONTOREPORT_DI_AI_SMARTPD.php | 26 ++++---- .../JSONTOREPORT_DI_AI_TELE_PD.php | 4 +- .../report_templates/JSONTOREPORT_RI.php | 14 ++++ .../JSONTOREPORT_RI_SMARTPD.php | 14 +++- .../JSONTOREPORT_RI_TELE_PD.php | 13 ++++ .../report_templates/JSONTOREPORT_SAL.php | 8 +++ .../JSONTOREPORT_SAL_SMARTPD.php | 14 ++++ .../JSONTOREPORT_SAL_TELE_PD.php | 14 ++++ 15 files changed, 205 insertions(+), 152 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index a52e71a2..4c2ec694 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -908,7 +908,7 @@ class PD_Controller extends REST_Controller if ($pd_details['pd_status'] == COMPLETED) { $pd_details['complete_override_data'] = isset($pd_details['complete_override_data']) ? json_encode($pd_details['complete_override_data']) : null; $pd_details['completed_on'] = date('Y-m-d H:i:s'); - log_message('ERROR', "In PD Controller (When Completed status means calling to Make FaceBoundingBox fns below"); + log_message('ERROR', "In PD Ctrl (When Completed status means calling to Make FaceBoundingBox fns below"); // $this->toMakeFaceBoundingBox($exist_pd_details); $this->toMakeFaceBoundingBox($pd_details['pd_id'],$exist_pd_details[0]['fk_lender_id']); if(isset($pd_details['is_this_smc_pd']) && $pd_details['is_this_smc_pd'] == 1 && $pd_details['pd_status'] == COMPLETED){ @@ -5876,8 +5876,8 @@ class PD_Controller extends REST_Controller } } $data['facecrop'] = $fc_array; - - // print_r($data['add_on_pd_images']); + // print_r($db_result); + // print_r($data['facecrop']); // die(); // print_r($data);die(); $t = ""; @@ -10579,11 +10579,11 @@ class PD_Controller extends REST_Controller // $master_details = $this->PD_Model->getPDMasterDetails($pdid); //comment this bcoz test purpose // $len_id = $master_details[0]['fk_lender_id']; //comment this bcoz test purpose - log_message('ERROR', "In PD Controller (to Make FaceBoundingBox called ) PDID : " . $pdid); + log_message('ERROR', "In PD Ctrl (to Make FaceBoundingBox called ) PDID : " . $pdid); $where = array('isactive' => 1, 'fk_form_id' => 18, 'fk_pd_id' => $pdid); $details = $this->PD_Model->selectCustomRecords(array('json'), $where, PDFORMDETAILSJSON); - // echo "I have"; - // print_r($rec);die(); + + ## Here i am get person met applicant id's $applicant_id_arr = array(); if (isset($details[0]['json'])) { $json = json_decode($details[0]['json'], true); @@ -10594,29 +10594,31 @@ class PD_Controller extends REST_Controller } } + ## Here i am using that applicant id's to get facemark api result.(in applicant table) $where_condition_array = array('fk_pd_id' => $pdid, 'isactive' => 1); $where_condition_array['faceapi_result is NOT NULL'] = null; if(!empty($applicant_id_arr)){ $where_condition_array['pd_co_applicant_id in ('.implode(",",$applicant_id_arr).')'] = null; } $applicants_details = $this->PD_Model->selectCustomRecords(array('pd_co_applicant_id', 'applicant_name', 'faceapi_result', 'facemark_image_generated', 'facecrop'), $where_condition_array, PDAPPLICANTSDETAILS); - // print_r($applicants_details);die(); + // echo "working fine"; + + ## Here i am check applicant id and applicant details and pdid. if (!empty($applicant_id_arr) && !empty($applicants_details) && !empty($pdid)) { - log_message('ERROR', "In PD Controller (to Make FaceBoundingBox called ) Total Applicant : " . count($applicants_details)); - log_message('ERROR', "In PD Controller (to Make FaceBoundingBox called ) Total Person Met Applicant : " . count($applicant_id_arr)); + log_message('ERROR', "In PD Ctrl (to Make FaceBoundingBox called ) Total Applicant : " . count($applicants_details)); + log_message('ERROR', "In PD Ctrl (to Make FaceBoundingBox called ) Total Person Met Applicant : " . count($applicant_id_arr)); for ($j = 0; $j < count($applicants_details); $j++) { $bounding_box = array(); $img_response = array(); $apcntid = $applicants_details[$j]['pd_co_applicant_id']; - //$master_details = $this->PD_Model->getPDMasterDetails($pdid);//comment this + // $master_details = $this->PD_Model->getPDMasterDetails($pdid);//comment this if (!$applicants_details[$j]['facemark_image_generated']) { log_message('ERROR', $applicants_details[$j]['applicant_name'] . " Facemark Image Generated : " . $applicants_details[$j]['facemark_image_generated']); $string = $applicants_details[$j]['faceapi_result']; // echo gettype($string); $faceapi_result_decode = json_decode($string, true); - // echo gettype($faceapi_result_decode); if (!empty($faceapi_result_decode) && !empty($faceapi_result_decode["FaceMatches"])) { $arr = $faceapi_result_decode["FaceMatches"]; log_message('ERROR', $applicants_details[$j]['applicant_name'] . " FaceMatched array cnt : " . count($arr)); @@ -10628,13 +10630,13 @@ class PD_Controller extends REST_Controller if (!empty($faceapi_result_decode) && !empty($faceapi_result_decode["SourceImageFace"])) { $bounding_box['source_image'] = $faceapi_result_decode["SourceImageFace"]['BoundingBox']; } + // print_r($bounding_box);//working fine $where_condition_array = array('fk_pd_id' => $pdid, 'isactive' => 1,'co_applicant_id'=>$apcntid); - $where_condition_array['image_key in ("selfie_with_person_met","person_met_id")'] = null; - $select_col = array('pd_document_id', 'pd_document_name', 'pd_document_title', 'image_key'); + // $where_condition_array['image_key in ("selfie_with_person_met","person_met_id")'] = null; + $where_condition_array['img_type in ("1","2")'] = null; + $select_col = array('pd_document_id', 'pd_document_name', 'pd_document_title', 'image_key','img_type'); $img_result = $this->PD_Model->selectCustomRecords($select_col, $where_condition_array, PDDOCUMENTS); - // echo count($img_result); - // print_r($img_result); if (count($img_result) > 0) { @@ -10651,12 +10653,14 @@ class PD_Controller extends REST_Controller $info = getimagesize($destination_path . $file_name); $extension = image_type_to_extension($info[2]); // echo '-- extension'.$extension.$file_name; - log_message('ERROR', "In PD Controller to Make FaceBoundingBox FaceMatches inx " . $k . " singed_uri : " . $singed_uri); + log_message('ERROR', "In PD Ctrl to Make FaceBoundingBox FaceMatches inx " . $k . " singed_uri : " . $singed_uri); // echo $j.$k; - $response = faceapi::toMakeFaceBoundingBox($bounding_box, $destination_path, $file_name, $img_result[$k]['image_key'], $apcntid); + // $response = faceapi::toMakeFaceBoundingBox($bounding_box, $destination_path, $file_name, $img_result[$k]['image_key'], $apcntid); + $response = faceapi::toMakeFaceBoundingBox($bounding_box, $destination_path, $file_name, $img_result[$k]['img_type'], $apcntid); array_push($img_response, $response); - if (($img_result[$k]['image_key'] == 'selfie_with_person_met')) { + // if (($img_result[$k]['image_key'] == 'selfie_with_person_met')) { + if (($img_result[$k]['img_type'] == '1')) { $this->uploadPicInS3($pdid, $destination_path, $bucketname, $applicants_details[$j]['pd_co_applicant_id'],$extension); } @@ -10673,7 +10677,7 @@ class PD_Controller extends REST_Controller } $update_where = array('fk_pd_id' => $pdid, 'pd_co_applicant_id' => $apcntid); $this->PD_Model->updateRecords(['facecrop' => json_encode($img_response)], PDAPPLICANTSDETAILS, $update_where); - log_message('ERROR', "In PD Controller to Make FaceBoundingBox Done"); + // log_message('ERROR', "In PD Ctrl to Make FaceBoundingBox Done"); // $data['dataStatus'] = true; // $data['status'] = REST_Controller::HTTP_OK; // $data['msg'] = 'Success '; @@ -10681,20 +10685,20 @@ class PD_Controller extends REST_Controller // $data['arrDetails'] = $bounding_box; // $data['imgResponse'] = $img_response; } else { - log_message('ERROR', "In PD Controller to Make FaceBoundingBox No Images On DB"); + log_message('ERROR', "In PD Ctrl to Make FaceBoundingBox No Images On DB"); // $data['dataStatus'] = false; // $data['status'] = REST_Controller::HTTP_NO_CONTENT; // $data['msg'] = 'Faceapi Image Already Generated'; } } else { - log_message('ERROR', "In PD Controller to Make FaceBoundingBox Faceapi Image Already Generated"); + log_message('ERROR', "In PD Ctrl to Make FaceBoundingBox Faceapi Image Already Generated"); // $data['dataStatus'] = false; // $data['status'] = REST_Controller::HTTP_NO_CONTENT; // $data['msg'] = 'Faceapi Image Already Generated 2'; } } // for @ $applicants_details = j } else { - log_message('ERROR', "In PD Controller to Make FaceBoundingBox Applicant is Not Available"); + log_message('ERROR', "In PD Ctrl to Make FaceBoundingBox Applicant is Not Available"); // $data['dataStatus'] = false; // $data['status'] = REST_Controller::HTTP_NO_CONTENT; // $data['msg'] = 'Applicant is Not Available'; @@ -10705,27 +10709,29 @@ class PD_Controller extends REST_Controller } public function uploadPicInS3($pdid,$destination_path,$bucketname,$apcntid,$extension){ + log_message('ERROR', "In PD Ctrl uploadPicInS3 destinationPath : " . $destination_path); $file = "face_api_image_".$apcntid.$extension; $dbfile = "face_api_image_".$apcntid.".jpeg"; $key = 'pd' . $pdid . '/' . $file; $image = imagecreatefrompng($destination_path.$file); - $sourcefile = imagejpeg($image, $destination_path.$dbfile, '70'); - // die(); + imagejpeg($image, $destination_path.$dbfile, '70'); // imagedestroy($image); - $sourcefile = $destination_path.$dbfile; + // $output_file = $this->external_path . "/pd_reports/" . $pdid . "/".$dbfile; + // log_message('ERROR', "In PD Ctrl uploadPicInS3 sourcefilename : " . $destination_path.$dbfile); // $sourcefile = imagejpeg($destination_path.$file, $destination_path.$dbfile,'70'); - $bucket_data = array('bucket_name' => $bucketname, 'key' => $key, 'sourcefile' => $sourcefile); + $bucket_data = array('bucket_name' => $bucketname, 'key' => $key, 'sourcefile' => $destination_path.$dbfile); $s3result = $this->aws_s3->uploadFileToS3Bucket($bucket_data); - log_message('ERROR', "In PD Controller to Make FaceBoundingBox FaceMatches s3result : " . $s3result['@metadata']['statusCode']); - // print_r($s3result);die(); + log_message('ERROR', "In PD Ctrl uploadPicInS3 s3 status : " . $s3result['@metadata']['statusCode']); + log_message('ERROR', "In PD Ctrl uploadPicInS3 s3 result : " .json_encode($s3result)); + if (is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) { - log_message('ERROR', "In PD Controller to Make FaceBoundingBox updating pdtrigger table facemark_image_generated as 1"); + log_message('ERROR', "In PD Ctrl uploadPicInS3 updating pdapplicant table facemark_image_generated as 1"); // Make inactive old entries with same data $this->db->WHERE('fk_pd_id', $pdid) ->WHERE('pd_document_title', 'face_api_result_image_'.$apcntid)->UPDATE(PDDOCUMENTS, array('isactive' => 0)); // then update $this->db->WHERE('fk_pd_id', $pdid)->WHERE('pd_co_applicant_id', $apcntid)->UPDATE(PDAPPLICANTSDETAILS, array('facemark_image_generated' => 1)); - log_message('ERROR', "In PD Controller to Make FaceBoundingBox save document table face_api_result_image after unlink"); + log_message('ERROR', "In PD Ctrl uploadPicInS3 save document table face_api_result_image after unlink"); $record_data = array('fk_pd_id' => $pdid, 'pd_document_title' => 'face_api_result_image_'.$apcntid, 'pd_document_name' => $dbfile ,'co_applicant_id'=>$apcntid,'image_key'=>'face_mark'); $this->PD_Model->saveRecords($record_data, PDDOCUMENTS); unlink($destination_path.$file); diff --git a/api/application/helpers/faceapi_helper.php b/api/application/helpers/faceapi_helper.php index 30489599..e9ea5c5b 100644 --- a/api/application/helpers/faceapi_helper.php +++ b/api/application/helpers/faceapi_helper.php @@ -2,18 +2,18 @@ class faceapi { - public static function toMakeFaceBoundingBox($bounding_box, $path, $file_name, $key,$apcntid) + public static function toMakeFaceBoundingBox($bounding_box, $path, $file_name, $type,$apcntid) { // ($image_name,$BoundingBox,$destination_path,$extension){ - log_message('ERROR', "In faceapi helper @ line no : 6 to Make FaceBoundingBox", $path, $file_name); + log_message('ERROR', "In faceapi helper @6 to Make FaceBoundingBox", $path, $file_name); $file_path = $path . $file_name; // $red = imagecolorallocate($img, 255, 0, 0); // $black = imagecolorallocate($img, 0, 0, 0); // $white = imagecolorallocate($img, 255, 255, 255); list($imagewidth, $imageheight) = getimagesize($file_path); - log_message('ERROR', 'In faceapi helper @ line no : 25 to Make FaceBoundingBox image_width' . $imagewidth . 'image_height' . $imageheight); + log_message('ERROR', 'In faceapi helper @25 to Make FaceBoundingBox image_width' . $imagewidth . 'image_height' . $imageheight); if (count($bounding_box) > 0) { $response = array(); @@ -22,7 +22,7 @@ class faceapi $info = getimagesize($file_path); $extension = image_type_to_extension($info[2]); $SrcBoundingBox = $bounding_box['source_image']; - if (count($CmpBoundingBox) > 0 && ($key == 'selfie_with_person_met')) { + if (count($CmpBoundingBox) > 0 && ($type == '1')) { $destination_path = $path . 'face_api_image_'.$apcntid . $extension; if (!copy($file_path, $destination_path)) { log_message('ERROR', 'failed to copy'); @@ -74,7 +74,7 @@ class faceapi public static function DrawLine($x1, $y1, $Face_width, $Face_height, $Similarity, $img, $destination_path) { - log_message('ERROR', 'In faceapi helper @ line no : 45 Draw Line x1 : ' . $x1 . ' y1 : ' . $y1 . ' Face_width : ' . $Face_width . ' Face_height : ' . $Face_height . ' Similarity : ' . $Similarity . ' img : ' . $img . ' destination_path : ' . $destination_path); + // log_message('ERROR', 'In faceapi helper @45 Draw Line x1 : ' . $x1 . ' y1 : ' . $y1 . ' Face_width : ' . $Face_width . ' Face_height : ' . $Face_height . ' Similarity : ' . $Similarity . ' img : ' . $img . ' destination_path : ' . $destination_path); $Similarity_split = explode(".", $Similarity); $Similarity_value = $Similarity_split[0]; list($imagewidth, $imageheight) = getimagesize($destination_path); @@ -86,7 +86,7 @@ class faceapi $color = imagecolorallocate($img, 255, 0, 0); } $white = imagecolorallocate($img, 255, 255, 255); - log_message('ERROR', 'In faceapi helper @ line no : 45 Draw Line color : ' . $color); + // log_message('ERROR', 'In faceapi helper @45 Draw Line color : ' . $color); $Similarity = $Similarity_value . " %"; //TOP LINe $t_x1 = $x1; @@ -158,9 +158,9 @@ class faceapi public static function imgCrop($x1, $y1, $Face_width, $Face_height, $Similarity, $img, $destination_path, $i,$apcntid) { $temp_image_name = $i === null ? "id_proof_crop_".$apcntid.".png" : "face_crop_".$apcntid."_" . $i . ".png"; - log_message('ERROR', 'In faceapi helper - imgCrop @ line no : 126 x1 : ' . $x1 . ' y1 : ' . $y1 . ' Face_width : ' . $Face_width . ' Face_height : ' . $Face_height . ' Similarity : ' . $Similarity . ' img : ' . $img . ' destination_path : ' . $destination_path); + // log_message('ERROR', 'In faceapi helper - imgCrop @126 x1 : ' . $x1 . ' y1 : ' . $y1 . ' Face_width : ' . $Face_width . ' Face_height : ' . $Face_height . ' Similarity : ' . $Similarity . ' img : ' . $img . ' destination_path : ' . $destination_path); $destination_path_2 = preg_replace('#/\w+(\.\w+)$#', '/' . $temp_image_name, $destination_path); - log_message('ERROR', 'In faceapi helper - imgCrop @ line no : 126 destination_path b4 : ' . $destination_path . ' destination_path after : ' . $destination_path_2); + log_message('ERROR', 'In faceapi helper - imgCrop @126 destination_path b4 : ' . $destination_path . ' destination_path after : ' . $destination_path_2); $to_crop_array = array('x' => $x1, 'y' => $y1, 'width' => $Face_width, 'height' => $Face_height); $dest = imagecrop($img, $to_crop_array); $get_image_format = explode(".", $destination_path); diff --git a/api/application/views/report_templates/JSONTOREPORT_CLIX.php b/api/application/views/report_templates/JSONTOREPORT_CLIX.php index 9b3b1952..e8db1392 100644 --- a/api/application/views/report_templates/JSONTOREPORT_CLIX.php +++ b/api/application/views/report_templates/JSONTOREPORT_CLIX.php @@ -623,6 +623,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name; $temp_person_met['photo'] = ''; $temp_person_met['id_proof'] = ''; + $temp_person_met['face_compare'] = ''; foreach($pd_images[18] as $pm_Key => $pm_value) { @@ -638,6 +639,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['id_proof'] = $pm_value['doc_url'] ; } } + foreach($pd_images['common_images'] as $com_key => $com_value) + { + + if($com_value['image_key'] == 'face_mark' && $com_value['co_applicant_id'] == $individual['pd_co_applicant_id']){ + $temp_person_met['face_compare'] = $com_value['doc_url'] ; + } + } $company_relationship_data = null; foreach($general_form['company_with_relationships'] as $company_with_relationship) { @@ -709,23 +717,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { echo ''; } + if($person['face_compare']) + { + echo '     '; + echo ''; + } //echo count($person_met_data) != ($pk+1)? '
':''; - } - $faceimage_url = array(); - for ($i = 0; $i < count($all_applicant_details); $i++) { - if($all_applicant_details[$j]['facemark_image_generated'] == 1){ - $faceimage_url = $com_value['doc_url']; - break; - } - } - if(!empty($faceimage_url)){ - for ($i = 0; $i < count($faceimage_url); $i++) { - echo '     '; - 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 029a7781..c1e8a163 100644 --- a/api/application/views/report_templates/JSONTOREPORT_CLIX_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_CLIX_SMARTPD.php @@ -630,6 +630,7 @@ font-weight: bolder;; $temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name; $temp_person_met['photo'] = ''; $temp_person_met['id_proof'] = ''; + $temp_person_met['face_compare'] = ''; foreach($pd_images[18] as $pm_Key => $pm_value) { @@ -645,6 +646,13 @@ font-weight: bolder;; $temp_person_met['id_proof'] = $pm_value['doc_url'] ; } } + foreach($pd_images['common_images'] as $com_key => $com_value) + { + + if($com_value['image_key'] == 'face_mark' && $com_value['co_applicant_id'] == $individual['pd_co_applicant_id']){ + $temp_person_met['face_compare'] = $com_value['doc_url'] ; + } + } $company_relationship_data = null; foreach($general_form['company_with_relationships'] as $company_with_relationship) { @@ -716,23 +724,14 @@ font-weight: bolder;; { echo ''; } - + if($person['face_compare']) + { + echo '     '; + echo ''; + } //echo count($person_met_data) != ($pk+1)? '
':''; - } - $faceimage_url = array(); - for ($i = 0; $i < count($all_applicant_details); $i++) { - if($all_applicant_details[$j]['facemark_image_generated'] == 1){ - $faceimage_url = $com_value['doc_url']; - break; - } - } - if(!empty($faceimage_url)){ - for ($i = 0; $i < count($faceimage_url); $i++) { - echo '     '; - 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 1b3e70f7..9bb757ce 100644 --- a/api/application/views/report_templates/JSONTOREPORT_CLIX_TELE_PD.php +++ b/api/application/views/report_templates/JSONTOREPORT_CLIX_TELE_PD.php @@ -624,6 +624,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name; $temp_person_met['photo'] = ''; $temp_person_met['id_proof'] = ''; + $temp_person_met['face_compare'] = ''; foreach($pd_images[18] as $pm_Key => $pm_value) { @@ -639,6 +640,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['id_proof'] = $pm_value['doc_url'] ; } } + foreach($pd_images['common_images'] as $com_key => $com_value) + { + + if($com_value['image_key'] == 'face_mark' && $com_value['co_applicant_id'] == $individual['pd_co_applicant_id']){ + $temp_person_met['face_compare'] = $com_value['doc_url'] ; + } + } $company_relationship_data = null; foreach($general_form['company_with_relationships'] as $company_with_relationship) { @@ -710,23 +718,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { echo ''; } + echo '     '; + if($person['face_compare']) + { + echo '     '; + echo ''; + } //echo count($person_met_data) != ($pk+1)? '
':''; - - - } - $faceimage_url = array(); - for ($i = 0; $i < count($all_applicant_details); $i++) { - if($all_applicant_details[$j]['facemark_image_generated'] == 1){ - $faceimage_url = $com_value['doc_url']; - break; - } - } - if(!empty($faceimage_url)){ - for ($i = 0; $i < count($faceimage_url); $i++) { - 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 5a92f771..3ee47170 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php @@ -1,6 +1,7 @@ @@ -627,6 +628,7 @@ if ( isset($pdf) ) { $temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name; $temp_person_met['photo'] = ''; $temp_person_met['id_proof'] = ''; + $temp_person_met['face_compare'] = ''; foreach($pd_images[18] as $pm_Key => $pm_value) { @@ -642,6 +644,13 @@ if ( isset($pdf) ) { $temp_person_met['id_proof'] = $pm_value['doc_url'] ; } } + foreach($pd_images['common_images'] as $com_key => $com_value) + { + + if($com_value['image_key'] == 'face_mark' && $com_value['co_applicant_id'] == $individual['pd_co_applicant_id']){ + $temp_person_met['face_compare'] = $com_value['doc_url'] ; + } + } $company_relationship_data = null; foreach($general_form['company_with_relationships'] as $company_with_relationship) { @@ -713,53 +722,18 @@ if ( isset($pdf) ) { { echo ''; } - - //echo count($person_met_data) != ($pk+1)? '
':''; - - - } - $faceimage_url = array(); - for ($i = 0; $i < count($all_applicant_details); $i++) { - if($all_applicant_details[$j]['facemark_image_generated'] == 1){ - $faceimage_url = $com_value['doc_url']; - break; - } - } - // $faceimage_url = ''; - // $faceimage_url = array(); - // for ($i = 0; $i < count($all_applicant_details); $i++) { - // if($all_applicant_details[$j]['facemark_image_generated'] == 1){ - // $faceimage_url = $com_value['doc_url']; - // break; - // } - // } - // 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) - // print_r($pd_images['common_images']);die(); - // if(isset($pd_images['common_images']) && count($pd_images['common_images']) && $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; - // array_push($faceimage_url,$com_value['doc_url']); - // } - // } - // } - // print_r($faceimage_url);die(); - if(!empty($faceimage_url)){ - for ($i = 0; $i < count($faceimage_url); $i++) { - echo '     '; - echo ''; - } + if($person['face_compare']) + { + echo '     '; + echo ''; + } } echo ''; echo '
'; ?>
-
'; ?> $com_value) 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 bf6d91c4..d0200f54 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php @@ -693,19 +693,6 @@ defined('BASEPATH') OR exit('No direct script access allowed'); //echo count($person_met_data) != ($pk+1)? '
':''; - } - $faceimage_url = array(); - for ($i = 0; $i < count($all_applicant_details); $i++) { - if($all_applicant_details[$j]['facemark_image_generated'] == 1){ - $faceimage_url = $com_value['doc_url']; - break; - } - } - if(!empty($faceimage_url)){ - for ($i = 0; $i < count($faceimage_url); $i++) { - echo '     '; - echo ''; - } } echo ""; echo '
'; @@ -766,7 +753,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name; $temp_person_met['photo'] = ''; $temp_person_met['id_proof'] = ''; - + $temp_person_met['face_compare'] = ''; foreach ($add_on_pd_images as $pd_level_key => $single_pd_images) { @@ -791,6 +778,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } } } + foreach($pd_images['common_images'] as $com_key => $com_value) + { + + if($com_value['image_key'] == 'face_mark' && $com_value['co_applicant_id'] == $individual['pd_co_applicant_id']){ + $temp_person_met['face_compare'] = $com_value['doc_url'] ; + } + } $company_relationship_data = null; foreach($general_form['company_with_relationships'] as $company_with_relationship) @@ -865,6 +859,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { echo ''; } + if($person['face_compare']) + { + echo '     '; + echo ''; + } //echo count($person_met_data) != ($pk+1)? '
':''; 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 cd5a2e50..99856c97 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_SMARTPD.php @@ -624,6 +624,7 @@ if ( isset($pdf) ) { $temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name; $temp_person_met['photo'] = ''; $temp_person_met['id_proof'] = ''; + $temp_person_met['face_compare'] = ''; foreach($pd_images[18] as $pm_Key => $pm_value) { @@ -639,6 +640,13 @@ if ( isset($pdf) ) { $temp_person_met['id_proof'] = $pm_value['doc_url'] ; } } + foreach($pd_images['common_images'] as $com_key => $com_value) + { + + if($com_value['image_key'] == 'face_mark' && $com_value['co_applicant_id'] == $individual['pd_co_applicant_id']){ + $temp_person_met['face_compare'] = $com_value['doc_url'] ; + } + } $company_relationship_data = null; foreach($general_form['company_with_relationships'] as $company_with_relationship) { @@ -710,23 +718,15 @@ if ( isset($pdf) ) { { echo ''; } + if($person['face_compare']) + { + echo '     '; + echo ''; + } //echo count($person_met_data) != ($pk+1)? '
':''; - } - $faceimage_url = array(); - for ($i = 0; $i < count($all_applicant_details); $i++) { - if($all_applicant_details[$j]['facemark_image_generated'] == 1){ - $faceimage_url = $com_value['doc_url']; - break; - } - } - if(!empty($faceimage_url)){ - for ($i = 0; $i < count($faceimage_url); $i++) { - echo '     '; - 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 657aa638..a1192112 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 @@ -623,6 +623,7 @@ if ( isset($pdf) ) { $temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name; $temp_person_met['photo'] = ''; $temp_person_met['id_proof'] = ''; + $temp_person_met['face_compare'] = ''; foreach($pd_images[18] as $pm_Key => $pm_value) { @@ -721,11 +722,10 @@ if ( isset($pdf) ) { } if($person['face_compare']) { + echo '     '; echo ''; } //echo count($person_met_data) != ($pk+1)? '
':''; - - } echo ''; echo '
'; diff --git a/api/application/views/report_templates/JSONTOREPORT_RI.php b/api/application/views/report_templates/JSONTOREPORT_RI.php index 1b1fec23..89491324 100644 --- a/api/application/views/report_templates/JSONTOREPORT_RI.php +++ b/api/application/views/report_templates/JSONTOREPORT_RI.php @@ -595,6 +595,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name; $temp_person_met['photo'] = ''; $temp_person_met['id_proof'] = ''; + $temp_person_met['face_compare'] = ''; foreach($pd_images[18] as $pm_Key => $pm_value) { if( !strcasecmp(trim($applicant_name),trim($pm_value['pd_document_title'])) ) @@ -608,6 +609,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['id_proof'] = $pm_value['doc_url'] ; } } + foreach($pd_images['common_images'] as $com_key => $com_value) + { + + if($com_value['image_key'] == 'face_mark' && $com_value['co_applicant_id'] == $individual['pd_co_applicant_id']){ + $temp_person_met['face_compare'] = $com_value['doc_url'] ; + } + } $company_relationship_data = null; foreach($general_form['company_with_relationships'] as $company_with_relationship) { @@ -676,6 +684,12 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { echo ''; } + if($person['face_compare']) + { + echo '     '; + echo ''; + } + //echo count($person_met_data) != ($pk+1)? '
':''; diff --git a/api/application/views/report_templates/JSONTOREPORT_RI_SMARTPD.php b/api/application/views/report_templates/JSONTOREPORT_RI_SMARTPD.php index 6c3ad3cb..be61b53d 100644 --- a/api/application/views/report_templates/JSONTOREPORT_RI_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_RI_SMARTPD.php @@ -595,6 +595,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name; $temp_person_met['photo'] = ''; $temp_person_met['id_proof'] = ''; + $temp_person_met['face_compare'] = ''; foreach($pd_images[18] as $pm_Key => $pm_value) { if( !strcasecmp(trim($applicant_name),trim($pm_value['pd_document_title'])) ) @@ -608,6 +609,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['id_proof'] = $pm_value['doc_url'] ; } } + foreach($pd_images['common_images'] as $com_key => $com_value) + { + + if($com_value['image_key'] == 'face_mark' && $com_value['co_applicant_id'] == $individual['pd_co_applicant_id']){ + $temp_person_met['face_compare'] = $com_value['doc_url'] ; + } + } $company_relationship_data = null; foreach($general_form['company_with_relationships'] as $company_with_relationship) { @@ -676,7 +684,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { echo ''; } - + if($person['face_compare']) + { + echo '     '; + echo ''; + } //echo count($person_met_data) != ($pk+1)? '
':''; 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 69754863..162e7dde 100644 --- a/api/application/views/report_templates/JSONTOREPORT_RI_TELE_PD.php +++ b/api/application/views/report_templates/JSONTOREPORT_RI_TELE_PD.php @@ -596,6 +596,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name; $temp_person_met['photo'] = ''; $temp_person_met['id_proof'] = ''; + $temp_person_met['face_compare'] = ''; foreach($pd_images[18] as $pm_Key => $pm_value) { if( !strcasecmp(trim($applicant_name),trim($pm_value['pd_document_title'])) ) @@ -609,6 +610,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['id_proof'] = $pm_value['doc_url'] ; } } + foreach($pd_images['common_images'] as $com_key => $com_value) + { + + if($com_value['image_key'] == 'face_mark' && $com_value['co_applicant_id'] == $individual['pd_co_applicant_id']){ + $temp_person_met['face_compare'] = $com_value['doc_url'] ; + } + } $company_relationship_data = null; foreach($general_form['company_with_relationships'] as $company_with_relationship) { @@ -677,6 +685,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { echo ''; } + if($person['face_compare']) + { + echo '     '; + echo ''; + } //echo count($person_met_data) != ($pk+1)? '
':''; diff --git a/api/application/views/report_templates/JSONTOREPORT_SAL.php b/api/application/views/report_templates/JSONTOREPORT_SAL.php index e36a75f9..a21e0c40 100644 --- a/api/application/views/report_templates/JSONTOREPORT_SAL.php +++ b/api/application/views/report_templates/JSONTOREPORT_SAL.php @@ -593,6 +593,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name; $temp_person_met['photo'] = ''; $temp_person_met['id_proof'] = ''; + $temp_person_met['face_compare'] = ''; foreach($pd_images[18] as $pm_Key => $pm_value) { if( !strcasecmp(trim($applicant_name),trim($pm_value['pd_document_title'])) ) @@ -606,6 +607,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['id_proof'] = $pm_value['doc_url'] ; } } + foreach($pd_images['common_images'] as $com_key => $com_value) + { + + if($com_value['image_key'] == 'face_mark' && $com_value['co_applicant_id'] == $individual['pd_co_applicant_id']){ + $temp_person_met['face_compare'] = $com_value['doc_url'] ; + } + } $company_relationship_data = null; foreach($general_form['company_with_relationships'] as $company_with_relationship) { diff --git a/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php b/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php index 0d09f0fa..eead1fe6 100644 --- a/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php @@ -600,6 +600,7 @@ font-weight: bolder;; $temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name; $temp_person_met['photo'] = ''; $temp_person_met['id_proof'] = ''; + $temp_person_met['face_compare'] = ''; foreach($pd_images[18] as $pm_Key => $pm_value) { if( !strcasecmp(trim($applicant_name),trim($pm_value['pd_document_title'])) ) @@ -613,6 +614,13 @@ font-weight: bolder;; $temp_person_met['id_proof'] = $pm_value['doc_url'] ; } } + foreach($pd_images['common_images'] as $com_key => $com_value) + { + + if($com_value['image_key'] == 'face_mark' && $com_value['co_applicant_id'] == $individual['pd_co_applicant_id']){ + $temp_person_met['face_compare'] = $com_value['doc_url'] ; + } + } $company_relationship_data = null; foreach($general_form['company_with_relationships'] as $company_with_relationship) { @@ -685,6 +693,12 @@ font-weight: bolder;; { echo ''; } + if($person['face_compare']) + { + echo '     '; + echo ''; + } + //echo count($person_met_data) != ($pk+1)? '
':''; 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 e2707831..d24d6150 100644 --- a/api/application/views/report_templates/JSONTOREPORT_SAL_TELE_PD.php +++ b/api/application/views/report_templates/JSONTOREPORT_SAL_TELE_PD.php @@ -594,6 +594,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['name'] = $individual['applicant_title_name_master'] .' '. $applicant_name; $temp_person_met['photo'] = ''; $temp_person_met['id_proof'] = ''; + $temp_person_met['face_compare'] = ''; foreach($pd_images[18] as $pm_Key => $pm_value) { if( !strcasecmp(trim($applicant_name),trim($pm_value['pd_document_title'])) ) @@ -607,6 +608,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp_person_met['id_proof'] = $pm_value['doc_url'] ; } } + foreach($pd_images['common_images'] as $com_key => $com_value) + { + + if($com_value['image_key'] == 'face_mark' && $com_value['co_applicant_id'] == $individual['pd_co_applicant_id']){ + $temp_person_met['face_compare'] = $com_value['doc_url'] ; + } + } $company_relationship_data = null; foreach($general_form['company_with_relationships'] as $company_with_relationship) { @@ -679,6 +687,12 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { echo ''; } + if($person['face_compare']) + { + echo '     '; + echo ''; + } + //echo count($person_met_data) != ($pk+1)? '
':'';