From 1a52ef6475736b7016db369f2b59453d1e412617 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Sat, 1 Feb 2020 12:56:58 +0530 Subject: [PATCH] ADMIN WEB NOTIFICATION ENABLED --- api/application/controllers/PD_Controller.php | 8 ++--- api/application/helpers/pdalerts_helper.php | 29 +++++++++++++++---- api/application/libraries/Pdfgenerator.php | 2 ++ 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index a7d24f66..bb1ce919 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -4928,7 +4928,7 @@ public function getPDFormDetailsJSON_post() $key = 'pd'.$pdid.'/'.$main_applicant_name.'_'.$pdid.'_'.'pd_images.pdf'; //$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes'); - if(!$pd_master_details[0]['is_img_pdf_created']) + if($pd_master_details[0]['is_img_pdf_created']) { $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes'); @@ -4956,7 +4956,7 @@ public function getPDFormDetailsJSON_post() //End of PDF Gen using DOM PDF $output_file2 = $this->external_path ."/pd_reports/" . $pdid . "/pd_images_pdf.pdf"; $ti = file_put_contents($output_file2, $pdf_doc); - echo $ti;die(); + //echo $ti;die(); $bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>($output_file2)); @@ -6121,9 +6121,9 @@ public function getPDFormDetailsJSON_post() $t = $this->load->view('report_templates/JSONTOREPORT_DI_AI_ADDON',$data,true); } //$t = $this->load->view('temp_html.html',null,true); - //echo $t; + echo $t; - //die(); + die(); $total_replaces = substr_count($t,''); for($i = 0 ;$i < $total_replaces;$i++) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index d601e852..cc98cec8 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -237,13 +237,32 @@ class PDALERTS $lender_credit_mob_token = (string)$core_details[0]['lender_credit_mob_token']; $additional_data_for_logs['to_whom'] = 'LEDNERCREDIT'; - PUSH_NOTIFICATION::sendNotification($lender_credit_web_token,$lender_credit_mob_token,$msg,$additional_data_for_logs); - - - - + PUSH_NOTIFICATION::sendNotification($lender_credit_web_token,$lender_credit_mob_token,$msg,$additional_data_for_logs); } + + /*********************************************/ + /*******Send Push Notification to Admin(WEB)***** + /*********************************************/ + if($pd_notification_configs[0]['admin'] == 1)// && $is_app_notify_enabled) + { + //$lender_web_token = (string)$core_details[0]['pd_contact_mobileno']; + //$lender_mob_token = (string)$core_details[0]['pd_contact_mobileno']; + $msg = $pd_notification_msg[0]['admin']; + $msg = self::stringReplace($msg,$core_details); + + //get all admins tokens + $CI->db->SELECT("notification_token_id, fk_user_id, web_token, mob_token, createdon, updatedon"); + $CI->db->FROM(USERNOTIFICATIONTOKENS." as USERNOTIFICATIONTOKENS"); + $CI->db->JOIN(USERPROFILEROLES." as USERPROFILEROLES","USERNOTIFICATIONTOKENS.fk_user_id = USERPROFILEROLES.fk_userid and USERPROFILEROLES.user_role = 10 and USERPROFILEROLES.isactive = 1"); + $admins = $CI->db->GET()->result_array(); + foreach ($admins as $key => $value) + { + + $additional_data_for_logs['to_whom'] = 'ADMIN'; + PUSH_NOTIFICATION::sendNotification($value['web_token'],$value['mob_token'],$msg,$additional_data_for_logs); + } + } /*********************************************/ diff --git a/api/application/libraries/Pdfgenerator.php b/api/application/libraries/Pdfgenerator.php index ee13deab..47f81cf2 100644 --- a/api/application/libraries/Pdfgenerator.php +++ b/api/application/libraries/Pdfgenerator.php @@ -26,6 +26,8 @@ class Pdfgenerator //$dompdf->setEncryption('test1234'); $dompdf->set_paper($paper, $orientation); $dompdf->set_option("isPhpEnabled", true); + $dompdf->set_option("enable_font_subsetting", true); + //print_r($dompdf->getOptions());die(); $dompdf->render(); $canvas = $dompdf->get_canvas();