From 5a308b754421dcf27fa429cc401b987d87a2e761 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Thu, 18 Aug 2022 21:30:15 +0530 Subject: [PATCH] SMC report lpic ink Changes : ps --- .../controllers/SMC_Credit_PD_Controller.php | 5 ++-- .../helpers/report_attachments_helper.php | 17 +++++++++++++ .../helpers/url_shortener_helper.php | 25 +++++++++++++++++++ .../views/smc_creditpd_reports/MWISE.php | 6 +++-- .../views/smc_creditpd_reports/NBFC.php | 6 +++-- 5 files changed, 53 insertions(+), 6 deletions(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 5a1dd017..e312cffb 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1522,6 +1522,7 @@ public function filterSalesPDList_post() { $this->load->helper('smc_creditpd'); $this->load->helper('cet_creditpd'); $this->load->helper('smcpdscore'); + $this->load->helper('report_attachments'); $view_data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($records['pd_id']); @@ -1684,14 +1685,14 @@ public function filterSalesPDList_post() { } cet_creditpd::pushwithcetcreditpdapi($common_fields,$CETAPP_creditPD_data); - + $view_data['report_attachments'] = (new report_attachments)->getSMCReportAttchments($records['pd_id'],$view_data['pd_master_details'][0]['random_string'],$view_data['pd_master_details']); if($view_data['pd_master_details'][0]['product_abbr'] == "NBFC/MFI"){ $html_content = $this->load->view('smc_creditpd_reports/NBFC',$view_data,true); }else{ $html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true); } - // print_r($html_content);exit(); + print_r($html_content);exit(); $pdf_name = $view_data['pd_master_details'][0]['main_applicant']; $new_pdf_name = "PD_Report_".$view_data['pd_master_details'][0]['main_applicant']; diff --git a/api/application/helpers/report_attachments_helper.php b/api/application/helpers/report_attachments_helper.php index f8894673..a8e2b426 100644 --- a/api/application/helpers/report_attachments_helper.php +++ b/api/application/helpers/report_attachments_helper.php @@ -43,6 +43,23 @@ class report_attachments return $attachment; } + + public function getSMCReportAttchments($pdid,$random_string,$pd_master_details = array()) + { + $CI =&get_instance(); + + $CI->load->helper('url_shortener'); + + $uri = url_shortener::SMC_report_url_shorten($pdid,$random_string); + + $attachment = '
+

Data Links

+

Click here for Image PDF Link

Click here for Image ZIP Link

'; + + $attachment.= '


(Note all links will expire in 15 days from the date of report generation.)

'; + + return $attachment; + } } diff --git a/api/application/helpers/url_shortener_helper.php b/api/application/helpers/url_shortener_helper.php index 0ac10d06..eb7c1b9d 100644 --- a/api/application/helpers/url_shortener_helper.php +++ b/api/application/helpers/url_shortener_helper.php @@ -44,6 +44,31 @@ class url_shortener } + + public static function SMC_report_url_shorten($pdid,$random_string,$type = '') + { + //echo 'this is from daiu'; + $CI =&get_instance(); + $CI->load->model('PD_Model'); + + $date_of_creation = date('Ymd'); + $uri = array(); + if($type) + { + $uri[ $type ] = $type.'/'.$date_of_creation.'/'.$pdid.'/'.$random_string; + } + else + { + $uri[ 'ppdf' ] = custom_encryption::encode ( 'ppdf/'.$date_of_creation.'/'.$pdid.'/'.$random_string); + $uri[ 'zip' ] = custom_encryption::encode ( 'zip/'.$date_of_creation.'/'.$pdid.'/'.$random_string ); + } + // print_r($uri);die(); + return $uri; + + + + } + } diff --git a/api/application/views/smc_creditpd_reports/MWISE.php b/api/application/views/smc_creditpd_reports/MWISE.php index 77327ae7..0fe02c80 100644 --- a/api/application/views/smc_creditpd_reports/MWISE.php +++ b/api/application/views/smc_creditpd_reports/MWISE.php @@ -1552,8 +1552,10 @@ if(count($smc_images)) - - + diff --git a/api/application/views/smc_creditpd_reports/NBFC.php b/api/application/views/smc_creditpd_reports/NBFC.php index 881f8eb0..dc9992a8 100644 --- a/api/application/views/smc_creditpd_reports/NBFC.php +++ b/api/application/views/smc_creditpd_reports/NBFC.php @@ -594,8 +594,10 @@ if(count($smc_images)) - - +