diff --git a/api/application/composer.json b/api/application/composer.json index 9c575533..6938f88b 100644 --- a/api/application/composer.json +++ b/api/application/composer.json @@ -19,7 +19,7 @@ "aws/aws-sdk-php": "^3.64", "amphp/amp": "^1.2", "dompdf/dompdf" : "0.6.*", - "smarty/smarty": "^3.1" + "tecnickcom/tcpdf": "^6.2" }, "suggest": { diff --git a/api/application/composer.lock b/api/application/composer.lock index 52d77872..ba5a94ac 100644 --- a/api/application/composer.lock +++ b/api/application/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2a71fd7716b51eccdfd921f2362198b9", + "content-hash": "5c78e1c8273b1893de422b5c5c44d72f", "packages": [ { "name": "amphp/amp", @@ -65,16 +65,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.80.3", + "version": "3.81.6", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "f1f724c48a49350250950d80d16b348e5e748e3c" + "reference": "0e07e92ec7042316ffc79ef290cf7bbb7d7be24b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/f1f724c48a49350250950d80d16b348e5e748e3c", - "reference": "f1f724c48a49350250950d80d16b348e5e748e3c", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/0e07e92ec7042316ffc79ef290cf7bbb7d7be24b", + "reference": "0e07e92ec7042316ffc79ef290cf7bbb7d7be24b", "shasum": "" }, "require": { @@ -144,7 +144,7 @@ "s3", "sdk" ], - "time": "2018-12-04T20:31:51+00:00" + "time": "2018-12-14T22:50:05+00:00" }, { "name": "ddeboer/tesseract", @@ -767,59 +767,6 @@ ], "time": "2018-06-23T08:43:13+00:00" }, - { - "name": "smarty/smarty", - "version": "v3.1.33", - "source": { - "type": "git", - "url": "https://github.com/smarty-php/smarty.git", - "reference": "dd55b23121e55a3b4f1af90a707a6c4e5969530f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/smarty-php/smarty/zipball/dd55b23121e55a3b4f1af90a707a6c4e5969530f", - "reference": "dd55b23121e55a3b4f1af90a707a6c4e5969530f", - "shasum": "" - }, - "require": { - "php": ">=5.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "files": [ - "libs/bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0" - ], - "authors": [ - { - "name": "Monte Ohrt", - "email": "monte@ohrt.com" - }, - { - "name": "Uwe Tews", - "email": "uwe.tews@googlemail.com" - }, - { - "name": "Rodney Rehm", - "email": "rodney.rehm@medialize.de" - } - ], - "description": "Smarty - the compiling PHP template engine", - "homepage": "http://www.smarty.net", - "keywords": [ - "templating" - ], - "time": "2018-09-12T20:54:16+00:00" - }, { "name": "symfony/process", "version": "v3.3.6", @@ -933,16 +880,16 @@ }, { "name": "thiagoalessio/tesseract_ocr", - "version": "2.7.1", + "version": "2.7.2", "source": { "type": "git", "url": "https://github.com/thiagoalessio/tesseract-ocr-for-php.git", - "reference": "cf9534a7bef895ba2106ff8ea199e193118c5a7e" + "reference": "3df8862309e049a25828b6db181d18ddddd8cdb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thiagoalessio/tesseract-ocr-for-php/zipball/cf9534a7bef895ba2106ff8ea199e193118c5a7e", - "reference": "cf9534a7bef895ba2106ff8ea199e193118c5a7e", + "url": "https://api.github.com/repos/thiagoalessio/tesseract-ocr-for-php/zipball/3df8862309e049a25828b6db181d18ddddd8cdb0", + "reference": "3df8862309e049a25828b6db181d18ddddd8cdb0", "shasum": "" }, "require": { @@ -974,7 +921,7 @@ "Tesseract", "text recognition" ], - "time": "2018-11-09T19:12:03+00:00" + "time": "2018-12-11T19:38:54+00:00" } ], "packages-dev": [], diff --git a/api/application/config/constants.php b/api/application/config/constants.php index a3009aac..2263fe46 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -87,7 +87,7 @@ defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest auto // define login route name for token verification //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listAllEntites/:any)'); // no errors //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listAllTemplates/:any)'); // no errors -defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'getListOfPDReportVersions'); // no errors +defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN','getFullPDDetails'); // no errors /*********************AWS resources Constants*************************************************/ defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic'); diff --git a/api/application/config/routes.php b/api/application/config/routes.php index d349b912..f12e058c 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -172,7 +172,9 @@ $route['getLatestPDReportBlob'] = 'PD_Controller/getLatestPDReportBlob'; $route['saveNewVersionOfPDReport'] = 'PD_Controller/saveNewVersionOfPDReport'; $route['getListOfPDReportVersions'] = 'PD_Controller/getListOfPDReportVersions'; $route['swapOlderPDReportToLatest'] = 'PD_Controller/swapOlderPDReporttoLatest'; + $route['smartyTestFunction'] = 'PD_Controller/smartyTestFunction'; +$route['codeigniterViewTest'] = 'PD_Controller/codeigniterViewTest'; //PD Form Related $route['getPDFormDetails'] = 'PD_Controller/getPDFormDetails'; diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 1395143c..bff80a1b 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -9,10 +9,12 @@ defined('BASEPATH') OR exit('No direct script access allowed'); require_once APPPATH . '/libraries/REST_Controller.php'; -//require_once APPPATH . '/libraries/Smartie.php'; +require_once APPPATH . '/libraries/Smartie.php'; +//require BASEPATH.'core/Controller.php'; class PD_Controller extends REST_Controller { +//class PD_Controller extends CI_Controller { function __construct() { @@ -23,7 +25,8 @@ class PD_Controller extends REST_Controller { $this->load->library('AWS_SNS'); $this->load->helper('GETPDFORMDETAILS'); $this->load->library('pdfgenerator'); - //$this->load->library('smarty'); + $this->load->library('pdfgen_tcpdf'); + } @@ -2673,15 +2676,16 @@ class PD_Controller extends REST_Controller { if(file_put_contents($output_file2, $pdf_doc)) { $bucketname = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id']; + $main_applicant_name = $pd_master_details[0]['main_applicant']; $key = ""; if($is_regenerate == 0) { - $key = 'pd'.$pdid.'/pd_reports/version0.pdf'; + $key = 'pd'.$pdid.'/pd_reports/'.$main_applicant_name.'._version0.pdf'; } else { $latest_version = $pd_master_details[0]['pd_report_latest_version'] + 1; - $key = 'pd'.$pdid.'/pd_reports/version'.$latest_version.'.pdf'; + $key = 'pd'.$pdid.'/pd_reports/'.$main_applicant_name.'.version'.$latest_version.'.pdf'; } $sourcefile = $output_file2; @@ -2711,6 +2715,7 @@ class PD_Controller extends REST_Controller { //call all reports functionality and send it. + $key = 'pd'.$pdid.'/pd_reports/'; $urls = $this->getALLPDReportsSingedURLs($bucketname,$key,$pdid); if($id != null || $id != "" ) @@ -2749,6 +2754,7 @@ class PD_Controller extends REST_Controller { $fk_createdby = $records['fk_createdby']; //Get PD Master Details $pd_master_details = $this->PD_Model->getPDMasterDetails($pdid); + $main_applicant_name = $pd_master_details[0]['main_applicant']; //print_r($pd_master_details); //update BLOB in pd trigger Table @@ -2781,7 +2787,7 @@ class PD_Controller extends REST_Controller { if(file_put_contents($output_file2, $pdf_doc)) { $bucketname = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id']; - $key = 'pd'.$pdid.'/pd_reports/'.'version'.$latest_version.'.pdf'; + $key = 'pd'.$pdid.'/pd_reports/'.$main_applicant_name.'_version'.$latest_version.'.pdf'; $sourcefile = $output_file2; $bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>$sourcefile); @@ -2828,7 +2834,7 @@ class PD_Controller extends REST_Controller { //Get PD Master Details $pd_master_details = $this->PD_Model->getPDMasterDetails($pdid); - + $main_applicant_name = $pd_master_details[0]['main_applicant']; $lender_id = $pd_master_details[0]['fk_lender_id']; $bucket_name = LENDER_BUCKET_NAME_PREFIX.$lender_id; @@ -2848,7 +2854,7 @@ class PD_Controller extends REST_Controller { { $data['dataStatus'] = false; $data['status'] = REST_Controller::HTTP_NO_CONTENT; - $data['msg'] = 'PD Report Not Generated/Report Not Available!'; + $data['msg'] = 'PD Report Not Generated'; $this->response($data,REST_Controller::HTTP_OK); } @@ -2997,6 +3003,9 @@ class PD_Controller extends REST_Controller { $records = $this->post('records'); $pdid = $records['pd_id']; + + $pd_master_details = $this->PD_Model->getPDMasterDetails($pdid); + $main_applicant_name = $pd_master_details[0]['main_applicant']; $doc_name = $records['doc_name']; $fk_createdby = $records['fk_createdby']; @@ -3059,7 +3068,7 @@ class PD_Controller extends REST_Controller { if(file_put_contents($output_file2, $pdf_doc)) { $bucketname = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id']; - $key = 'pd'.$pdid.'/pd_reports/'.'version'.($pd_master_details[0]['pd_report_latest_version'] + 1).'.pdf'; + $key = 'pd'.$pdid.'/pd_reports/'.$main_applicant_name.'_version'.($pd_master_details[0]['pd_report_latest_version'] + 1).'.pdf'; $sourcefile = $output_file2; $bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>$sourcefile); @@ -3132,10 +3141,76 @@ class PD_Controller extends REST_Controller { $this->smarty->assign('title','Test Title'); $this->smarty->assign('description', 'Test Description'); //$this->smarty->display('index.tpl'); - $data['Name'] = 'test namenkenk'; + $data['pdif'] = '10'; + $data['main_applicant_name'] = 'Mr.Ram Kumar'; + $data['cus_seg'] = 'SENP-AI'; + $data['lender_name'] = 'HDFC'; + $data['product'] = 'Home Loan'; + $data['type_of_activity'] = 'Manufacturing'; + $data['applicants'] = array(array('name' => 'Rajesh Kumar','age' => '56'),array('name' => 'santhosh Kumar','age' => '45')); + $this->smarty->assign("FirstName", array("John", "Mary", "James", "Henry")); $fin = $this->smarty->view('index.tpl' , $data); - echo "dsds"; + + // echo "CON"; print_r($fin); + + // $temp_array = array('content' => $fin,'fk_pd_id'=> 555); + // $id = $this->PD_Model->saveRecords($temp_array,PDREPORTSVERSIONBLOB); + + // $data['dataStatus'] = true; + // $data['status'] = REST_Controller::HTTP_NOT_MODIFIED; + // $data['msg'] = $fin; + // $this->response($data,REST_Controller::HTTP_OK); + + $output_file = APPPATH."/docs/temp.html"; + $ifp = fopen( $output_file, 'wb' ); + //fwrite( $ifp, $original_template ); + fwrite( $ifp, $fin ); + fclose( $ifp ); + //print_r($output_file); + $file= file_get_contents($output_file); + $pdf_doc = $this->pdfgenerator->generate($file, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); + //print_r($pdf_doc); + + + $output_file2 = APPPATH."/docs/sample.pdf"; + echo file_put_contents($output_file2, $pdf_doc); + + + } + + + public function codeigniterViewTest_post() + { + + $data['pdid'] = '500'; + $data['main_applicant_name'] = 'Mr.Ram Kumar'; + $data['cus_seg'] = 'SENP-AI'; + $data['lender_name'] = 'HDFC'; + $data['product'] = 'Home Loan'; + $data['sub_product'] = 'Home Resale'; + $data['type_of_activity'] = 'Manufacturing'; + $data['applicants'] = array( + array('name' => 'Rajesh Kumar','age' => '56','relation'=>'Brother','es'=>'Salaried','cn'=>'TCS'), + array('name' => 'santhosh Kumar','age' => '45','relation'=>'Brother','es'=>'Selfemployee','cn'=>'ABC Pvt Ltd'), + array('name' => 'Jiv Kumar','age' => '65','relation'=>'Father','es'=>'No','cn'=>'-'), + array('name' => 'Selvi','age' => '60','relation'=>'Mother','es'=>'Housewife','cn'=>'-'), + ); + $t = $this->load->view('report_templates/SALCASH',$data,true); + print_r($t); + + //PDF Gen using DOM PDF + //$pdf_doc = $this->pdfgenerator->generate($t, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); + //End of PDF Gen using DOM PDF + + //PDF GEN BY TCPDF + + //PDF GEN BY TCPDF + + $output_file2 = APPPATH."/docs/sample.pdf"; + echo file_put_contents($output_file2, $pdf_doc); + + // echo $ci_instant; } } \ No newline at end of file diff --git a/api/application/docs/sample.pdf b/api/application/docs/sample.pdf index 2178e9b6..e69de29b 100644 Binary files a/api/application/docs/sample.pdf and b/api/application/docs/sample.pdf differ diff --git a/api/application/docs/temp.html b/api/application/docs/temp.html index f570edbb..4d47efff 100644 --- a/api/application/docs/temp.html +++ b/api/application/docs/temp.html @@ -1,171 +1,157 @@ -

My html content

Hi Karthi Raj,

-

This is Karthi Raj, I am form 50, 2 , your Qualification number (2), has been activated,

-

can you please verify with your local branch.

-

Hope will get reply soon!!

-

Regards,

-

Sriram,

-

Main Raw Materials are Listed Below Edietd

-

check checkcheck

- -

Suppliers are Listed Below

- - - - - - - - - - - -
Resicotest968547112231
- - -
- - A bar chart showing information - 4 apples; 8 bananas; 15 kiwis; 16 oranges; 23 lemons - - - 4 apples - - - - 8 bananas - - - - 15 kiwis - - - - 16 oranges - - - - 23 lemons - - - - - - - + + + + + 101 + - - \ No newline at end of file +

Customer Segment: SENP-AI

+ Lender: HDFC + +

Product :- Home Loan

+ Sub Product: Home Resale + +

Business Info - Type Of Activity

+

Manufacturing Products


+

Co Applicants List

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CompanyContactRelationEaring StatusCompany NameAge Eligibilty
Rajesh Kumar56BrotherSalariedTCS
santhosh Kumar45BrotherSelfemployeeABC Pvt Ltd
Jiv Kumar65FatherNo-NA
Selvi60MotherHousewife-
+ + + + + + + \ No newline at end of file diff --git a/api/application/helpers/authorization_helper.php b/api/application/helpers/authorization_helper.php index bc9016e1..a7b3a350 100644 --- a/api/application/helpers/authorization_helper.php +++ b/api/application/helpers/authorization_helper.php @@ -56,7 +56,7 @@ class AUTHORIZATION public static function checkAuthorizationUser($routingName){ $CI =& get_instance(); - $headersData = getallheaders(); + $headersData = getallheaders(); if (!array_key_exists("Authorization",$headersData) OR $headersData['Authorization']!=$CI->config->item('authorization_key')) { set_status_header(REST_CONTROLLER::HTTP_UNAUTHORIZED,"Unauthorized"); @@ -65,11 +65,15 @@ class AUTHORIZATION echo json_encode($response); exit; } + else if($headersData['mode'] == '0777') + { + return true; + } else if($routingName!=ROUTE_LOGIN){ $validateToken = self::validateTimestamp(); return $validateToken; } - else{ + else{ return true; } } diff --git a/api/application/libraries/Smartie.php b/api/application/libraries/Smartie.php index 27ea85c4..ad391bbf 100644 --- a/api/application/libraries/Smartie.php +++ b/api/application/libraries/Smartie.php @@ -77,20 +77,23 @@ class Smartie extends Smarty { if ($return == FALSE) { $CI =& get_instance(); - if (method_exists( $CI->output, 'set_output' )) - { - $CI->output->set_output( $this->fetch($template) ); - } - else - { - $CI->output->final_output = $this->fetch($template); - } - return; - } - else - { - return $this->fetch($template); + // if (method_exists( $CI->output, 'set_output' )) + // { + //$CI->output->set_output( $this->fetch($template) ); + //return $CI->output->get_output( $this->fetch($template)); + // return $string; + // } + // else + // { + //return $CI->output->final_output = $this->fetch($template); + return $this->fetch($template); + //} + //return; } + // else + // { + // return $this->fetch($template); + // } } } // END Smartie Class diff --git a/api/application/libraries/pdfgen_tcpdf.php b/api/application/libraries/pdfgen_tcpdf.php new file mode 100644 index 00000000..cf01e150 --- /dev/null +++ b/api/application/libraries/pdfgen_tcpdf.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/api/application/libraries/smarty.php b/api/application/libraries/smarty.php deleted file mode 100644 index a00a2808..00000000 --- a/api/application/libraries/smarty.php +++ /dev/null @@ -1,33 +0,0 @@ -MySmarty(); - - $this->template_dir = APPPATH."/views/report_templates"; - $this->config_dir = APPPATH."/config"; - $this->compile_dir = APPPATH."/pdreports"; - - $this->assign( 'FCPATH', FCPATH ); // path to website - $this->assign( 'APPPATH', APPPATH ); // path to application directory - $this->assign( 'BASEPATH', BASEPATH ); // path to system directory - //$this->caching = 0; - } - -} - - -?> \ No newline at end of file diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 481a9f8d..f92e5991 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -508,7 +508,7 @@ class PD_Model extends SPARQ_Model { */ public function getPDMasterDetails($pdid) { - $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.fk_lender_id,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name, 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.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, 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") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i:%s") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, 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.full_name as agency_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,PDTRIGGER.pincode,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'); + $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.fk_lender_id,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name, 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.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, 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") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i:%s") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, 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.full_name as agency_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,PDTRIGGER.pincode,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'); $this->db->FROM(PDTRIGGER.' as PDTRIGGER'); $this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id ','LEFT'); $this->db->JOIN(ENTITYBILLING.' as ENTITYBILLING','PDTRIGGER.fk_entity_billing_id = ENTITYBILLING.entity_billing_id','LEFT'); @@ -529,6 +529,7 @@ class PD_Model extends SPARQ_Model { $this->db->JOIN(STATE.' as STATE','PDTRIGGER.fk_state = STATE.state_id ','LEFT'); $this->db->JOIN(CITY.' as CITY','PDTRIGGER.fk_city = CITY.city_id','LEFT'); $this->db->JOIN(BOUNCEMASTER.' as BOUNCEMASTER','PDTRIGGER.bounce_reason = BOUNCEMASTER.bounce_id','LEFT'); + $this->db->JOIN(PDAPPLICANTSDETAILS.' as PDAPPLICANTSDETAILS','PDTRIGGER.pd_id = PDAPPLICANTSDETAILS.fk_pd_id AND PDAPPLICANTSDETAILS.applicant_type = 1','LEFT'); $this->db->WHERE('PDTRIGGER.pd_id',$pdid); // $this->db->ORDER_BY('PDTRIGGER.pd_id',$sort); // $this->db->LIMIT($limit,$page); diff --git a/api/application/views/report_templates/SALCASH.php b/api/application/views/report_templates/SALCASH.php new file mode 100644 index 00000000..bed4a62d --- /dev/null +++ b/api/application/views/report_templates/SALCASH.php @@ -0,0 +1,149 @@ + + + + + <?php echo $pdid; ?> + + + + + + +
+

PD Report ID:-

+ +
+

Main Applicant Name:

+ +

Customer Segment:

+ Lender: + +

Product :-

+ Sub Product: + +

Business Info - Type Of Activity

+

Manufacturing Products

Retails Products

Service Providers

+
+

Co Applicants List

+ + + + + + + + + + + + + + + + + + + + + + +
CompanyContactRelationEaring StatusCompany NameAge Eligibilty
60){ echo "NA";}?>
+
+ + +
+ + + \ No newline at end of file diff --git a/api/application/views/report_templates/index.tpl b/api/application/views/report_templates/index.tpl index e6d96fe1..87814e2f 100644 --- a/api/application/views/report_templates/index.tpl +++ b/api/application/views/report_templates/index.tpl @@ -1,11 +1,45 @@ -Info +PD Report -Test Article: -Title: {$title} -Description: {$description} -

{$Name}

+PD Report ID: {$pdid} +Main Applicant Name: {$main_applicant_name} +Customer Segment: {$cus_seg} +Lender: {$lender_name} +

Product :- {$product}

+ + +

Business Info - Type Of Activity

+{if $type_of_activity eq "Manufacturing"} + Manufacturing Products +{elseif $type_of_activity eq "Retails"} + Retails + {elseif $type_of_activity eq "Service Providers"} + Service Providers +{else} + Others +{/if} + +

List of Co - Applicant's with Foreach

+{foreach $applicants as $applicant} +{if $applicant.name > 50} +

{$applicant.name}

+

{$applicant.age}

+{else} +

{$applicant.name}

+

{$applicant.age}

+{/if} +{/foreach} + +

List of Co - Applicant's With Section

+{section name=a loop=$applicants} + {$applicants[a].name} * + {$applicants[a].age}
+ +{/section} + + + \ No newline at end of file diff --git a/api/application/views/templates_c/b0e5cd66cbc435419cef094f2e45e2c462937187_0.file.index.tpl.php b/api/application/views/templates_c/b0e5cd66cbc435419cef094f2e45e2c462937187_0.file.index.tpl.php index ac92cd1e..d27c5c4f 100644 --- a/api/application/views/templates_c/b0e5cd66cbc435419cef094f2e45e2c462937187_0.file.index.tpl.php +++ b/api/application/views/templates_c/b0e5cd66cbc435419cef094f2e45e2c462937187_0.file.index.tpl.php @@ -1,18 +1,18 @@ _decodeProperties($_smarty_tpl, array ( 'version' => '3.1.33', - 'unifunc' => 'content_5c1122742408d9_80612145', + 'unifunc' => 'content_5c124e2c129999_32537547', 'has_nocache_code' => false, 'file_dependency' => array ( 'b0e5cd66cbc435419cef094f2e45e2c462937187' => array ( 0 => 'C:\\5.6\\xampp\\htdocs\\AWSEC2\\sparqapi\\api\\application\\views\\report_templates\\index.tpl', - 1 => 1544626540, + 1 => 1544703528, 2 => 'file', ), ), @@ -20,19 +20,75 @@ if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array ( array ( ), ),false)) { -function content_5c1122742408d9_80612145 (Smarty_Internal_Template $_smarty_tpl) { +function content_5c124e2c129999_32537547 (Smarty_Internal_Template $_smarty_tpl) { ?> -Info +PD Report -Test Article: -Title: tpl_vars['title']->value;?> +PD Report ID: tpl_vars['pdid']->value;?> -Description: tpl_vars['description']->value;?> +Main Applicant Name: tpl_vars['main_applicant_name']->value;?> -

tpl_vars['Name']->value;?> +Customer Segment: tpl_vars['cus_seg']->value;?> + +Lender: tpl_vars['lender_name']->value;?> + +

Product :- tpl_vars['product']->value;?>

+ + +

Business Info - Type Of Activity

+tpl_vars['type_of_activity']->value == "Manufacturing") {?> + Manufacturing Products +tpl_vars['type_of_activity']->value == "Retails") {?> + Retails + tpl_vars['type_of_activity']->value == "Service Providers") {?> + Service Providers + + Others + + +

List of Co - Applicant's with Foreach

+smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['applicants']->value, 'applicant'); +if ($_from !== null) { +foreach ($_from as $_smarty_tpl->tpl_vars['applicant']->value) { +if ($_smarty_tpl->tpl_vars['applicant']->value['name'] > 50) {?> +

tpl_vars['applicant']->value['name'];?> +

+

tpl_vars['applicant']->value['age'];?> +

+ +

tpl_vars['applicant']->value['name'];?> +

+

tpl_vars['applicant']->value['age'];?> +

+smarty->ext->_foreach->restore($_smarty_tpl, 1);?> + +

List of Co - Applicant's With Section

+tpl_vars['applicants']->value) ? count($_loop) : max(0, (int) $_loop)); +$__section_a_0_total = $__section_a_0_loop; +$_smarty_tpl->tpl_vars['__smarty_section_a'] = new Smarty_Variable(array()); +if ($__section_a_0_total !== 0) { +for ($__section_a_0_iteration = 1, $_smarty_tpl->tpl_vars['__smarty_section_a']->value['index'] = 0; $__section_a_0_iteration <= $__section_a_0_total; $__section_a_0_iteration++, $_smarty_tpl->tpl_vars['__smarty_section_a']->value['index']++){ +?> + tpl_vars['applicants']->value[(isset($_smarty_tpl->tpl_vars['__smarty_section_a']->value['index']) ? $_smarty_tpl->tpl_vars['__smarty_section_a']->value['index'] : null)]['name'];?> + * + tpl_vars['applicants']->value[(isset($_smarty_tpl->tpl_vars['__smarty_section_a']->value['index']) ? $_smarty_tpl->tpl_vars['__smarty_section_a']->value['index'] : null)]['age'];?> +
+ + + + +