Face Image : ps

This commit is contained in:
VE10-Sanjeev 2022-05-25 18:54:23 +05:30
parent cb529ab4ad
commit 60d0722ede
18 changed files with 249 additions and 80 deletions

View File

@ -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';

View File

@ -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);

View File

@ -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{

View File

@ -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);
}
}

View File

@ -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;

View File

@ -711,10 +711,20 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
if(isset($pd_master_details[0]['face_api_image']))
{
echo '<img src="'.$pd_master_details[0]['face_api_image'].'" width="300" height="200" alt=""/>';
}
$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 '<img src="'.$faceimage_url.'" width="300" height="200" alt=""/>';
}
echo '</div>';
echo '<br>';
?>

View File

@ -718,10 +718,20 @@ font-weight: bolder;;
}
if(isset($pd_master_details[0]['face_api_image']))
{
echo '<img src="'.$pd_master_details[0]['face_api_image'].'" width="300" height="200" alt=""/>';
}
$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 '<img src="'.$faceimage_url.'" width="300" height="200" alt=""/>';
}
echo '</div>';
echo '<br>';
?>

View File

@ -712,10 +712,22 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
if(isset($pd_master_details[0]['face_api_image']))
{
echo '<img src="'.$pd_master_details[0]['face_api_image'].'" width="300" height="200" alt=""/>';
}
$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 '<img src="'.$faceimage_url.'" width="300" height="200" alt=""/>';
}
echo '</div>';
echo '<br>';
?>

View File

@ -708,10 +708,21 @@ if ( isset($pdf) ) {
}
if(isset($pd_master_details[0]['face_api_image']))
{
echo '<img src="'.$pd_master_details[0]['face_api_image'].'" width="300" height="200" alt=""/>';
}
$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 '<img src="'.$faceimage_url.'" width="300" height="200" alt=""/>';
}
echo '</div>';
echo '<br>';
?>

View File

@ -691,10 +691,20 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
if(isset($pd_master_details[0]['face_api_image']))
{
echo '<img src="'.$pd_master_details[0]['face_api_image'].'" width="300" height="200" alt=""/>';
}
$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 '<img src="'.$faceimage_url.'" width="300" height="200" alt=""/>';
}
echo "</div>";
echo '<br>';

View File

@ -712,10 +712,21 @@ if ( isset($pdf) ) {
}
if(isset($pd_master_details[0]['face_api_image']))
{
echo '<img src="'.$pd_master_details[0]['face_api_image'].'" width="300" height="200" alt=""/>';
}
$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 '<img src="'.$faceimage_url.'" width="300" height="200" alt=""/>';
}
echo '</div>';
echo '<br>';
?>

View File

@ -710,10 +710,21 @@ if ( isset($pdf) ) {
}
if(isset($pd_master_details[0]['face_api_image']))
{
echo '<img src="'.$pd_master_details[0]['face_api_image'].'" width="300" height="200" alt=""/>';
}
$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 '<img src="'.$faceimage_url.'" width="300" height="200" alt=""/>';
}
echo '</div>';
echo '<br>';
?>

View File

@ -678,10 +678,21 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
if(isset($pd_master_details[0]['face_api_image']))
{
echo '<img src="'.$pd_master_details[0]['face_api_image'].'" width="300" height="200" alt=""/>';
}
$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 '<img src="'.$faceimage_url.'" width="300" height="200" alt=""/>';
}
echo '</div>';
echo '<br>';
?>

View File

@ -678,10 +678,21 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
if(isset($pd_master_details[0]['face_api_image']))
{
echo '<img src="'.$pd_master_details[0]['face_api_image'].'" width="300" height="200" alt=""/>';
}
$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 '<img src="'.$faceimage_url.'" width="300" height="200" alt=""/>';
}
echo '</div>';
echo '<br>';
?>

View File

@ -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 '<img src="'.$pd_master_details[0]['face_api_image'].'" width="300" height="200" alt=""/>';
if($com_value['pd_document_title'] == 'face_api_result_image')
{
$faceimage_url = $com_value['doc_url'];break;
}
}
}
if(!empty($faceimage_url)){
echo '<img src="'.$faceimage_url.'" width="300" height="200" alt=""/>';
}
echo '</div>';
echo '<br>';
?>

View File

@ -682,10 +682,21 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
//echo '</div>';
}
if(isset($pd_master_details[0]['face_api_image']))
{
echo '<img src="'.$pd_master_details[0]['face_api_image'].'" width="300" height="200" alt=""/>';
}
$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 '<img src="'.$faceimage_url.'" width="300" height="200" alt=""/>';
}
echo '<br>';
?>

View File

@ -689,10 +689,21 @@ font-weight: bolder;;
}
//echo '</div>';
}
if(isset($pd_master_details[0]['face_api_image']))
{
echo '<img src="'.$pd_master_details[0]['face_api_image'].'" width="300" height="200" alt=""/>';
}
$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 '<img src="'.$faceimage_url.'" width="300" height="200" alt=""/>';
}
echo '<br>';
?>

View File

@ -681,10 +681,21 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
if(isset($pd_master_details[0]['face_api_image']))
{
echo '<img src="'.$pd_master_details[0]['face_api_image'].'" width="300" height="200" alt=""/>';
}
$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 '<img src="'.$faceimage_url.'" width="300" height="200" alt=""/>';
}
echo '</div>';
}
echo '<br>';