Face Compare report Changes 4 : ps

This commit is contained in:
VE10-Sanjeev 2022-09-18 22:53:05 +05:30
parent 1316fb4496
commit fdf17ee662
15 changed files with 88 additions and 58 deletions

View File

@ -4646,9 +4646,10 @@ class PD_Controller extends REST_Controller
$data['pd_images']['common_images'] = $this->PD_Model->getSignedPDDocsURL($pdid, null, null, 'common', null, 'report');
}
$db_result = $this->PD_Model->selectCustomRecords(array('facecrop'), array('fk_pd_id' => $pdid,'isactive'=>1), PDAPPLICANTSDETAILS);
$string = $db_result[0]['facecrop'];
// echo gettype($string);
$my_array = json_decode($string, true);
for ($dinx = 0; $dinx < count($db_result); $dinx++) {
$string = $db_result[$dinx]['facecrop'];
$my_array[$dinx] = json_decode($string, true);
}
$data['facecrop'] = $my_array;
// echo "i ahve image";
// print_r($data['pd_images']);die();
@ -5802,9 +5803,11 @@ class PD_Controller extends REST_Controller
}
$db_result = $this->PD_Model->selectCustomRecords(array('facecrop'), array('fk_pd_id' => $pdid,'isactive'=>1), PDAPPLICANTSDETAILS);
$string = $db_result[0]['facecrop'];
// echo gettype($string);
$my_array = json_decode($string, true);
for ($dinx = 0; $dinx < count($db_result); $dinx++) {
$string = $db_result[$dinx]['facecrop'];
// echo gettype($string);
$my_array[$dinx] = json_decode($string, true);
}
$data['facecrop'] = $my_array;
// echo gettype($my_array);
// print_r($my_array);
@ -10497,11 +10500,11 @@ class PD_Controller extends REST_Controller
// public function toMakeFaceBoundingBox_get(){
public function toMakeFaceBoundingBox($pdid,$len_id){
// $pdid = $this->get('pd'); //comment this bcoz test purpose
// $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
public function toMakeFaceBoundingBox_get(){
// public function toMakeFaceBoundingBox($pdid,$len_id){
$pdid = $this->get('pd'); //comment this bcoz test purpose
$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);
$where = array('isactive' => 1, 'fk_form_id' => 18, 'fk_pd_id' => $pdid);
@ -10557,7 +10560,6 @@ class PD_Controller extends REST_Controller
$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');
$img_result = $this->PD_Model->selectCustomRecords($select_col, $where_condition_array, PDDOCUMENTS);
// print_r($this->db->last_query());
// echo count($img_result);
// print_r($img_result);
@ -10582,7 +10584,7 @@ class PD_Controller extends REST_Controller
$response = faceapi::toMakeFaceBoundingBox($bounding_box, $destination_path, $file_name, $img_result[$k]['image_key'], $apcntid);
array_push($img_response, $response);
if (($img_result[$k]['image_key'] == 'selfie_with_person_met')) {
$this->uploadPicInS3($pdid, $destination_path, $bucketname, $applicants_details[$j]['pd_co_applicant_id']);
$this->uploadPicInS3($pdid, $destination_path, $bucketname, $applicants_details[$j]['pd_co_applicant_id'],$extension);
}
// faceapi::toMakeFaceBoundingBox($bounding_box,$destination_path,$file_name);
@ -10613,9 +10615,9 @@ class PD_Controller extends REST_Controller
}
} else {
log_message('ERROR', "In PD Controller to Make FaceBoundingBox Faceapi Image Already Generated");
$data['dataStatus'] = false;
$data['status'] = REST_Controller::HTTP_NO_CONTENT;
$data['msg'] = 'Faceapi Image Already Generated 2';
// $data['dataStatus'] = false;
// $data['status'] = REST_Controller::HTTP_NO_CONTENT;
// $data['msg'] = 'Faceapi Image Already Generated 2';
}
} // for @ $applicants_details = j
} else {
@ -10629,8 +10631,9 @@ class PD_Controller extends REST_Controller
// $this->response($data, REST_Controller::HTTP_OK);
}
public function uploadPicInS3($pdid,$destination_path,$bucketname,$apcntid){
$file = "face_api_image_".$apcntid.".jpeg";
public function uploadPicInS3($pdid,$destination_path,$bucketname,$apcntid,$extension){
$file = "face_api_image_".$apcntid.$extension;
$dbfile = "face_api_image_".$apcntid.".jpeg";
$key = 'pd' . $pdid . '/' . $file;
$sourcefile = $destination_path.$file;
@ -10642,11 +10645,11 @@ class PD_Controller extends REST_Controller
log_message('ERROR', "In PD Controller to Make FaceBoundingBox updating pdtrigger 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')->UPDATE(PDDOCUMENTS, array('isactive' => 0));
->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");
$record_data = array('fk_pd_id' => $pdid, 'pd_document_title' => 'face_api_result_image', 'pd_document_name' => $file ,'co_applicant_id'=>$apcntid,'image_key'=>'face_mark');
$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);
}

View File

@ -8,7 +8,6 @@ class faceapi
log_message('ERROR', "In faceapi helper @ line no : 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);

View File

@ -742,8 +742,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<br>
<?php
if(!empty($facecrop)){
$ci = !empty($facecrop[0]['compare_image']) ? $facecrop[0]['compare_image'] :array() ;
$si = !empty($facecrop[1]['source_image']) ? $facecrop[1]['source_image'] : array();
for ($fc = 0; $fc < count($facecrop); $fc++) {
$fc_arr = $facecrop[$fc];
$ci = !empty($fc_arr[0]['compare_image']) ? $fc_arr[0]['compare_image'] :array() ;
$si = !empty($fc_arr[1]['source_image']) ? $fc_arr[1]['source_image'] : array();
// ########################### Percentage Bar Section #########################################
echo "<h3>Face Comparison</h3>" ;
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
@ -771,7 +773,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
// ########################### End of Percentage Bar Section #########################################
}
}}
?>
<p contenteditable="true"><b>Loan Applicants:</b></p>

View File

@ -749,8 +749,10 @@ font-weight: bolder;;
<br>
<?php
if(!empty($facecrop)){
$ci = !empty($facecrop[0]['compare_image']) ? $facecrop[0]['compare_image'] :array() ;
$si = !empty($facecrop[1]['source_image']) ? $facecrop[1]['source_image'] : array();
for ($fc = 0; $fc < count($facecrop); $fc++) {
$fc_arr = $facecrop[$fc];
$ci = !empty($fc_arr[0]['compare_image']) ? $fc_arr[0]['compare_image'] :array() ;
$si = !empty($fc_arr[1]['source_image']) ? $fc_arr[1]['source_image'] : array();
// ########################### Percentage Bar Section #########################################
echo "<h3>Face Comparison</h3>" ;
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
@ -778,6 +780,7 @@ font-weight: bolder;;
}
// ########################### End of Percentage Bar Section #########################################
}
}
?>

View File

@ -745,8 +745,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<br>
<?php
if(!empty($facecrop)){
$ci = !empty($facecrop[0]['compare_image']) ? $facecrop[0]['compare_image'] :array() ;
$si = !empty($facecrop[1]['source_image']) ? $facecrop[1]['source_image'] : array();
for ($fc = 0; $fc < count($facecrop); $fc++) {
$fc_arr = $facecrop[$fc];
$ci = !empty($fc_arr[0]['compare_image']) ? $fc_arr[0]['compare_image'] :array() ;
$si = !empty($fc_arr[1]['source_image']) ? $fc_arr[1]['source_image'] : array();
// ########################### Percentage Bar Section #########################################
echo "<h3>Face Comparison</h3>" ;
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
@ -774,7 +776,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
// ########################### End of Percentage Bar Section #########################################
}
}}
?>
<p contenteditable="true"><b>Loan Applicants:</b></p>

View File

@ -759,8 +759,10 @@ if ( isset($pdf) ) {
<br>
<?php
if(!empty($facecrop)){
$ci = !empty($facecrop[0]['compare_image']) ? $facecrop[0]['compare_image'] :array() ;
$si = !empty($facecrop[1]['source_image']) ? $facecrop[1]['source_image'] : array();
for ($fc = 0; $fc < count($facecrop); $fc++) {
$fc_arr = $facecrop[$fc];
$ci = !empty($fc_arr[0]['compare_image']) ? $fc_arr[0]['compare_image'] :array() ;
$si = !empty($fc_arr[1]['source_image']) ? $fc_arr[1]['source_image'] : array();
// ########################### Percentage Bar Section #########################################
echo "<h3>Face Comparison</h3>" ;
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
@ -800,7 +802,7 @@ if ( isset($pdf) ) {
}
// echo '<div class="container"></div>';
// ########################### End of Percentage Bar Section #########################################
}
}}
?>
<p contenteditable="true"><b><?php echo $loan_word;?> Applicants:</b></p>

View File

@ -719,8 +719,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '<br>';
if(!empty($facecrop)){
$ci = !empty($facecrop[0]['compare_image']) ? $facecrop[0]['compare_image'] :array() ;
$si = !empty($facecrop[1]['source_image']) ? $facecrop[1]['source_image'] : array();
for ($fc = 0; $fc < count($facecrop); $fc++) {
$fc_arr = $facecrop[$fc];
$ci = !empty($fc_arr[0]['compare_image']) ? $fc_arr[0]['compare_image'] :array() ;
$si = !empty($fc_arr[1]['source_image']) ? $fc_arr[1]['source_image'] : array();
// ########################### Percentage Bar Section #########################################
echo "<h3>Face Comparison</h3>" ;
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
@ -748,7 +750,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
// ########################### End of Percentage Bar Section #########################################
}
}}

View File

@ -743,8 +743,10 @@ if ( isset($pdf) ) {
<br>
<?php
if(!empty($facecrop)){
$ci = !empty($facecrop[0]['compare_image']) ? $facecrop[0]['compare_image'] :array() ;
$si = !empty($facecrop[1]['source_image']) ? $facecrop[1]['source_image'] : array();
for ($fc = 0; $fc < count($facecrop); $fc++) {
$fc_arr = $facecrop[$fc];
$ci = !empty($fc_arr[0]['compare_image']) ? $fc_arr[0]['compare_image'] :array() ;
$si = !empty($fc_arr[1]['source_image']) ? $fc_arr[1]['source_image'] : array();
// ########################### Percentage Bar Section #########################################
echo "<h3>Face Comparison</h3>" ;
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
@ -772,7 +774,7 @@ if ( isset($pdf) ) {
}
// ########################### End of Percentage Bar Section #########################################
}
}}
?>
<p contenteditable="true"><b><?php echo $loan_word;?> Applicants:</b></p>

View File

@ -741,8 +741,10 @@ if ( isset($pdf) ) {
<br>
<?php
if(!empty($facecrop)){
$ci = !empty($facecrop[0]['compare_image']) ? $facecrop[0]['compare_image'] :array() ;
$si = !empty($facecrop[1]['source_image']) ? $facecrop[1]['source_image'] : array();
for ($fc = 0; $fc < count($facecrop); $fc++) {
$fc_arr = $facecrop[$fc];
$ci = !empty($fc_arr[0]['compare_image']) ? $fc_arr[0]['compare_image'] :array() ;
$si = !empty($fc_arr[1]['source_image']) ? $fc_arr[1]['source_image'] : array();
// ########################### Percentage Bar Section #########################################
echo "<h3>Face Comparison</h3>" ;
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
@ -770,6 +772,7 @@ if ( isset($pdf) ) {
}
// ########################### End of Percentage Bar Section #########################################
}
}
?>

View File

@ -709,8 +709,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<br>
<?php
if(!empty($facecrop)){
$ci = !empty($facecrop[0]['compare_image']) ? $facecrop[0]['compare_image'] :array() ;
$si = !empty($facecrop[1]['source_image']) ? $facecrop[1]['source_image'] : array();
for ($fc = 0; $fc < count($facecrop); $fc++) {
$fc_arr = $facecrop[$fc];
$ci = !empty($fc_arr[0]['compare_image']) ? $fc_arr[0]['compare_image'] :array() ;
$si = !empty($fc_arr[1]['source_image']) ? $fc_arr[1]['source_image'] : array();
// ########################### Percentage Bar Section #########################################
echo "<h3>Face Comparison</h3>" ;
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
@ -738,7 +740,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
// ########################### End of Percentage Bar Section #########################################
}
}}
?>
<p contenteditable="true"><b>Loan Applicants:</b></p>

View File

@ -709,8 +709,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<br>
<?php
if(!empty($facecrop)){
$ci = !empty($facecrop[0]['compare_image']) ? $facecrop[0]['compare_image'] :array() ;
$si = !empty($facecrop[1]['source_image']) ? $facecrop[1]['source_image'] : array();
for ($fc = 0; $fc < count($facecrop); $fc++) {
$fc_arr = $facecrop[$fc];
$ci = !empty($fc_arr[0]['compare_image']) ? $fc_arr[0]['compare_image'] :array() ;
$si = !empty($fc_arr[1]['source_image']) ? $fc_arr[1]['source_image'] : array();
// ########################### Percentage Bar Section #########################################
echo "<h3>Face Comparison</h3>" ;
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
@ -738,7 +740,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
// ########################### End of Percentage Bar Section #########################################
}
}}
?>
<p contenteditable="true"><b>Loan Applicants:</b></p>

View File

@ -710,8 +710,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<br>
<?php
if(!empty($facecrop)){
$ci = !empty($facecrop[0]['compare_image']) ? $facecrop[0]['compare_image'] :array() ;
$si = !empty($facecrop[1]['source_image']) ? $facecrop[1]['source_image'] : array();
for ($fc = 0; $fc < count($facecrop); $fc++) {
$fc_arr = $facecrop[$fc];
$ci = !empty($fc_arr[0]['compare_image']) ? $fc_arr[0]['compare_image'] :array() ;
$si = !empty($fc_arr[1]['source_image']) ? $fc_arr[1]['source_image'] : array();
// ########################### Percentage Bar Section #########################################
echo "<h3>Face Comparison</h3>" ;
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
@ -739,7 +741,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
// ########################### End of Percentage Bar Section #########################################
}
}}
?>
<p contenteditable="true"><b>Loan Applicants:</b></p>
<table class="scorecard_table">

View File

@ -709,8 +709,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?>
<?php
if(!empty($facecrop)){
$ci = !empty($facecrop[0]['compare_image']) ? $facecrop[0]['compare_image'] :array() ;
$si = !empty($facecrop[1]['source_image']) ? $facecrop[1]['source_image'] : array();
for ($fc = 0; $fc < count($facecrop); $fc++) {
$fc_arr = $facecrop[$fc];
$ci = !empty($fc_arr[0]['compare_image']) ? $fc_arr[0]['compare_image'] :array() ;
$si = !empty($fc_arr[1]['source_image']) ? $fc_arr[1]['source_image'] : array();
// ########################### Percentage Bar Section #########################################
echo "<h3>Face Comparison</h3>" ;
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
@ -738,7 +740,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
// ########################### End of Percentage Bar Section #########################################
}
}}
?>
<!-- <br> -->

View File

@ -717,8 +717,10 @@ font-weight: bolder;;
?>
<?php
if(!empty($facecrop)){
$ci = !empty($facecrop[0]['compare_image']) ? $facecrop[0]['compare_image'] :array() ;
$si = !empty($facecrop[1]['source_image']) ? $facecrop[1]['source_image'] : array();
for ($fc = 0; $fc < count($facecrop); $fc++) {
$fc_arr = $facecrop[$fc];
$ci = !empty($fc_arr[0]['compare_image']) ? $fc_arr[0]['compare_image'] :array() ;
$si = !empty($fc_arr[1]['source_image']) ? $fc_arr[1]['source_image'] : array();
// ########################### Percentage Bar Section #########################################
echo "<h3>Face Comparison</h3>" ;
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
@ -746,7 +748,7 @@ font-weight: bolder;;
}
// ########################### End of Percentage Bar Section #########################################
}
}}
?>
<!-- <br> -->

View File

@ -711,8 +711,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?>
<?php
if(!empty($facecrop)){
$ci = !empty($facecrop[0]['compare_image']) ? $facecrop[0]['compare_image'] :array() ;
$si = !empty($facecrop[1]['source_image']) ? $facecrop[1]['source_image'] : array();
for ($fc = 0; $fc < count($facecrop); $fc++) {
$fc_arr = $facecrop[$fc];
$ci = !empty($fc_arr[0]['compare_image']) ? $fc_arr[0]['compare_image'] :array() ;
$si = !empty($fc_arr[1]['source_image']) ? $fc_arr[1]['source_image'] : array();
// ########################### Percentage Bar Section #########################################
echo "<h3>Face Comparison</h3>" ;
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
@ -740,7 +742,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
// ########################### End of Percentage Bar Section #########################################
}
}}
?>
<!-- <br> -->