From 7e5be8746e4b5b99035c7f6a18c827d6e4505223 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Sat, 25 Jun 2022 20:28:41 +0530 Subject: [PATCH] Flyhi Report Completed : ps --- .../controllers/Flyhi_Controller.php | 53 ++++++++++++++-- .../views/sale_pd_templates/FHFSL.php | 61 ++++++++++--------- 2 files changed, 80 insertions(+), 34 deletions(-) diff --git a/api/application/controllers/Flyhi_Controller.php b/api/application/controllers/Flyhi_Controller.php index 230ce979..8bf371ee 100644 --- a/api/application/controllers/Flyhi_Controller.php +++ b/api/application/controllers/Flyhi_Controller.php @@ -694,6 +694,7 @@ class Flyhi_Controller extends REST_Controller { // print_r($section['section_id']);die(); // log_message('ERROR','####PREPARE SALESPD REPORT CALLED'.$pd_id); $view_data['section'.$section['section_id'] ] = $this->processFlyhiPDJSON($section);//die(); + // print_r($view_data['section'.$section['section_id'] ]);die; $section_fields['section'.$section['section_id'] ] = $this->processFlyhiPDJSON($section); } $view_data['section9'] = $this->Flyhi_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $pd_id,'img_name !=' => 'satellite','isactive' => 1),SALEPD_DOCS); @@ -704,7 +705,7 @@ class Flyhi_Controller extends REST_Controller { //$view_name = $flyhipd_data[0]['short_name'].'_'.$flyhipd_data[0]['abbr']; $view_name = $flyhipd_data[0]['short_name']; $html_content = $this->load->view('sale_pd_templates/'.$view_name,$view_data,true); - echo $html_content;die(); + // echo $html_content;die(); $pdf_doc = $this->pdfgenerator->generate($html_content, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); //End of PDF Gen using DOM PDF $output_file = $this->external_path ."/sales_pd/" .$pd_id. "/temp.pdf"; @@ -846,7 +847,7 @@ class Flyhi_Controller extends REST_Controller { if(count($result_data)) { $new_key = $ques_key . '_master'; - $questions[$new_key] = $result_data[0]['pincode']; + $questions[$new_key] = $ques_value; } }if($ques_key == 'business_pincode_others' && $ques_value == "1"){ @@ -865,7 +866,7 @@ class Flyhi_Controller extends REST_Controller { } }if($ques_key == 'permanent_pincode_others' && $ques_value == "1"){ $new_key = $ques_key . 'permanent_pincode_master'; - $questions[$new_key] = $result_data[0]['pincode']; + $questions[$new_key] = $ques_value; } if($ques_key == 'officer_pincode' && $ques_value != "1"){ // residence_pincode: "1" @@ -881,7 +882,7 @@ class Flyhi_Controller extends REST_Controller { } }if($ques_key == 'officer_pincode_others'){ $new_key = 'officer_pincode_master'; - $questions[$new_key] = $result_data[0]['pincode']; + $questions[$new_key] = $ques_value; } if($ques_key == 'lender_name'){ $table = ENTITY; @@ -942,11 +943,51 @@ class Flyhi_Controller extends REST_Controller { } } if($ques_key == 'residence_details'){ - + for($i=0;$i 1,'state_id'=>$ques_value[$i]['residence_state']); + $result_data = $this->Flyhi_Model->selectCustomRecords($fields,$where_condition_array,$table); + $new_key = 'residence_state_master'; + if(count($result_data)) + { + $questions[$ques_key][$i][$new_key] = $result_data[0]['name']; + }else{ + $questions[$ques_key][$i][$new_key] = 'name'; + } + } + if(isset($ques_value[$i]['residence_city'])){ + $table = CITY; + $fields = array('name'); + $where_condition_array = array('isactive' => 1,'city_id'=>$ques_value[$i]['residence_city']); + $result_data = $this->Flyhi_Model->selectCustomRecords($fields,$where_condition_array,$table); + $new_key = 'residence_city_master'; + if(count($result_data)) + { + $questions[$ques_key][$i][$new_key] = $result_data[0]['name']; + } + } + if(isset($ques_value[$i]['residence_pincode'])){ + $table = PINCODE; + $fields = array('pincode'); + $where_condition_array = array('pincode_id'=>$ques_value[$i]['residence_pincode']); + $result_data = $this->Flyhi_Model->selectCustomRecords($fields,$where_condition_array,$table); + $new_key = 'residence_pincode_master'; + if(count($result_data)) + { + $questions[$ques_key][$i][$new_key] = $result_data[0]['pincode']; + } + } + if(isset($ques_value[$i]['residence_pincode_others'])){ + $new_key = 'residence_pincode_master'; + $questions[$ques_key][$i][$new_key] = $ques_value[$i]['residence_pincode_others']; + } + } } } - print_r($questions);die(); + return $questions; } function processFlyhiPDQuestions($questions,$section_id) diff --git a/api/application/views/sale_pd_templates/FHFSL.php b/api/application/views/sale_pd_templates/FHFSL.php index ba5de205..f3c5866d 100644 --- a/api/application/views/sale_pd_templates/FHFSL.php +++ b/api/application/views/sale_pd_templates/FHFSL.php @@ -159,43 +159,43 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Lender Name - + Branch - + Application ID - + Lender sales Person - + Lender credit Person - + Product Name - + Loan Amount Applied for (Rs) - + Application Name - + Application Mobile Number - + Verification Type - + @@ -205,25 +205,30 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Residence Details + - Address Details - + Address Details + City - + State - + PIN - + + + Residence Ownership - + Years at current Residence - + Same as current residence address @@ -236,11 +241,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); City - + State - + PIN - + @@ -267,15 +272,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); City - + State - + PIN - + Occupation of the loan applicant - + Employer/Business Name @@ -292,16 +297,16 @@ defined('BASEPATH') OR exit('No direct script access allowed'); --> City - + State - + PIN - + Constitution of Employer /Business applicant - + Years at Current employment/Business