From 138565645bb03ebb8537de496093c3b8dd03eef9 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Tue, 31 Dec 2019 15:46:23 +0530 Subject: [PATCH] SAL REPORT AND END DISCLIAMER --- api/application/controllers/PD_Controller.php | 22 +++++++---- api/application/models/PD_Model.php | 5 ++- .../report_templates/JSONTOREPORT_CLIX.php | 18 ++++++++- .../report_templates/JSONTOREPORT_DI_AI.php | 25 ++++++++----- .../JSONTOREPORT_DI_AI_ADDON.php | 5 ++- .../report_templates/JSONTOREPORT_RI.php | 18 ++++++++- .../report_templates/JSONTOREPORT_SAL.php | 37 ++++++++++++++++--- 7 files changed, 101 insertions(+), 29 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index c853c3fe..a3a1ec1f 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -4690,24 +4690,28 @@ public function getPDFormDetailsJSON_post() //Get Common Images $data['pd_images']['common_images'] = $this->PD_Model->getSignedPDDocsURL($pdid,null,null,'common',null,'report'); + if($data['pd_master_details'][0]['customer_segment_abbr'] == "SAL") + { + $data['pd_images']['common_images'] = $this->PD_Model->getSignedPDDocsURL($pdid,null,null,null,null,'report'); + } $temp = 'DEFAULT DATA'; // if(!count($add_on_pd)) // { if($data['pd_master_details'][0]['lender_short_name'] == 'CLIX' || ($data['pd_master_details'][0]['lender_short_name'] == 'MWISE'))// && $data['pd_master_details'][0]['product_abbr'] == 'BL')) { - $t = $this->load->view('report_templates/JSONTOREPORT_CLIX',$data,true); + $temp = $this->load->view('report_templates/JSONTOREPORT_CLIX',$data,true); } else if($data['pd_master_details'][0]['customer_segment_abbr'] == 'SE-RI') { - $t = $this->load->view('report_templates/JSONTOREPORT_RI',$data,true); + $temp = $this->load->view('report_templates/JSONTOREPORT_RI',$data,true); } else if($data['pd_master_details'][0]['customer_segment_abbr'] == 'SE-DI' || $data['pd_master_details'][0]['customer_segment_abbr'] == 'SE-AI' || $data['pd_master_details'][0]['customer_segment_abbr'] == 'SEP_INDV') { - $t = $this->load->view('report_templates/JSONTOREPORT_DI_AI',$data,true); + $temp = $this->load->view('report_templates/JSONTOREPORT_DI_AI',$data,true); } else if($data['pd_master_details'][0]['customer_segment_abbr'] == 'SAL') { - $t = $this->load->view('report_templates/JSONTOREPORT_SAL',$data,true); + $temp = $this->load->view('report_templates/JSONTOREPORT_SAL',$data,true); } // } // else @@ -5956,14 +5960,18 @@ public function getPDFormDetailsJSON_post() $fields2 = array('*'); $data['pd_images'][$i] = $this->PD_Model->getSignedPDDocsURL($pdid,$i,null,null,null,'report'); - + // $this->getPDImages_post``($fields2,array('fk_pd_id'=>$pdid,'fk_form_id' => $i),PDDOCUMENTS,array(),'','company_id','ASC'); // print_r($this->db->last_query()); } //print_r(json_decode($data['pd_processed_forms'][18][0]['processed_json']));die(); $data['pd_images']['common_images'] = $this->PD_Model->getSignedPDDocsURL($pdid,null,null,'common',null,'report'); - //print_r($data['pd_images']);die(); + if($data['pd_master_details'][0]['customer_segment_abbr'] == "SAL") + { + $data['pd_images']['common_images'] = $this->PD_Model->getSignedPDDocsURL($pdid,null,null,null,null,'report'); + } + //print_r($data['pd_images']['common_images']);die(); // $it = array_filter($data['pd_images'][11],function($d){ if($d['company_id'] == 2){ echo $d['company_id'].'TRUE';return 1;}else {echo $d['company_id'].'FALSE'; return 0;} }); // print_r($it); @@ -6059,7 +6067,7 @@ public function getPDFormDetailsJSON_post() //End of PDF Gen using DOM PDF $output_file2 = $this->external_path ."/pd_reports/" . $pdid . "/sample.pdf"; $ti = file_put_contents($output_file2, $pdf_doc); - echo $ti; die(); + echo $ti;die(); $dat['dataStatus'] = true; $dat['status'] = REST_Controller::HTTP_OK; $dat['records'] = $ti; diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index c18844be..4d23d6ea 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -1206,7 +1206,7 @@ class PD_Model extends SPARQ_Model { } else { - $template_forms[$key]['isAnswerable'] = true; + $template_forms[ $key ]['isAnswerable'] = true; } } } @@ -1221,7 +1221,8 @@ class PD_Model extends SPARQ_Model { $result_data['pdmaster_details'] = $pd_master_detials[0]; } $result_data['pdapplicants_detials'] = $pd_applicants_detials; - $result_data['template_forms'] = $template_forms; + // $result_data['template_forms'] = json_decode(json_encode($template_forms), true);//$template_forms; + $result_data['template_forms'] = array_values($template_forms); diff --git a/api/application/views/report_templates/JSONTOREPORT_CLIX.php b/api/application/views/report_templates/JSONTOREPORT_CLIX.php index 47e2c314..90f762eb 100644 --- a/api/application/views/report_templates/JSONTOREPORT_CLIX.php +++ b/api/application/views/report_templates/JSONTOREPORT_CLIX.php @@ -561,9 +561,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo "

"; echo "

"; - if(isset($lender_disclaimer[0]['disclaimer']) && $lender_disclaimer[0]['disclaimer'] != '') + $header_lender_disclaimer = $lender_disclaimer[0]['type'] == 1 ? $lender_disclaimer[0] : (isset($lender_disclaimer[1]) && $lender_disclaimer[1]['type'] == 1 ? $lender_disclaimer[1] : ''); + if(isset($header_lender_disclaimer['disclaimer']) && $header_lender_disclaimer['disclaimer'] != '' && $header_lender_disclaimer['type'] == 1) { - echo '

Disclaimer: '. $lender_disclaimer[0]['disclaimer'] .'

'; + echo '

Disclaimer: '. $header_lender_disclaimer['disclaimer'] .'

'; } @@ -4669,6 +4670,19 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ?> + +




'. $footer_lender_disclaimer .'

'; + + + } + // ########################### End disclaimer end ######################################### + ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php index 63e8dc3e..871d9d24 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php @@ -491,15 +491,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');




'. $footer_lender_disclaimer['disclaimer'] .'

'; - - // } -// ########################### End disclaimer end ######################################### + ?> + + +




'. $footer_lender_disclaimer .'

'; + + + } + // ########################### End disclaimer end ######################################### + ?> + diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php index 54e5c1c6..3b936b48 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php @@ -544,9 +544,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo "

"; echo "

"; - if(isset($lender_disclaimer[0]['disclaimer']) && $lender_disclaimer[0]['disclaimer'] != '') + $header_lender_disclaimer = $lender_disclaimer[0]['type'] == 1 ? $lender_disclaimer[0] : (isset($lender_disclaimer[1]) && $lender_disclaimer[1]['type'] == 1 ? $lender_disclaimer[1] : ''); + if(isset($header_lender_disclaimer['disclaimer']) && $header_lender_disclaimer['disclaimer'] != '' && $header_lender_disclaimer['type'] == 1) { - echo '

Disclaimer: '. $lender_disclaimer[0]['disclaimer'] .'

'; + echo '

Disclaimer: '. $header_lender_disclaimer['disclaimer'] .'

'; } diff --git a/api/application/views/report_templates/JSONTOREPORT_RI.php b/api/application/views/report_templates/JSONTOREPORT_RI.php index 5cd0bfea..b677c1fa 100644 --- a/api/application/views/report_templates/JSONTOREPORT_RI.php +++ b/api/application/views/report_templates/JSONTOREPORT_RI.php @@ -543,9 +543,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo "

"; echo "

"; - if($lender_disclaimer[0]['disclaimer'] != '') + $header_lender_disclaimer = $lender_disclaimer[0]['type'] == 1 ? $lender_disclaimer[0] : (isset($lender_disclaimer[1]) && $lender_disclaimer[1]['type'] == 1 ? $lender_disclaimer[1] : ''); + if(isset($header_lender_disclaimer['disclaimer']) && $header_lender_disclaimer['disclaimer'] != '' && $header_lender_disclaimer['type'] == 1) { - echo '

Disclaimer: '. $lender_disclaimer[0]['disclaimer'] .'

'; + echo '

Disclaimer: '. $header_lender_disclaimer['disclaimer'] .'

'; } @@ -1853,6 +1854,19 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo '

'.$pd_officer_final_remark.'

' ?> + +




'. $footer_lender_disclaimer .'

'; + + + } + // ########################### End disclaimer end ######################################### + ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_SAL.php b/api/application/views/report_templates/JSONTOREPORT_SAL.php index fda9aa13..559e7d44 100644 --- a/api/application/views/report_templates/JSONTOREPORT_SAL.php +++ b/api/application/views/report_templates/JSONTOREPORT_SAL.php @@ -542,9 +542,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo "

"; echo "

"; - if($lender_disclaimer[0]['disclaimer'] != '') + $header_lender_disclaimer = $lender_disclaimer[0]['type'] == 1 ? $lender_disclaimer[0] : (isset($lender_disclaimer[1]) && $lender_disclaimer[1]['type'] == 1 ? $lender_disclaimer[1] : ''); + if(isset($header_lender_disclaimer['disclaimer']) && $header_lender_disclaimer['disclaimer'] != '' && $header_lender_disclaimer['type'] == 1) { - echo '

Disclaimer: '. $lender_disclaimer[0]['disclaimer'] .'

'; + echo '

Disclaimer: '. $header_lender_disclaimer['disclaimer'] .'

'; } @@ -1186,7 +1187,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo $employeement_data['bonus_incentive'] ? "The applicant receives a bonus ( ".($employeement_data['bonus_type'] == 'others' ? $employeement_data['bonus_type_other']: $employeement_data['bonus_type']).") of ".$rupee_symbol." ".MYUTIL::customIndianNumberFormat($employeement_data['bonus_incentive'])." ( " .MYUTIL::numtowords($employeement_data['bonus_incentive']).") "." ".$employeement_data['bonus_frequency'].'.': ''; echo "

"; echo "

".$employeement_data['id_card_issued_company'] == 'yes' ? 'ID card issued by employer was seen by PD officer.(image attatched end of the report)': 'ID card issued by employer was not seen by PD officer.'."

"; - echo "
***********************************"; + //echo "
***********************************"; } @@ -1925,6 +1926,19 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $value) + { + if($value['img_type'] == 1 || $value['img_type'] == 2 || $value['pd_document_title'] == 'satellite') + { + unset($pd_images['common_images'][$key]); + } + } + //echo count($pd_images['common_images']); + // print_r($pd_images['common_images']); + $pd_images['common_images'] = array_values($pd_images['common_images']); + $tot_rows = ceil(count($pd_images['common_images'])/3); echo '
'; echo '
Photograph`s

'; @@ -1939,9 +1953,9 @@ defined('BASEPATH') OR exit('No direct script access allowed'); for($i = $from ; $i <= $to; $i++) { - if(isset($pd_images['common_images'][$i])) + if(isset($pd_images['common_images'][$i]))// && ($pd_images['common_images'][$i]['img_type'] != 1 && $pd_images['common_images'][$i]['img_type'] != 2 && $pd_images['common_images'][$i]['pd_document_title'] != 'satellite')) { - echo ''; + echo ''; } //unset($p_key); @@ -1951,6 +1965,19 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo '
'.$pd_images['common_images'][$i]['img_name'].'
'. $pd_images['common_images'][$i]['img_name'] .'
'.$pd_images['common_images'][$i]['pd_document_title'].'
'. $pd_images['common_images'][$i]['pd_document_title'] .'
'; } ?> + +




'. $footer_lender_disclaimer .'

'; + + + } + // ########################### End disclaimer end ######################################### + ?>