diff --git a/api/application/config/constants.php b/api/application/config/constants.php index b0708e92..2a4a222a 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -121,6 +121,7 @@ defined('CUSTOMER_IMG_URL') OR define('CUSTOMER_IMG_URL','https://demo.pdgenie.c defined('PDF_ATTACHEMENT_URL') OR define('PDF_ATTACHEMENT_URL','https://apitest.pdgenie.com/sparqdev/api/short?dat='); defined('OPTIMIZED_IMAGE_BUCKET_NAME') OR define('OPTIMIZED_IMAGE_BUCKET_NAME','optimized-images-demo'); defined('IMAGE_OPTIMIZE_LAMBDA_URL') OR define('IMAGE_OPTIMIZE_LAMBDA_URL','https://wlaax92nne.execute-api.ap-south-1.amazonaws.com/demo'); +defined('VIDEO_SHORT_URL') OR define('VIDEO_SHORT_URL','https://lkt.pdgenie.com/'); } else if(ENVIRONMENT == 'testing') { @@ -138,6 +139,7 @@ else if(ENVIRONMENT == 'testing') defined('GOOGLE_DISTANCE_MATRIX_API_KEY') OR define('GOOGLE_DISTANCE_MATRIX_API_KEY',getenv('GOOGLE_DISTANCE_MATRIX_API_KEY')); defined('OPTIMIZED_IMAGE_BUCKET_NAME') OR define('OPTIMIZED_IMAGE_BUCKET_NAME','optimized-images-demo'); defined('IMAGE_OPTIMIZE_LAMBDA_URL') OR define('IMAGE_OPTIMIZE_LAMBDA_URL','https://wlaax92nne.execute-api.ap-south-1.amazonaws.com/demo'); + defined('VIDEO_SHORT_URL') OR define('VIDEO_SHORT_URL','https://lkt.pdgenie.com/'); } else if(ENVIRONMENT == 'production') { @@ -155,6 +157,7 @@ else if(ENVIRONMENT == 'production') defined('GOOGLE_DISTANCE_MATRIX_API_KEY') OR define('GOOGLE_DISTANCE_MATRIX_API_KEY',getenv('GOOGLE_DISTANCE_MATRIX_API_KEY')); defined('OPTIMIZED_IMAGE_BUCKET_NAME') OR define('OPTIMIZED_IMAGE_BUCKET_NAME','optimized-images-live'); defined('IMAGE_OPTIMIZE_LAMBDA_URL') OR define('IMAGE_OPTIMIZE_LAMBDA_URL','https://4u9t03hvfb.execute-api.ap-south-1.amazonaws.com/live'); + defined('VIDEO_SHORT_URL') OR define('VIDEO_SHORT_URL','https://l.pdgenie.com/'); } /*********************END of AWS resources Constants*************************************************/ diff --git a/api/application/config/routes.php b/api/application/config/routes.php index d710a314..b2829701 100755 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -356,4 +356,5 @@ $route['verifyOTP'] = 'User_Management_Controller/verifyOTP'; $route['awsrek/(:any)'] = 'Test/testAwsrek'; $route['optimizeImages/(:num)'] = 'PD_Controller/optimizeImages'; -$route['downloadSMCExcelFile/(:num)'] = 'PD_Controller/downloadSMCExcelFile'; \ No newline at end of file +$route['downloadSMCExcelFile/(:num)'] = 'PD_Controller/downloadSMCExcelFile'; +$route['compareFaces'] = 'Test/compareFaces'; \ No newline at end of file diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 81eefcae..b6e4c24d 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1065,7 +1065,7 @@ class SMC_Credit_PD_Controller extends REST_Controller { //$SMC_CREDIT_PD = $this->SMC_Credit_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC'); - $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno, PDTYPE.type_name, PDTRIGGER.lender_applicant_id, PDTRIGGER.fk_product_id, PRODUCT.abbr, PDTRIGGER.pd_status, PDAPPLICANTSDETAILS.applicant_name, (SELECT createdon FROM h_common_masters where PDTRIGGER.pd_id = primary_key AND field_name = "pd_status" order by log_id DESC limit 1) as updatedon, (SELECT concat(m_user_profile.first_name," " ,m_user_profile.last_name) FROM h_common_masters JOIN m_user_profile on h_common_masters.new_value = m_user_profile.userid where PDTRIGGER.pd_id = primary_key AND field_name = "fk_pd_allocated_to" order by log_id DESC limit 1) as officer_name,PDTRIGGER.mis_report_remarks'); + $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno, PDTYPE.type_name, PDTRIGGER.lender_applicant_id, PDTRIGGER.fk_product_id, PRODUCT.abbr, PDTRIGGER.pd_status, PDAPPLICANTSDETAILS.applicant_name, (SELECT createdon FROM h_common_masters where PDTRIGGER.pd_id = primary_key AND field_name = "pd_status" order by log_id DESC limit 1) as updatedon, (SELECT concat(m_user_profile.first_name," " ,m_user_profile.last_name) FROM h_common_masters JOIN m_user_profile on h_common_masters.new_value = m_user_profile.userid where PDTRIGGER.pd_id = primary_key AND field_name = "fk_pd_allocated_to" order by log_id DESC limit 1) as officer_name,PDTRIGGER.mis_report_remarks,PDTRIGGER.vendor_status'); $this->db->FROM(PDTRIGGER.' as PDTRIGGER'); $this->db->JOIN(PRODUCTS.' as PRODUCT','PDTRIGGER.fk_product_id = PRODUCT.product_id','LEFT'); diff --git a/api/application/controllers/Test.php b/api/application/controllers/Test.php index ccb5e5e8..2ceebd1a 100644 --- a/api/application/controllers/Test.php +++ b/api/application/controllers/Test.php @@ -76,25 +76,22 @@ class Test extends REST_Controller { - public function testAwsrek_get() + public function compareFaces_post() { - $fk_entity_id = $this->uri->segment(2);//die(); - //echo $fk_entity_id;die(); - // $data['student_details'] = array('name' => 'kumar','age' => '62','param' => $fk_entity_id); + //$fk_entity_id = $this->uri->segment(2);//die(); + + $pdid = $this->post('pdid'); + $url1 = $this->post('url1'); + $url2 = $this->post('url2'); + $data= $this->aws_rekonition->comparePhotos($url1,$url2); + //print_r($data); + $fin_data = array(); + foreach($data as $k => $v) + { + $fin_data[$k] = $v; + // echo '***********************'; + } - // $this->response($data,REST_Controller::HTTP_OK); - //echo 'Hi';die(); - // $data['dataStatus'] = true; - // $data['status'] = REST_Controller::HTTP_OK; - // $data['rec'] = $this->aws_rekonition->listAllBuckets(); - $data= $this->aws_rekonition->listAllBuckets(); - print_r($data); - - // foreach($data as $k => $v) - // { - // echo $k .' - '. print_r($v); - // } - - // $this->response($data,REST_Controller::HTTP_OK); + $this->response($fin_data,REST_Controller::HTTP_OK); } } \ No newline at end of file diff --git a/api/application/helpers/video_grabber_helper.php b/api/application/helpers/video_grabber_helper.php index 9bca95be..b032e616 100644 --- a/api/application/helpers/video_grabber_helper.php +++ b/api/application/helpers/video_grabber_helper.php @@ -41,7 +41,7 @@ class video_grabber_helper $final_key = 'pd'.$pd_master_details[0]['pd_id'].'/video/'.$file_name; $singed_uri = $CI->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+7 days'); - $shortURL = 'https://lkt.pdgenie.com/' . substr($video_name,0,6); + $shortURL = VIDEO_SHORT_URL . substr($video_name,0,6); if($value['short_link_created_date'] == NULL)//make short url entry in links file { diff --git a/api/application/libraries/AWS_REKONITION.php b/api/application/libraries/AWS_REKONITION.php index 4e78c5ab..34f93ad2 100644 --- a/api/application/libraries/AWS_REKONITION.php +++ b/api/application/libraries/AWS_REKONITION.php @@ -38,20 +38,21 @@ class AWS_REKONITION echo "listAllBuckets"; } - public function listAllBuckets() + public function comparePhotos($url1,$url2) { // echo "listAllBuckets"; $result = array('aksj'=>'sana'); $sourceImg = 'will1.jpg'; $targetImg = 'will2.jpg'; + //echo $url1;die(); try{ $result = $this->RekognitionClient->compareFaces([ // 'QualityFilter' => 'NONE|AUTO|LOW|MEDIUM|HIGH', 'QualityFilter' => 'NONE', - 'SimilarityThreshold' => 1.0, + 'SimilarityThreshold' => 0, 'SourceImage' => [ // REQUIRED - 'Bytes' => file_get_contents('C:\Users\Venba\Pictures\cropped.png'), + 'Bytes' => file_get_contents($url1), // 'S3Object' => [ // 'Bucket' => 'awsrekonition', // 'Name' => $sourceImg, @@ -59,7 +60,7 @@ class AWS_REKONITION // ], 'TargetImage' => [ // REQUIRED - 'Bytes' => file_get_contents('C:\Users\Venba\Pictures\wp1833814.jpg'), + 'Bytes' => file_get_contents($url2), // 'S3Object' => [ // 'Bucket' => 'awsrekonition', // 'Name' => $targetImg,