diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index b714a7a8..ddad5c91 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -984,6 +984,7 @@ class PD_Controller extends REST_Controller { { $pd_details['complete_override_data'] = json_encode($pd_details['complete_override_data']); $pd_details['completed_on'] = date('Y-m-d H:i:s'); + $this->toMakeFaceBoundingBox($exist_pd_details); } if(array_key_exists('link',$pd_details)) @@ -11863,13 +11864,15 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() } $this->response($data,REST_Controller::HTTP_OK); } - public function facemark_get(){ - $get = $this->get('pd');//pdid 3184 + // public function facemark_get(){ + public function toMakeFaceBoundingBox($master_details){ + // $pdid = $this->get('pd');//pdid 3184 comment this + $pdid = $master_details[0]['pd_id']; $bounding_box = array(); - if(!empty($get)){ - $master_details = $this->PD_Model->getPDMasterDetails($get); - if($master_details[0]['pd_status'] !== COMPLETED){ - $db_result = $this->PD_Model->selectCustomRecords(array('faceapi_result'),array('pd_id' => $get),PDTRIGGER); + if(!empty($pdid)){ + // $master_details = $this->PD_Model->getPDMasterDetails($pdid);//comment this + if($master_details[0]['pd_status'] == COMPLETED && $master_details[0]['facemark_image_generated'] == 0){ + $db_result = $this->PD_Model->selectCustomRecords(array('faceapi_result'),array('pd_id' => $pdid),PDTRIGGER); $string = $db_result[0]['faceapi_result']; // echo gettype($string); $my_array = json_decode($string,true); @@ -11881,38 +11884,49 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() $bounding_box[$i]['Similarity'] = $arr[$i]['Similarity']; } } - $where_condition_array = array('fk_pd_id' => $get,'isactive' => 1,'image_key' => "selfie_with_person_met"); + $where_condition_array = array('fk_pd_id' => $pdid,'isactive' => 1,'image_key' => "selfie_with_person_met"); $img_result = $this->PD_Model->selectCustomRecords(array('pd_document_id','pd_document_name','pd_document_title','image_key'),$where_condition_array,PDDOCUMENTS); - $image_name = $img_result[0]['pd_document_name']; - $bucketname = LENDER_BUCKET_NAME_PREFIX.$master_details[0]['fk_lender_id']; - $key = 'pd'.$get.'/'.$image_name; + $bucketname = LENDER_BUCKET_NAME_PREFIX.$master_details[0]['fk_lender_id']; + $key = 'pd'.$pdid.'/'.$img_result[0]['pd_document_name']; $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes'); - $destination_path = $this->external_path."/pd_reports/". $get ."/".$image_name; - //$getimage = getcontent first ($singed_uri) - $image_name = file_put_contents($destination_path, file_get_contents($singed_uri)); - // $image_name = "sample.png"; - // $destination_path = $this->external_path."/pd_reports/". $get ."/".$image_name; + + // $temp_image_name = "sample.png"; + $temp_image_name = "face_api_image.png"; + $destination_path = $this->external_path."/pd_reports/". $pdid ."/".$temp_image_name; + file_put_contents($destination_path, file_get_contents($singed_uri)); + + faceapi::toMakeFaceBoundingBox($temp_image_name,$bounding_box,$destination_path); - faceapi::toMakeFaceBoundingBox($image_name,$bounding_box,$destination_path); - // save table s3 - - - $data['dataStatus'] = true; - $data['status'] = REST_Controller::HTTP_OK; - $data['msg'] = 'Given PDID '; - $data['details'] = $bounding_box; - }else{ - $data['dataStatus'] = false; - $data['status'] = REST_Controller::HTTP_NO_CONTENT; - $data['msg'] = 'Given PDID is Not in Completed Status'; + $key = 'pd'.$pdid.'/'.$temp_image_name; + $sourcefile = $destination_path; + + $bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>$sourcefile); + $s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data); + + // print_r($s3result);die(); + if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) + { + $this->db->WHERE('pd_id',$pdid)->UPDATE(PDTRIGGER,array('facemark_image_generated' => 1)); + unlink($destination_path); + } + // $data['dataStatus'] = true; + // $data['status'] = REST_Controller::HTTP_OK; + // $data['msg'] = 'Given PDID '; + // $data['details'] = $bounding_box; } - }else{ - $data['dataStatus'] = false; - $data['status'] = REST_Controller::HTTP_NO_CONTENT; - $data['msg'] = 'PDID is Not Available'; + // else{ + // $data['dataStatus'] = false; + // $data['status'] = REST_Controller::HTTP_NO_CONTENT; + // $data['msg'] = 'Given PDID is Not in Completed Status'; + // } } - $this->response($data,REST_Controller::HTTP_OK); + // else{ + // $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/helpers/faceapi_helper.php b/api/application/helpers/faceapi_helper.php index eb8cd8b0..ca03da2b 100644 --- a/api/application/helpers/faceapi_helper.php +++ b/api/application/helpers/faceapi_helper.php @@ -2,18 +2,17 @@ class faceapi { - private static $current_pd_id = null; public static function toMakeFaceBoundingBox($image_name,$BoundingBox,$destination_path){ - $get_image_format = explode(".",$image_name); - $image_format = $get_image_format[1]; - if($image_format == 'png'){ - $img = imagecreatefrompng($destination_path); - }else if($image_format == 'jpeg'){ - $img = imagecreatefromjpeg($destination_path); - }else if($image_format == 'jpg'){ - $img = imagecreatefromjpg($destination_path); - } + // $image_format = $get_image_format[1]; + $img = imagecreatefrompng($destination_path); + // if($image_format == 'png'){ + // $img = imagecreatefrompng($destination_path); + // }else if($image_format == 'jpeg'){ + // $img = imagecreatefromjpeg($destination_path); + // }else if($image_format == 'jpg'){ + // $img = imagecreatefromjpg($destination_path); + // } $red = imagecolorallocate($img, 255, 0, 0); @@ -30,21 +29,25 @@ class faceapi $Top_coordinate = ($BoundingBox[$i]['Top'] * $imageheight) ; $Face_width = ($BoundingBox[$i]['Width'] * $imagewidth) ; $Face_height = ($BoundingBox[$i]['Height'] * $imageheight) ; - $Similarity = round($BoundingBox[$i]['Similarity'])."%"; + $Similarity = round($BoundingBox[$i]['Similarity']); + $x1 = $Left_coordinate; $y1 = $Top_coordinate; - self::DrawLine($x1,$y1,$Face_width,$Face_height,$Similarity,$img,$image_format,$destination_path); + self::DrawLine($x1,$y1,$Face_width,$Face_height,$Similarity,$img,$destination_path); } } - public static function DrawLine($x1,$y1,$Face_width,$Face_height,$Similarity,$img,$image_format,$destination_path){ - // 70 - green - // 70 below red - $color = imagecolorallocate($img, 0, 153, 0); + public static function DrawLine($x1,$y1,$Face_width,$Face_height,$Similarity,$img,$destination_path){ + if($Similarity >= 70 ){// above 70 green + $color = imagecolorallocate($img, 0, 153, 0); + }else if($Similarity < 70 ){// below 70 red + $color = imagecolorallocate($img, 255, 0, 0); + } + $Similarity = $Similarity." %"; //TOP LINe $t_x1 = $x1; $t_y1 = $y1; @@ -62,17 +65,17 @@ class faceapi $imgl = self::imagelinethick($img,$t_x1,$t_y1,$b_x1,$b_y1,$color,7);//left line $imgl = self::imagelinethick($img,$t_x2,$t_y2,$b_x2,$b_y2,$color,7);//right line // apppath / doc la roboto.tff - $string = str_replace("sample.png", "roboto.ttf", $destination_path); - imagettftext($img, 20, 0, ($t_x1), ($t_y1-5), $color,$string, $Similarity); - + $font = APPPATH."docs/roboto.ttf"; + imagettftext($img, 20, 0, ($t_x1), ($t_y1-5), $color,$font, $Similarity); + 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); - } + // 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); + // } } diff --git a/api/application/helpers/smc_creditpd_helper.php b/api/application/helpers/smc_creditpd_helper.php index eff46d62..841bfb9a 100644 --- a/api/application/helpers/smc_creditpd_helper.php +++ b/api/application/helpers/smc_creditpd_helper.php @@ -541,8 +541,8 @@ class smc_creditpd static function getFinalRemarksSectionData($section) { $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'); + $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'); // echo 'json***'; diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 9e8ae855..ef853bb8 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -1054,7 +1054,7 @@ class PD_Model extends SPARQ_Model { */ public function getPDMasterDetails($pdid,$random_string = null) { - $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno,PDTRIGGER.fk_lender_id,PDTRIGGER.sub_entity_id,SUBENTITY.short_name as sub_entity_short_name,PDTRIGGER.imgc_fin_institute,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name,ENTITY.is_score_card_enabled,ENTITY.is_otp_enabled, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PRODUCTS.prod_catagory,PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %h:%i:%s %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",IFNULL(USERPROFILE.last_name,"")) as createdby,concat(USERPROFILE1.first_name," ",IFNULL(USERPROFILE1.last_name,"")) as updatedby,DESIGNATION.designation as updatedby_designation,PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.is_qc_enabled,AGENCY.full_name as agency_name,AGENCY.short_name as agency_short_name,PDTRIGGER.vendor_pdofficer,concat(VENDORPDOFFICER.first_name," ",VENDORPDOFFICER.last_name) as vendor_pdofficer_name,PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.lender_sales_person,concat(LENDERSALESPERSON.first_name," ",LENDERSALESPERSON.last_name) as lender_sales_person_name,LENDERSALESPERSON.mobile_no as lender_sales_contact_mobileno,LENDERSALESPERSON.email as lender_sales_person_email,PDTRIGGER.lender_credit_person,concat(LENDERCREDITPERSON.first_name," ",LENDERCREDITPERSON.last_name) as lender_credit_person_name,LENDERCREDITPERSON.mobile_no as lender_credit_person_contact_mobileno,LENDERCREDITPERSON.email as lender_credit_person_email,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,OTPREJECTION.rejection_reason,PDTRIGGER.otp_reject_other_reason,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited,PDTRIGGER.is_zip_created,PDTRIGGER.pd_qc_note,ENTITY.is_sms_enabled,ENTITY.is_mail_enabled,ENTITY.is_app_notify_enabled,AGENCY.is_vendor_visit_disabled,PDTRIGGER.is_notify_enabled,ENTITYFININSTITUTION.institute_name as fin_institute_name,PDTRIGGER.is_img_pdf_created,PDTRIGGER.is_video_merged,PDTRIGGER.vendor_status,PDTRIGGER.vendor_scheduled_on as vendor_scheduled_on_validation,DATE_FORMAT(PDTRIGGER.vendor_scheduled_on,"%d/%m/%Y %h:%i %p") as vendor_scheduled_on,PDTRIGGER.complete_override_data,PDTRIGGER.excel_file_id,SMC_EXCEL_FILELIST.file_name,SMC_EXCEL_FILELIST.modified_fname,PDTRIGGER.mwise_sales_person,PDTRIGGER.is_field_visit_done,PDTRIGGER.cancel_pd_remark,if(SMC_EXCEL_FILELIST_RE_UPLOAD.fk_pd_id is not null,"1","0") as re_uploaded,SMC_EXCEL_FILELIST_RE_UPLOAD.modified_fname as re_uploaded_file_name,ROLES.role_id as pd_allocated_to_role_id,AGENCYLIST.agency_name as SMC_vendor_agency_name,AGENCYLIST.agency_abbr as SMC_vendor_agency_short_name'); + $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno,PDTRIGGER.fk_lender_id,PDTRIGGER.sub_entity_id,SUBENTITY.short_name as sub_entity_short_name,PDTRIGGER.imgc_fin_institute,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name,ENTITY.is_score_card_enabled,ENTITY.is_otp_enabled, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PRODUCTS.prod_catagory,PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %h:%i:%s %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",IFNULL(USERPROFILE.last_name,"")) as createdby,concat(USERPROFILE1.first_name," ",IFNULL(USERPROFILE1.last_name,"")) as updatedby,DESIGNATION.designation as updatedby_designation,PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.is_qc_enabled,AGENCY.full_name as agency_name,AGENCY.short_name as agency_short_name,PDTRIGGER.vendor_pdofficer,concat(VENDORPDOFFICER.first_name," ",VENDORPDOFFICER.last_name) as vendor_pdofficer_name,PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.lender_sales_person,concat(LENDERSALESPERSON.first_name," ",LENDERSALESPERSON.last_name) as lender_sales_person_name,LENDERSALESPERSON.mobile_no as lender_sales_contact_mobileno,LENDERSALESPERSON.email as lender_sales_person_email,PDTRIGGER.lender_credit_person,concat(LENDERCREDITPERSON.first_name," ",LENDERCREDITPERSON.last_name) as lender_credit_person_name,LENDERCREDITPERSON.mobile_no as lender_credit_person_contact_mobileno,LENDERCREDITPERSON.email as lender_credit_person_email,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,OTPREJECTION.rejection_reason,PDTRIGGER.otp_reject_other_reason,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited,PDTRIGGER.is_zip_created,PDTRIGGER.pd_qc_note,ENTITY.is_sms_enabled,ENTITY.is_mail_enabled,ENTITY.is_app_notify_enabled,AGENCY.is_vendor_visit_disabled,PDTRIGGER.is_notify_enabled,ENTITYFININSTITUTION.institute_name as fin_institute_name,PDTRIGGER.is_img_pdf_created,PDTRIGGER.is_video_merged,PDTRIGGER.vendor_status,PDTRIGGER.vendor_scheduled_on as vendor_scheduled_on_validation,DATE_FORMAT(PDTRIGGER.vendor_scheduled_on,"%d/%m/%Y %h:%i %p") as vendor_scheduled_on,PDTRIGGER.complete_override_data,PDTRIGGER.excel_file_id,SMC_EXCEL_FILELIST.file_name,SMC_EXCEL_FILELIST.modified_fname,PDTRIGGER.mwise_sales_person,PDTRIGGER.is_field_visit_done,PDTRIGGER.cancel_pd_remark,if(SMC_EXCEL_FILELIST_RE_UPLOAD.fk_pd_id is not null,"1","0") as re_uploaded,SMC_EXCEL_FILELIST_RE_UPLOAD.modified_fname as re_uploaded_file_name,ROLES.role_id as pd_allocated_to_role_id,AGENCYLIST.agency_name as SMC_vendor_agency_name,AGENCYLIST.agency_abbr as SMC_vendor_agency_short_name,PDTRIGGER.facemark_image_generated'); $this->db->FROM(PDTRIGGER.' as PDTRIGGER'); $this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id ','LEFT'); $this->db->JOIN(ENTITY.' as SUBENTITY','PDTRIGGER.sub_entity_id = SUBENTITY.entity_id ','LEFT');