This commit is contained in:
velz 2018-12-15 12:50:06 +05:30
parent fad0b0fda4
commit aacb6796c0
15 changed files with 543 additions and 300 deletions

View File

@ -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": {

View File

@ -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": [],

View File

@ -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');

View File

@ -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';

View File

@ -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;
}
}

Binary file not shown.

View File

@ -1,171 +1,157 @@
<p><span style='color:#27ae60'>My </span><span style='color:#27ae60'>html</span><span style='color:#27ae60'> content</span></p><p style='color: #ddd; font-size: 20px;'>Hi Karthi Raj,</p>
<p>This is Karthi Raj, I am form 50, 2 , your Qualification number (2), has been activated,</p>
<p>can you please verify with your local branch.</p>
<p>Hope will get reply soon!!</p>
<p><strong>Regards,</strong></p>
<p onclick='alert()'>Sriram,</p>
<p style='font-weight: bold;'>Main Raw Materials are Listed Below Edietd</p>
<p>check checkcheck</p>
<p style='font-weight: bold;'>Suppliers are Listed Below</p>
<table style='height: 9px; margin-left: auto; margin-right: auto;' border=1 width='401'>
<tbody>
<tr>
<td style='width: 192.5px;'>Resico</td>
<td style='width: 192.5px;'>test</td>
<td style='width: 192.5px;'>9685471122</td>
<td style='width: 192.5px;'>3</td>
<td style='width: 192.5px;'>1</td>
</tr>
</tbody>
</table>
<hr>
<svg class='chart' width='420' height='150' aria-labelledby='title desc' role='img'>
<title id='title'>A bar chart showing information</title>
<desc id='desc'>4 apples; 8 bananas; 15 kiwis; 16 oranges; 23 lemons</desc>
<g class='bar'>
<rect width='40' height='19'></rect>
<text x='45' y='9.5' dy='.35em'>4 apples</text>
</g>
<g class='bar'>
<rect width='80' height='19' y='20'></rect>
<text x='85' y='28' dy='.35em'>8 bananas</text>
</g>
<g class='bar'>
<rect width='150' height='19' y='40'></rect>
<text x='150' y='48' dy='.35em'>15 kiwis</text>
</g>
<g class='bar'>
<rect width='160' height='19' y='60'></rect>
<text x='161' y='68' dy='.35em'>16 oranges</text>
</g>
<g class='bar'>
<rect width='230' height='19' y='80'></rect>
<text x='235' y='88' dy='.35em'>23 lemons</text>
</g>
</svg>
<svg viewBox='0 0 500 100' class='chart'>
<polyline
fill='none'
stroke='#0074d9'
stroke-width='2'
points='
00,120
20,60
40,80
60,20
80,80
100,80
120,60
140,100
160,90
180,80
200, 110
220, 10
240, 70
260, 100
280, 100
300, 40
320, 0
340, 100
360, 100
380, 120
400, 60
420, 70
440, 80
'
></polyline>
</svg>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>101</title>
<style>
.bar {
fill: red; /* changes the background */
height: 21px;
transition: fill .3s ease;
cursor: pointer;
font-family: Helvetica, sans-serif;
}
.bar text {
color: black;
}
.bar:hover,
.bar:focus {
fill: black;
}
.bar:hover text,
.bar:focus text {
fill: red;
}
.chart {
background: white;
width: 500px;
height: 100px;
border-left: 1px dotted #555;
border-bottom: 1px dotted #555;
padding: 20px 20px 20px 0;
}
</style>
<script>
var total = 158,
buttons = document.querySelector('.buttons'),
pie = document.querySelector('.pie'),
activeClass = 'active';
<style type="text/css">
var continents = {
asia: 60,
northAmerica : 5,
southAmerica: 9,
oceania: 1,
africa: 15,
europe: 12
};
::selection { background-color: #E13300; color: white; }
::-moz-selection { background-color: #E13300; color: white; }
// work out percentage as a result of total
var numberFixer = function(num){
var result = ((num * total) / 100);
return result;
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#body {
margin: 0 15px 0 15px;
}
p.footer {
text-align: right;
font-size: 11px;
border-top: 1px solid #D0D0D0;
line-height: 32px;
padding: 0 10px 0 10px;
margin: 20px 0 0 0;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
box-shadow: 0 0 8px #D0D0D0;
}
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
// create a button for each country
for(property in continents){
var newEl = document.createElement('button');
newEl.innerText = property;
newEl.setAttribute('data-name', property);
buttons.appendChild(newEl);
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
// when you click a button setPieChart and setActiveClass
buttons.addEventListener('click', function(e){
if(e.target != e.currentTarget){
var el = e.target,
name = el.getAttribute('data-name');
setPieChart(name);
setActiveClass(el);
}
e.stopPropagation();
});
var setPieChart = function(name){
var number = continents[name],
fixedNumber = numberFixer(number),
result = fixedNumber + ' ' + total;
pie.style.strokeDasharray = result;
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
</head>
<body>
var setActiveClass = function(el) {
for(var i = 0; i < buttons.children.length; i++) {
buttons.children[i].classList.remove(activeClass);
el.classList.add(activeClass);
}
}
<div id="container">
<h1>PD Report ID:- <b>101</b></h1>
<div id="body">
<p style="color:green;font-size:20px;">Main Applicant Name: <b>Mr.Ram Kumar</b></p>
// Set up default settings
setPieChart('asia');
setActiveClass(buttons.children[0]);
</script>
<p>Customer Segment: <b>SENP-AI</b></p>
<code>Lender: <b>HDFC</b></code>
<p>Product :- <b>Home Loan</b></p>
<code>Sub Product: <b>Home Resale</b></code>
<p>Business Info - Type Of Activity</p>
<h2>Manufacturing Products</h2> <hr>
<h2>Co Applicants List</h2>
<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Relation</th>
<th>Earing Status</th>
<th>Company Name</th>
<th>Age Eligibilty</th>
</tr>
<tr>
<td>Rajesh Kumar</td>
<td>56</td>
<td>Brother</td>
<td>Salaried</td>
<td>TCS</td>
<td></td>
</tr>
<tr>
<td>santhosh Kumar</td>
<td>45</td>
<td>Brother</td>
<td>Selfemployee</td>
<td>ABC Pvt Ltd</td>
<td></td>
</tr>
<tr>
<td>Jiv Kumar</td>
<td>65</td>
<td>Father</td>
<td>No</td>
<td>-</td>
<td>NA</td>
</tr>
<tr>
<td>Selvi</td>
<td>60</td>
<td>Mother</td>
<td>Housewife</td>
<td>-</td>
<td></td>
</tr>
</table>
</div>
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds. CodeIgniter Version <strong>3.1.6</strong></p>
</div>
</body>
</html>

View File

@ -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;
}
}

View File

@ -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

View File

@ -0,0 +1,19 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed');
include_once APPPATH.'/vendor/autoload.php';
include_once APPPATH.'/vendor/tecnickcom/tcpdf';
class pdfgen_tcpdf extends TCPDF
{
function __construct()
{
parent::__construct();
}
}
?>

View File

@ -1,33 +0,0 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed');
include_once APPPATH.'/vendor/autoload.php';
include_once APPPATH.'/vendor/smarty/smarty/libs/Smarty.class.php';
// include_once APPPATH.'/vendor/smarty/Smarty.php';
class MySmarty extends Smarty
{
function __construct()
{
parent::__construct();
$this->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;
}
}
?>

View File

@ -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);

View File

@ -0,0 +1,149 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo $pdid; ?></title>
<style type="text/css">
::selection { background-color: #E13300; color: white; }
::-moz-selection { background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#body {
margin: 0 15px 0 15px;
}
p.footer {
text-align: right;
font-size: 11px;
border-top: 1px solid #D0D0D0;
line-height: 32px;
padding: 0 10px 0 10px;
margin: 20px 0 0 0;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
box-shadow: 0 0 8px #D0D0D0;
}
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
</head>
<body>
<div id="container">
<h1>PD Report ID:- <b><?php echo $pdid; ?></b></h1>
<div id="body">
<p style="color:green;font-size:20px;">Main Applicant Name: <b><?php echo $main_applicant_name; ?></b></p>
<p>Customer Segment: <b><?php echo $cus_seg; ?></b></p>
<code>Lender: <b><?php echo $lender_name; ?></b></code>
<p>Product :- <b><?php echo $product; ?></b></p>
<code>Sub Product: <b><?php echo $sub_product; ?></b></code>
<p>Business Info - Type Of Activity</p>
<?php if($type_of_activity == "Manufacturing")
{
?> <h2>Manufacturing Products</h2> <?php
}
else if($type_of_activity == "Retails")
{
?> <h2>Retails Products</h2> <?php
}
else if($type_of_activity == "Service Providers")
{
?> <h2>Service Providers</h2> <?php
}?>
<hr>
<h2>Co Applicants List</h2>
<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Relation</th>
<th>Earing Status</th>
<th>Company Name</th>
<th>Age Eligibilty</th>
</tr>
<?php
foreach($applicants as $applicant)
{?>
<tr>
<td><?php echo $applicant['name']?></td>
<td><?php echo $applicant['age']?></td>
<td><?php echo $applicant['relation']?></td>
<td><?php echo $applicant['es']?></td>
<td><?php echo $applicant['cn']?></td>
<td><?php if($applicant['age'] > 60){ echo "NA";}?></td>
</tr>
<?php
}
?>
</table>
</div>
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds. <?php echo (ENVIRONMENT === 'development') ? 'CodeIgniter Version <strong>' . CI_VERSION . '</strong>' : '' ?></p>
</div>
</body>
</html>

View File

@ -1,11 +1,45 @@
<html>
<head>
<title>Info</title>
<title>PD Report</title>
</head>
<body>
Test Article:
Title: {$title}
Description: {$description}
<p>{$Name}</p>
PD Report ID: {$pdid}
Main Applicant Name: {$main_applicant_name}
Customer Segment: {$cus_seg}
Lender: {$lender_name}
<p>Product :- {$product}</p>
<!-- command -->
<p>Business Info - Type Of Activity</p>
{if $type_of_activity eq "Manufacturing"}
<span>Manufacturing Products</span>
{elseif $type_of_activity eq "Retails"}
<span>Retails</span>
{elseif $type_of_activity eq "Service Providers"}
<span>Service Providers</span>
{else}
<span>Others</span>
{/if}
<p><b>List of Co - Applicant's with Foreach</b></p>
{foreach $applicants as $applicant}
{if $applicant.name > 50}
<h2 style="color:red;">{$applicant.name}</h2>
<h3>{$applicant.age}</h3>
{else}
<h2>{$applicant.name}</h2>
<h3>{$applicant.age}</h3>
{/if}
{/foreach}
<p><b>List of Co - Applicant's With Section</b></p>
{section name=a loop=$applicants}
{$applicants[a].name} *
{$applicants[a].age}<br/>
{/section}
</body>
</html>

View File

@ -1,18 +1,18 @@
<?php
/* Smarty version 3.1.33, created on 2018-12-12 20:30:04
/* Smarty version 3.1.33, created on 2018-12-13 17:48:52
from 'C:\5.6\xampp\htdocs\AWSEC2\sparqapi\api\application\views\report_templates\index.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_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) {
?><html>
<head>
<title>Info</title>
<title>PD Report</title>
</head>
<body>
Test Article:
Title: <?php echo $_smarty_tpl->tpl_vars['title']->value;?>
PD Report ID: <?php echo $_smarty_tpl->tpl_vars['pdid']->value;?>
Description: <?php echo $_smarty_tpl->tpl_vars['description']->value;?>
Main Applicant Name: <?php echo $_smarty_tpl->tpl_vars['main_applicant_name']->value;?>
<p><?php echo $_smarty_tpl->tpl_vars['Name']->value;?>
Customer Segment: <?php echo $_smarty_tpl->tpl_vars['cus_seg']->value;?>
Lender: <?php echo $_smarty_tpl->tpl_vars['lender_name']->value;?>
<p>Product :- <?php echo $_smarty_tpl->tpl_vars['product']->value;?>
</p>
<!-- command -->
<p>Business Info - Type Of Activity</p>
<?php if ($_smarty_tpl->tpl_vars['type_of_activity']->value == "Manufacturing") {?>
<span>Manufacturing Products</span>
<?php } elseif ($_smarty_tpl->tpl_vars['type_of_activity']->value == "Retails") {?>
<span>Retails</span>
<?php } elseif ($_smarty_tpl->tpl_vars['type_of_activity']->value == "Service Providers") {?>
<span>Service Providers</span>
<?php } else { ?>
<span>Others</span>
<?php }?>
<p><b>List of Co - Applicant's with Foreach</b></p>
<?php
$_from = $_smarty_tpl->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) {?>
<h2 style="color:red;"><?php echo $_smarty_tpl->tpl_vars['applicant']->value['name'];?>
</h2>
<h3><?php echo $_smarty_tpl->tpl_vars['applicant']->value['age'];?>
</h3>
<?php } else { ?>
<h2><?php echo $_smarty_tpl->tpl_vars['applicant']->value['name'];?>
</h2>
<h3><?php echo $_smarty_tpl->tpl_vars['applicant']->value['age'];?>
</h3>
<?php }
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<p><b>List of Co - Applicant's With Section</b></p>
<?php
$__section_a_0_loop = (is_array(@$_loop=$_smarty_tpl->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']++){
?>
<?php echo $_smarty_tpl->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'];?>
*
<?php echo $_smarty_tpl->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'];?>
<br/>
<?php
}
}
?>
</body>
</html><?php }
}