diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 368abf0f..0da02515 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -1339,6 +1339,8 @@ class PD_Controller extends REST_Controller { if($pd_id_modified != "" || $pd_id_modified != null) { + $logger = MYLOG::logFunction(); + $logger->info("PD UPDATED",array('ENV'=>ENVIRONMENT,'DATA' => $records,'Pre-Status' => 'TRIGGERED','Current_status' => $records['pd_status'])); PDALERTS::pdnotification($records['pd_id']); $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; @@ -1370,38 +1372,40 @@ class PD_Controller extends REST_Controller { $temp_array = array('pd_status' => SCHEDULED,'fk_updatedby'=>$records['fk_scheduled_by'],'scheduled_on'=>$records['schedule_time']); $pd_id_modified = $this->PD_Model->updateRecords($temp_array,PDTRIGGER,$where_condition_array); - /******* Code Snippt for Save Template Category Weightage info to PD category Info*/ - $fields = array('fk_pd_template_id'); - $where_condition_array = array('pd_id'=>$records['fk_pd_id']); - $res_array = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDTRIGGER); + // /******* Code Snippt for Save Template Category Weightage info to PD category Info*/ + // $fields = array('fk_pd_template_id'); + // $where_condition_array = array('pd_id'=>$records['fk_pd_id']); + // $res_array = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDTRIGGER); - if(count($res_array)) - { - $fields = array('fk_pd_template_id'); - $where_condition_array = array('pd_id'=>$records['fk_pd_id']); - $res_array = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDTRIGGER); + // if(count($res_array)) + // { + // $fields = array('fk_pd_template_id'); + // $where_condition_array = array('pd_id'=>$records['fk_pd_id']); + // $res_array = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDTRIGGER); - if(count($res_array)) - { - $template_id = $res_array[0]['fk_pd_template_id']; + // if(count($res_array)) + // { + // $template_id = $res_array[0]['fk_pd_template_id']; - $fields = array('fk_question_category_id','weightage'); - $where_condition_array = array('fk_template_id'=>$template_id); - $template_categories = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,TEMPLATECATEGORYWEIGHTAGE); + // $fields = array('fk_question_category_id','weightage'); + // $where_condition_array = array('fk_template_id'=>$template_id); + // $template_categories = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,TEMPLATECATEGORYWEIGHTAGE); - foreach($template_categories as $key => $category) - { - $temp_data = array('fk_pd_id'=>$records['fk_pd_id'],'fk_category_id'=>$category['fk_question_category_id'],'pd_category_weightage'=>$category['weightage']); - $this->PD_Model->saveRecords($temp_data,PDCATEGORYWEIGHTAGE); - } - } - } + // foreach($template_categories as $key => $category) + // { + // $temp_data = array('fk_pd_id'=>$records['fk_pd_id'],'fk_category_id'=>$category['fk_question_category_id'],'pd_category_weightage'=>$category['weightage']); + // $this->PD_Model->saveRecords($temp_data,PDCATEGORYWEIGHTAGE); + // } + // } + // } /******* End of Code Snippt Save Template Category Weightage info to PD category Info*/ if($pd_id_modified != "" || $pd_id_modified != null) { PDALERTS::pdnotification($records['fk_pd_id']); + $logger = MYLOG::logFunction(); + $logger->info("PD UPDATED",array('ENV'=>ENVIRONMENT,'DATA' => $records,'Pre-Status' => 'NA','Current_status' => SCHEDULED)); $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; $data['records'] = true; @@ -5114,8 +5118,10 @@ class PD_Controller extends REST_Controller { $records = $this->post('records'); $pdid = $records['pd_id']; - // $this->load->helper('push_notification'); - // PUSH_NOTIFICATION::notifyMob('fzVpWPyynTI:APA91bH16QpgugWec5VAMRPXu8kDFytkMRxXGRJGm1XJwd5H6oWmp8OCTfx7F8qj97zC0i7oyg73uRFkZS6rOxeJbkTk6KJN5mYZT5gRJIDJ_CQ6n6nuQZ5LwFs9_x9cr5sraA5ADyMu','EST','test mesg from server',1);die(); + $this->load->helper('push_notification'); + PUSH_NOTIFICATION::notifyWeb('fbm57p_E5xc:APA91bENk6ZH7J2kj03liCy0FzrtsYUgVjvoYnPBi4bu4UtGjqixn0Z_cUDHjCHeBWNcXlVozoo_uUKr8gwufcOQMfdRK19_sWN9jA5U1hRuwJTpIQKows6wYSHFH7kI4EnnUaj0FtK_','EST','test mesg from server',1);die(); + + //PDALERTS::pdnotification(1143);die(); //$this->demo(5); // $this->demo(0); @@ -5199,7 +5205,7 @@ class PD_Controller extends REST_Controller { //echo "*******************************************"; $t = $this->load->view('report_templates/JSONTOREPORT',$data,true); //$t = $this->load->view('temp_html.html',null,true); - echo $t; + //echo $t; //die(); $total_replaces = substr_count($t,''); @@ -5221,7 +5227,6 @@ class PD_Controller extends REST_Controller { $t = substr_replace($t,'',$start_pos,($end_pos - $start_pos)); - $t = substr_replace($t,'',strpos($t,''),(strlen(''))); } @@ -5229,6 +5234,7 @@ class PD_Controller extends REST_Controller { //PDF Gen using DOM PDF + //$this->pdfgenerator->setEncryption('test1234'); $pdf_doc = $this->pdfgenerator->generate($t, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); //End of PDF Gen using DOM PDF $output_file2 = APPPATH."/docs/sample.pdf"; @@ -5268,7 +5274,6 @@ class PD_Controller extends REST_Controller { { $pd_form_raw_data[$raw_key]['actual_score'] = null; $pd_form_raw_data[$raw_key]['exact_score'] = null; - } } @@ -5296,6 +5301,17 @@ class PD_Controller extends REST_Controller { { $fields = array('qc_remarks','pd_status'); } + else if($records['flag'] == 'OFFICER_REMARKS') + { + $fields = array('pd_qc_note'); + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NO_CONTENT; + $data['msg'] = 'InAppropriate Params!'; + $this->response($data,REST_Controller::HTTP_OK); + } $where_condition_array = array('pd_id'=>$pdid); $result = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDTRIGGER); diff --git a/api/application/docs/sample.pdf b/api/application/docs/sample.pdf index 78834aa5..73b88f8d 100644 Binary files a/api/application/docs/sample.pdf and b/api/application/docs/sample.pdf differ diff --git a/api/application/helpers/assetsform_helper.php b/api/application/helpers/assetsform_helper.php index 41d04770..b26f397b 100644 --- a/api/application/helpers/assetsform_helper.php +++ b/api/application/helpers/assetsform_helper.php @@ -146,13 +146,15 @@ public static function getOthersAssetsDetails($values){ $fourth_row = 'Owned by'; $fifth_row = 'Market Value'; $sixth_row = 'Monthly Rent'; - $seventh_row = 'Age of Asset'; + $seventh_row = 'Age of Asset(Yrs)'; $eighth_row = 'Loan (Y/N)'; $rupee_symbol = ""; $rental_flag = 0; $owned_flag = 0; $show_table = 1; $overall_empty_flag = 0; + $is_rented = false; + $is_owned = false; foreach($business_assets as $bsk => $fetchVal){ @@ -173,23 +175,24 @@ public static function getOthersAssetsDetails($values){ $owners_list = substr_replace($owners_list, '', strrpos($owners_list, ','),1); $owners_list = $owners_list != "" || $owners_list != null ? $owners_list : 'NA'; - $ownership_type = 'NA'; + $ownership_type = $fetchVal['business_ownership_type']; if(!strcasecmp($fetchVal['business_ownership_type'],'owned')) { - $ownership_type = ($fetchVal['business_ownership_type']); - $owned_flag++; + $is_owned = true; + //$owned_flag++; }else if(!strcasecmp($fetchVal['business_ownership_type'],'rented')) { - $ownership_type = ($fetchVal['business_ownership_type']); - $rental_flag++; + $is_rented = true; + ///$rental_flag++; } if($fetchVal['business_assets_mode']==4){ $header_row .= 'Asset '.($bsk+1).''; $first_row .= ''.$fetchVal['business_assets_mode_master'].''; - $sec_row .= ''.($fetchVal['business_details'][0]['equipment_manufacturing_description']).' purchased at '.$fetchVal['business_purchase_year'] .''; + $sec_row .= ''.($fetchVal['business_details'][0]['equipment_manufacturing_description']).''; + $sec_row .= $fetchVal['business_purchase_year'] != '' || $fetchVal['business_purchase_year'] != null ? 'purchased at '.$fetchVal['business_purchase_year'] .'' : ''; $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').''; @@ -202,7 +205,9 @@ public static function getOthersAssetsDetails($values){ else if($fetchVal['business_assets_mode']==3){ $header_row .= 'Asset '.($bsk+1).''; $first_row .= ''.$fetchVal['business_assets_mode_master'].''; - $sec_row .= ''.($fetchVal['business_details'][0]['manufacturer_model_vehicle']).' purchased at '.$fetchVal['business_purchase_year'].''; + $sec_row .= ''.($fetchVal['business_details'][0]['manufacturer_model_vehicle']).''; + + $sec_row .= $fetchVal['business_purchase_year'] != '' || $fetchVal['business_purchase_year'] != null ? 'purchased at '.$fetchVal['business_purchase_year'].'' : ''; $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').''; @@ -244,14 +249,15 @@ public static function getOthersAssetsDetails($values){ $sec_row .= ''; $third_row .= ''; $fourth_row .= ''; - $fourth_row = $owned_flag != 0 ? $fourth_row : ''; + $fourth_row = $is_owned ? $fourth_row : ''; $fifth_row .= ''; - $fifth_row = $owned_flag != 0 ? $fifth_row : ''; + $fifth_row = $is_owned ? $fifth_row : ''; $sixth_row .= ''; - $sixth_row = $owned_flag != 0 ? $sixth_row : ''; + $sixth_row = $is_rented ? $sixth_row : ''; $seventh_row .= ''; + $seventh_row = $is_owned ? $seventh_row : ''; $eighth_row .= ''; - $eighth_row = $owned_flag != 0 ? $eighth_row : ''; + $eighth_row = $is_owned ? $eighth_row : ''; return array('header_row' => $header_row, 'first_row' => $first_row,'sec_row'=> $sec_row,'third_row' =>$third_row,'fourth_row'=>$fourth_row,'fifth_row'=>$fifth_row,'sixth_row'=>$sixth_row,'seventh_row'=>$seventh_row,'eighth_row'=>$eighth_row,'show_table'=> $show_table); } diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index 7caaa98a..48179606 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -42,10 +42,10 @@ class PDALERTS $CI->db->JOIN(USERNOTIFICATIONTOKENS." as CENTRALPDOFFICERTOKEN","PDTRIGGER.central_pd_officer_id = CENTRALPDOFFICERTOKEN.fk_user_id",'LEFT'); $CI->db->WHERE("PDTRIGGER.pd_id",$pdid); $core_details = $CI->db->GET()->result_array(); - //print_r($core_details); + // print_r($core_details); - //die(); + // die(); if(count($core_details)) { @@ -322,12 +322,17 @@ class PDALERTS } + + $msg = $pd_notification_msg[0]['qc_team']; + $msg = self::stringReplace($msg,$core_details); + + foreach ($qc_team_web_token as $key => $value) { - PUSH_NOTIFICATION::sendNotification($value,null,$pd_status); + PUSH_NOTIFICATION::sendNotification($value,null,$pd_status,$msg); } foreach ($qc_team_mob_token as $key => $value) { - PUSH_NOTIFICATION::sendNotification(null,$value,$pd_status); + PUSH_NOTIFICATION::sendNotification(null,$value,$pd_status,$msg); } diff --git a/api/application/helpers/push_notification_helper.php b/api/application/helpers/push_notification_helper.php index 9b2ffbc6..e4c5f409 100644 --- a/api/application/helpers/push_notification_helper.php +++ b/api/application/helpers/push_notification_helper.php @@ -80,7 +80,7 @@ class PUSH_NOTIFICATION $result = curl_exec($ch ); curl_close( $ch ); $CI =&get_instance(); - //print_r($result); + print_r($result); MYLOG::logFunction()->info("PUSH NOTIFICATION ",array($result)); } } diff --git a/api/application/libraries/Pdfgenerator.php b/api/application/libraries/Pdfgenerator.php index ae780981..6228d5f2 100644 --- a/api/application/libraries/Pdfgenerator.php +++ b/api/application/libraries/Pdfgenerator.php @@ -23,7 +23,7 @@ class Pdfgenerator // echo 'stream'.$html.'tttt'; $dompdf = new Dompdf(array('enable_remote' => true,'DOMPDF_ENABLE_PHP'=>true,'DOMPDF_UNICODE_ENABLED' => true)); $dompdf->load_html($html); - + //$dompdf->setEncryption('test1234'); $dompdf->set_paper($paper, $orientation); $dompdf->render(); @@ -31,12 +31,14 @@ class Pdfgenerator //$font = Font_Metrics::get_font("helvetica", "bold"); $font = null; $canvas->page_text(515,760, "Page {PAGE_NUM} of {PAGE_COUNT}", $font,8, array(0,0,0)); + //$canvas->get_cpdf()->setEncryption('userpass', 'ownerpass', array('print', 'copy')); + //$canvas->get_cpdf()->setEncryption('userpass'); if ($stream) { $dompdf->stream($filename.".pdf", array("Attachment" => 0)); } else { return $dompdf->output(); - //$output_file2 = APPPATH."/docs/sample.pdf"; + //$output_file2 = APPPATH."/docs/sample.pdf"; //echo file_put_contents($output_file2, $dompdf->output()); // $CI =& get_instance(); // $CI->load->helper('file'); diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php index 13bfd99c..8ca5e50f 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -415,6 +415,18 @@ defined('BASEPATH') OR exit('No direct script access allowed'); .tooltip:hover .tooltiptext { visibility: visible; } + +#ini_table{ + table-layout: fixed; + width:80%; + + +} + +#ini_table td{ + word-wrap:break-word + width:50%; +} /* ######### TOOLTIP CSS END ######### */ @@ -463,25 +475,27 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo ""; echo "



"; ?> - + +
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; ?> - -
PD Initiated Date ".$pd_master_details[0]['createdon']."
PD Visit Date ".$pd_master_details[0]['pd_visit_date']."
PD Report Date ".$pd_master_details[0]['pd_report_generated_date']."
PD Initiated by ".$pd_master_details[0]['branch_name']." Branch
Loan Application ID ".$pd_master_details[0]['lender_applicant_id']."
Product ".$pd_master_details[0]['product_name']."
Customer Segment ".(explode('-',$pd_master_details[0]['customer_segment_name'])[0])."
PD Initiated Date : '.$pd_master_details[0]['createdon'].'
PD Visit Date : '.$pd_master_details[0]['pd_visit_date'].'
PD Report Date : '.$pd_master_details[0]['pd_report_generated_date'].'
PD Initiated by : '.$pd_master_details[0]['branch_name'].' Branch
Loan Application ID : '.$pd_master_details[0]['lender_applicant_id'].'
Product : '.$pd_master_details[0]['product_name'].'
Customer Segment : '.(explode('-',$pd_master_details[0]['customer_segment_name'])[0]).'
- + + + Loan Amount Applied For :

"; - echo ' - -
As Per PD Initiation ' .' '. MYUTIL::customIndianNumberFormat($pd_master_details[0]['loan_amount']). '
('. MYUTIL::numtowords($pd_master_details[0]['loan_amount']) .')
As Per Loan Applicants during PD ' .' '. MYUTIL::customIndianNumberFormat($loan_form['loan_amount']). '
('. MYUTIL::numtowords($loan_form['loan_amount']) .')
'; + //echo "

Loan Amount Applied For :

"; + //echo ' + echo ''; + echo '
Loan Amount
(As Per PD Initiation)
: ' .' '. MYUTIL::customIndianNumberFormat($pd_master_details[0]['loan_amount']). '
('. MYUTIL::numtowords($pd_master_details[0]['loan_amount']) .')
Loan Amount
(As Per Loan Applicants during PD)
: ' .' '. MYUTIL::customIndianNumberFormat($loan_form['loan_amount']). '
('. MYUTIL::numtowords($loan_form['loan_amount']) .')
'; //echo "
"; echo "

"; echo "

"; @@ -492,10 +506,12 @@ defined('BASEPATH') OR exit('No direct script access allowed'); if($pd_master_details[0]['lender_short_name'] == 'CLIX') { - echo '

Disclaimer: The information contained in this report (a) is provided for the benefit of Clix Capital Services Private Limited (hereinafter referred to as Clix) only, and is not for the benefit of any other parties; (b) has been compiled by Sineedge Consulting Private Limited (Hereinafter referred as SCPL) in accordance with the instructions given, by Clix; (c) has been obtained during the visit done at premises as instructed by Clix. Some of the information in this report, by the very nature of it, might have been obtained through informal sources. SCPL wishes to mention that all due care has been exercised by SCPL in collecting information and putting together this report. However, given the nature of some of these verifications, SCPL cannot be held liable for any financial or other loss to Clix on account of any errors or omissions in the report. SCPL does not guarantee absolute accuracy of information contained herein. SCPL does not take any responsibility for any action(s) that the client may take based on the contents of this report.

'; + echo '

Disclaimer: The information contained in this report (a) is provided for the benefit of Clix Capital Services Private Limited (hereinafter referred to as Clix) only, and is not for the benefit of any other parties; (b) has been compiled by Sineedge Consulting Private Limited (Hereinafter referred as SCPL) in accordance with the instructions given, by Clix; (c) has been obtained during the visit done at premises as instructed by Clix. Some of the information in this report, by the very nature of it, might have been obtained through informal sources. SCPL wishes to mention that all due care has been exercised by SCPL in collecting information and putting together this report. However, given the nature of some of these verifications, SCPL cannot be held liable for any financial or other loss to Clix on account of any errors or omissions in the report. SCPL does not guarantee absolute accuracy of information contained herein. SCPL does not take any responsibility for any action(s) that the client may take based on the contents of this report.

'; + + echo '

Registered / Corporate Office: SineEdge Consulting Private Limited. A-211, Pioneer Urban Square, Golf Course Extension Road, Sector 62, Gurgaon, Haryana - 122002

'; } - echo '

Registered / Corporate Office: SineEdge Consulting Private Limited. A-211, Pioneer Urban Square, Golf Course Extension Road, Sector 62, Gurgaon, Haryana - 122002

'; + ?> @@ -3021,7 +3037,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); // echo "######################################"; // print_r($ai_core_details_processed); - $order_dipaly_array = array('A','B','C','D','E','F','G'); + $order_dipaly_array = array('A','B','C','D','E','F','G','H','I','J'); $ai_summary_details = ($assessed_income_details[ ($business_count+1) ]['summary_details']); $ai_summary_details_processed = ASSESSEDINCOME::getSummaryTable($ai_summary_details,$ai_core_details); @@ -3732,7 +3748,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
-

PD OFFICERS` REMARKS ON CUSTOMER BEHAVIOUR, BUSINESS LOCATION & OVERALL PD STATUS

+

PD OFFICER`S REMARKS ON CUSTOMER BEHAVIOUR, BUSINESS LOCATION & OVERALL PD STATUS