LENDER HIERARCHY API :IST AND OTHER ISSUES
This commit is contained in:
parent
5b36c708c7
commit
9322d2f777
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,7 @@ class PD_Model extends SPARQ_Model {
|
||||
}
|
||||
|
||||
|
||||
public function listLessPDDetails($page,$limit,$sort,$pdofficerid,$datetype,$fdate,$tdate,$lenderid,$status)// $page represents mysql offset
|
||||
public function listLessPDDetails($page,$limit,$sort,$pdofficerid,$datetype,$fdate,$tdate,$lenderid,$status,$lender_details)// $page represents mysql offset
|
||||
{
|
||||
//echo $status;die();
|
||||
$this->db->SELECT('PDTRIGGER.pd_id,PDTRIGGER.pd_sno,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,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDTRIGGER.other_pincode,PDAPPLICANTSDETAILS.applicant_name,PDTRIGGER.is_otp_done,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.encrypted_url,PDTRIGGER.random_string,PDTRIGGER.pd_qc_note');
|
||||
@ -46,7 +46,34 @@ class PD_Model extends SPARQ_Model {
|
||||
|
||||
if($lenderid != "" || $lenderid != null)
|
||||
{
|
||||
$this->db->WHERE('PDTRIGGER.fk_createdby',$lenderid);
|
||||
//$this->db->WHERE('PDTRIGGER.fk_createdby',$lenderid);
|
||||
//print_r($lender_details);die();
|
||||
if(isset($lender_details['entity']))
|
||||
{
|
||||
$this->db->WHERE('PDTRIGGER.fk_lender_id',$lender_details['entity']);
|
||||
}
|
||||
|
||||
if(isset($lender_details['zone']))
|
||||
{
|
||||
$this->db->WHERE_IN('PDTRIGGER.fk_city',$lender_details['zone']);
|
||||
}
|
||||
|
||||
if(isset($lender_details['state']))
|
||||
{
|
||||
$this->db->WHERE('PDTRIGGER.fk_state',$lender_details['state']);
|
||||
}
|
||||
|
||||
if(isset($lender_details['city']))
|
||||
{
|
||||
$this->db->WHERE('PDTRIGGER.fk_city',$lender_details['city']);
|
||||
}
|
||||
|
||||
if(isset($lender_details['branch']))
|
||||
{
|
||||
$this->db->WHERE('PDTRIGGER.fk_city',$lender_details['pd_branch_id']);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if($status != "" || $status != null)
|
||||
@ -83,7 +110,7 @@ class PD_Model extends SPARQ_Model {
|
||||
$this->db->ORDER_BY('PDTRIGGER.pd_id',$sort);
|
||||
$this->db->LIMIT($limit,$page);
|
||||
$result_array = $this->db->GET()->result_array();
|
||||
// print_r($this->db->last_query());die();
|
||||
// print_r($this->db->last_query());die();
|
||||
if(count($result_array) != 0)
|
||||
{
|
||||
foreach($result_array as $key => $result)
|
||||
@ -828,7 +855,7 @@ class PD_Model extends SPARQ_Model {
|
||||
if($result_array[0]['fk_state'] == "" || $result_array[0]['fk_state'] == null){ $mandatory_fields[] = 'fk_state'; }
|
||||
|
||||
if($result_array[0]['pincode'] == "" || $result_array[0]['pincode'] == null){ $mandatory_fields[] = 'pincode'; }
|
||||
if($result_array[0]['short_name'] != 'IMGC')
|
||||
if($result_array[0]['lender_short_name'] != 'IMGC')
|
||||
{
|
||||
if($result_array[0]['pd_contact_person'] == "" || $result_array[0]['pd_contact_person'] == null){ $mandatory_fields[] = 'pd_contact_person'; }
|
||||
|
||||
@ -1815,6 +1842,16 @@ class PD_Model extends SPARQ_Model {
|
||||
|
||||
return $return_data;
|
||||
}
|
||||
|
||||
function getScoreCardEnabledStatusByPDID($pdid)
|
||||
{
|
||||
$this->db->SELECT('ENTITY.is_score_card_enabled');
|
||||
$this->db->FROM(ENTITY.' as ENTITY');
|
||||
$this->db->JOIN(PDTRIGGER.' as PDTRIGGER','ENTITY.entity_id = PDTRIGGER.fk_lender_id');
|
||||
$this->db->WHERE('PDTRIGGER.pd_id',$pdid);
|
||||
$res = $this->db->GET()->result_array();
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function getScoreableQuestionToDispaly()
|
||||
{
|
||||
@ -1878,5 +1915,21 @@ class PD_Model extends SPARQ_Model {
|
||||
//print_r($this->db->last_query());
|
||||
return $result;
|
||||
}
|
||||
|
||||
function getLenderHierarchyForPDListing($lender_user_id)
|
||||
{
|
||||
$this->db->select('USERPROFILE.userid, concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as user_name,USERPROFILE.fk_entity_id,USERPROFILE.fk_city,USERPROFILE.fk_state,USERPROFILEROLES.user_role,USERPROFILE.fk_entity_type_id,ROLES.role_name,if( POSITION("credit" IN ROLES.role_name),"CREDIT","SALES") as role_type,ENTITYREGION.fk_region_id,ENTITYLENDERBRANCH.entity_lender_branch_id');
|
||||
$this->db->from(USERPROFILE.' as USERPROFILE');
|
||||
$this->db->join(USERPROFILEROLES. ' as USERPROFILEROLES','USERPROFILEROLES.fk_userid = USERPROFILE.userid and USERPROFILEROLES.isactive = 1');
|
||||
$this->db->join(ROLES.' as ROLES','ROLES.role_id = USERPROFILEROLES.user_role');
|
||||
$this->db->join(ENTITYREGION.' as ENTITYREGION','USERPROFILE.fk_city = ENTITYREGION.fk_city_id');
|
||||
$this->db->join(ENTITYLENDERBRANCH.' as ENTITYLENDERBRANCH',"USERPROFILE.fk_entity_id = ENTITYLENDERBRANCH.fk_entity_id and ENTITYLENDERBRANCH.isactive = 1 and ENTITYLENDERBRANCH.fk_city_id = USERPROFILE.fk_city");
|
||||
$this->db->where('USERPROFILE.isactive',1);
|
||||
$this->db->where('USERPROFILE.userid',$lender_user_id);
|
||||
$result = $this->db->get()->result_array();
|
||||
//print_r($this->db->last_query());
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1 +1 @@
|
||||
var page = require('webpage').create();page.viewportSize = { width: 600, height: 350 };page.clipRect = { top: 0, left: 0, width: 600, height: 350 };var score = 81.7;var url = 'http://localhost/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/xampp/htdocs/AWSEC2/sparqapi/api/application//chart.png' ;page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});
|
||||
var page = require('webpage').create();page.viewportSize = { width: 600, height: 350 };page.clipRect = { top: 0, left: 0, width: 600, height: 350 };var score = 56.7;var url = 'http://localhost/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/xampp/htdocs/AWSEC2/sparqapi/api/application//chart.png' ;page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});
|
||||
@ -727,7 +727,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
echo '<p>'.$general_form['general_remark'].'</p>';
|
||||
}
|
||||
?>
|
||||
<div id="page_break"> </div>
|
||||
|
||||
<!-- ########################### End of Cover Page Section ####################################-->
|
||||
|
||||
|
||||
@ -737,156 +737,156 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
if( isset($pd_score) && count($pd_score))
|
||||
{
|
||||
|
||||
echo '<h2 contenteditable="true">PD Score Summary</h2>';
|
||||
|
||||
?>
|
||||
<table class="scorecard_table">
|
||||
<tr> <th> </th> <th>Actual Score</th> <th>Max Score</th> <th>Score %</th> </tr>
|
||||
<tr> <td>General Section Score</td> <td class="customtd"> <?php echo number_format($pd_score['score_summary']['general']['actual_score'],2,'.',',')?></td> <td class="customtd"><?php echo number_format($pd_score['score_summary']['general']['max_score'],2,'.',',')?></td> <td class="customtd"> <?php echo round($pd_score['score_summary']['general']['score_per'],1).'%'?></td></tr>
|
||||
|
||||
<tr> <td>Business Section Score</td> <td class="customtd"> <?php echo number_format($pd_score['score_summary']['business']['actual_score'],2,'.',',')?></td> <td class="customtd"><?php echo number_format($pd_score['score_summary']['business']['max_score'],2,'.',',')?></td> <td class="customtd"> <?php echo round($pd_score['score_summary']['business']['score_per'],1).'%'?></td></tr>
|
||||
|
||||
<tr> <td>Final Remarks Score</td> <td class="customtd"> <?php echo number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.',',')?></td> <td class="customtd"><?php echo number_format($pd_score['score_summary']['final_remarks']['max_score'],2,'.',',')?></td><td class="customtd"> <?php echo round($pd_score['score_summary']['final_remarks']['score_per'],1).'%'?></td></tr>
|
||||
|
||||
<tr> <td>Final PD Score</td> <td class="customtd"> <?php echo number_format($pd_score['score_summary']['overall_score']['overall_actual_score'],2,'.',',')?></td> <td class="customtd"><?php echo number_format($pd_score['score_summary']['overall_score']['overall_max_score'],2,'.',',')?></td> <td class="customtd"> <?php echo round($pd_score['score_summary']['overall_score']['final_score'],1).'%'?></td></tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
//####################### CHART #############################
|
||||
if(isset($base64_pdscore_chart_url))
|
||||
{
|
||||
echo "<br><br>";
|
||||
|
||||
echo '<p><img src="'.$base64_pdscore_chart_url.'" style="width:600px;height:350px;"/></p>';
|
||||
|
||||
}
|
||||
// else
|
||||
// { echo "<b>Score Chart Not Generated</b>"; }
|
||||
|
||||
|
||||
|
||||
//######################### CHART ###########################
|
||||
|
||||
|
||||
// if(isset($dsc_cards['base64_dsc_business']))
|
||||
// {
|
||||
// echo "<br><br>";
|
||||
|
||||
// echo '<p><img src="'.$dsc_cards['base64_dsc_business'].'" style="width:600px;height:350px;"/></p>';
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //echo "<b>Score Chart Not Generated</b>";
|
||||
// }
|
||||
|
||||
// if(isset($dsc_cards['base64_dsc_general']))
|
||||
// {
|
||||
// echo "<br><br>";
|
||||
|
||||
// echo '<p><img src="'.$dsc_cards['base64_dsc_general'].'" style="width:600px;height:350px;"/></p>';
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //echo "<b>Score Chart Not Generated</b>";
|
||||
// }
|
||||
|
||||
|
||||
echo "<div id='page_break'></div>";
|
||||
//######################### CHART ###########################
|
||||
}
|
||||
$business_captions = array("no_of_years_business_run" => "Business Vintage >>", "location_suited_for_busienss" => "Business Location suitability >>", "business_seasonality" => "Seasonality >>", "employees_total" => "Employee Strength >>", "cerificates" => "Business Certifications Sighted >>","owned_property" => "Business Premise Ownership >>", "owned_vechile" => "Vehicle Ownership >>", "business_activity_has_seen" => "Business Activity Observed >>", "minimum_supplier_info" => "Supplier Information Provided >>", "minimum_client_info" => "Client Information Provided >>","stock_raw_material_enough" => "Raw Materials Stock Sufficiency >>", "stock_finished_goods_enough" => "Finished/Traded Stock Sufficiency >>", "vintage_of_business_account" => "Main Business Banking Account Vintage >>");
|
||||
|
||||
$general_captions = array("otp_done" => "OTP authentication done >>","person_met_is_applicant" => "Is person Met, a loan applicant >>","qualification" => "Qualification of Loan Applicants >>","comment_locality" => "Comment on Locality >>","pd_location_approach" => "Approach to PD location >>","customer_behaviour" => "Customer Behaviour >>","neibourhood_check_as_per_pd_officer" => "Neighbourhood check >>","was_the_company_name_board_sighted" => "Business Board Sighted >>","value_of_other_assets" => "Asset Value by Loan Amount % >>");
|
||||
|
||||
|
||||
$address_type_remarks_caption = array('well_suited' => 'well suited','fairly_suited' => 'fairly suited','not_suited' => 'not suited');
|
||||
|
||||
|
||||
echo '<table class="mini_scorecard_table">';
|
||||
echo '<tr> <th style="width:70%;font-size:16px;" colspan="2">Business Related Parameters Impacting Score</th> <th style="width:30%;font-size:16px;">Response</th> </tr>';
|
||||
|
||||
echo '<tbody>';
|
||||
foreach($pd_score['business'] as $bsk => $business_score)
|
||||
{
|
||||
|
||||
$class = null;
|
||||
$answer = null;
|
||||
$per = $business_score['attributed_score'] > 0 && $business_score['max_score'] > 0 ? ( ($business_score['attributed_score'] / $business_score['max_score']) * 100) : 0;
|
||||
|
||||
$class = ( $per >= 80 ? 'rcorners_green' : ($per >= 65 && $per < 80 ? 'rcorners_light_green' : ($per >= 50 && $per < 65 ? 'rcorners_amber' : 'rcorners_red')));
|
||||
|
||||
// if($bsk == 'business_seasonality')
|
||||
// {
|
||||
// echo "BUSINESS";
|
||||
// echo $per;
|
||||
// echo $class;
|
||||
// echo $per >= 80 ? 'rcorners_green' : 'SOME';
|
||||
// die();
|
||||
// }
|
||||
if($bsk == 'location_suited_for_busienss')
|
||||
{
|
||||
$answer = $address_type_remarks_caption[ $business_score['answer'] ];
|
||||
}
|
||||
else if($bsk == 'cerificates')
|
||||
{
|
||||
$answer = $per > 0 ? 'Yes' : 'No';
|
||||
}
|
||||
else if($bsk == 'no_of_years_business_run')
|
||||
{
|
||||
$answer = isset($business_score['answer']) ? $business_score['answer'].' Yrs' : '';
|
||||
}
|
||||
else if($bsk == 'business_seasonality')
|
||||
{
|
||||
$answer = isset($business_score['answer']) ? ((!strcasecmp($business_score['answer'], 'yes')) ? 'Seasonal': 'Not Seasonal') : '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$answer = isset($business_score['answer']) ? $business_score['answer'] : '';
|
||||
}
|
||||
|
||||
if(strcasecmp($answer,'Not Applicable'))
|
||||
{
|
||||
echo '<tr> <td style="width:70%;">'. $business_captions[$bsk] .'</td> <td style="width:30%;">'. '<div id="'. $class .'"></div></td> <td class="customtd">'. ucfirst($answer).'</td> </tr>';
|
||||
}
|
||||
}
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '<br><br><br>';
|
||||
|
||||
echo '<table class="mini_scorecard_table">';
|
||||
echo '<tr> <th style="width:70%;font-size:16px;" colspan="2">Other Parameters Impacting Score</th><th style="width:30%;font-size:16px;">Response</th> </tr>';
|
||||
|
||||
echo '<tbody>';
|
||||
foreach($pd_score['general'] as $gsk => $general_score)
|
||||
{
|
||||
$class = null;
|
||||
$per = $general_score['attributed_score'] > 0 && $general_score['max_score'] > 0 ? ( ($general_score['attributed_score'] / $general_score['max_score']) * 100) : 0;
|
||||
|
||||
$class = ( $per >= 80 ? 'rcorners_green' : ($per >= 65 && $per < 80 ? 'rcorners_light_green' : ($per >= 50 && $per < 65 ? 'rcorners_amber' : 'rcorners_red')));
|
||||
|
||||
$answer = ucfirst($general_score['answer']);
|
||||
echo '<div id="page_break"> </div>';
|
||||
echo '<h2 contenteditable="true">PD Score Summary</h2>';
|
||||
|
||||
?>
|
||||
<table class="scorecard_table">
|
||||
<tr> <th> </th> <th>Actual Score</th> <th>Max Score</th> <th>Score %</th> </tr>
|
||||
<tr> <td>General Section Score</td> <td class="customtd"> <?php echo number_format($pd_score['score_summary']['general']['actual_score'],2,'.',',')?></td> <td class="customtd"><?php echo number_format($pd_score['score_summary']['general']['max_score'],2,'.',',')?></td> <td class="customtd"> <?php echo round($pd_score['score_summary']['general']['score_per'],1).'%'?></td></tr>
|
||||
|
||||
<tr> <td>Business Section Score</td> <td class="customtd"> <?php echo number_format($pd_score['score_summary']['business']['actual_score'],2,'.',',')?></td> <td class="customtd"><?php echo number_format($pd_score['score_summary']['business']['max_score'],2,'.',',')?></td> <td class="customtd"> <?php echo round($pd_score['score_summary']['business']['score_per'],1).'%'?></td></tr>
|
||||
|
||||
<tr> <td>Final Remarks Score</td> <td class="customtd"> <?php echo number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.',',')?></td> <td class="customtd"><?php echo number_format($pd_score['score_summary']['final_remarks']['max_score'],2,'.',',')?></td><td class="customtd"> <?php echo round($pd_score['score_summary']['final_remarks']['score_per'],1).'%'?></td></tr>
|
||||
|
||||
<tr> <td>Final PD Score</td> <td class="customtd"> <?php echo number_format($pd_score['score_summary']['overall_score']['overall_actual_score'],2,'.',',')?></td> <td class="customtd"><?php echo number_format($pd_score['score_summary']['overall_score']['overall_max_score'],2,'.',',')?></td> <td class="customtd"> <?php echo round($pd_score['score_summary']['overall_score']['final_score'],1).'%'?></td></tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
//####################### CHART #############################
|
||||
if(isset($base64_pdscore_chart_url))
|
||||
{
|
||||
echo "<br><br>";
|
||||
|
||||
echo '<p><img src="'.$base64_pdscore_chart_url.'" style="width:600px;height:350px;"/></p>';
|
||||
|
||||
}
|
||||
// else
|
||||
// { echo "<b>Score Chart Not Generated</b>"; }
|
||||
|
||||
|
||||
|
||||
//######################### CHART ###########################
|
||||
|
||||
|
||||
// if(isset($dsc_cards['base64_dsc_business']))
|
||||
// {
|
||||
// echo "<br><br>";
|
||||
|
||||
// echo '<p><img src="'.$dsc_cards['base64_dsc_business'].'" style="width:600px;height:350px;"/></p>';
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //echo "<b>Score Chart Not Generated</b>";
|
||||
// }
|
||||
|
||||
// if(isset($dsc_cards['base64_dsc_general']))
|
||||
// {
|
||||
// echo "<br><br>";
|
||||
|
||||
// echo '<p><img src="'.$dsc_cards['base64_dsc_general'].'" style="width:600px;height:350px;"/></p>';
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //echo "<b>Score Chart Not Generated</b>";
|
||||
// }
|
||||
|
||||
|
||||
echo "<div id='page_break'></div>";
|
||||
//######################### CHART ###########################
|
||||
|
||||
$business_captions = array("no_of_years_business_run" => "Business Vintage >>", "location_suited_for_busienss" => "Business Location suitability >>", "business_seasonality" => "Seasonality >>", "employees_total" => "Employee Strength >>", "cerificates" => "Business Certifications Sighted >>","owned_property" => "Business Premise Ownership >>", "owned_vechile" => "Vehicle Ownership >>", "business_activity_has_seen" => "Business Activity Observed >>", "minimum_supplier_info" => "Supplier Information Provided >>", "minimum_client_info" => "Client Information Provided >>","stock_raw_material_enough" => "Raw Materials Stock Sufficiency >>", "stock_finished_goods_enough" => "Finished/Traded Stock Sufficiency >>", "vintage_of_business_account" => "Main Business Banking Account Vintage >>");
|
||||
|
||||
$general_captions = array("otp_done" => "OTP authentication done >>","person_met_is_applicant" => "Is person Met, a loan applicant >>","qualification" => "Qualification of Loan Applicants >>","comment_locality" => "Comment on Locality >>","pd_location_approach" => "Approach to PD location >>","customer_behaviour" => "Customer Behaviour >>","neibourhood_check_as_per_pd_officer" => "Neighbourhood check >>","was_the_company_name_board_sighted" => "Business Board Sighted >>","value_of_other_assets" => "Asset Value by Loan Amount % >>");
|
||||
|
||||
|
||||
$address_type_remarks_caption = array('well_suited' => 'well suited','fairly_suited' => 'fairly suited','not_suited' => 'not suited');
|
||||
|
||||
|
||||
echo '<table class="mini_scorecard_table">';
|
||||
echo '<tr> <th style="width:70%;font-size:16px;" colspan="2">Business Related Parameters Impacting Score</th> <th style="width:30%;font-size:16px;">Response</th> </tr>';
|
||||
|
||||
echo '<tbody>';
|
||||
foreach($pd_score['business'] as $bsk => $business_score)
|
||||
{
|
||||
|
||||
$class = null;
|
||||
$answer = null;
|
||||
$per = $business_score['attributed_score'] > 0 && $business_score['max_score'] > 0 ? ( ($business_score['attributed_score'] / $business_score['max_score']) * 100) : 0;
|
||||
|
||||
$class = ( $per >= 80 ? 'rcorners_green' : ($per >= 65 && $per < 80 ? 'rcorners_light_green' : ($per >= 50 && $per < 65 ? 'rcorners_amber' : 'rcorners_red')));
|
||||
|
||||
// if($bsk == 'business_seasonality')
|
||||
// {
|
||||
// echo "BUSINESS";
|
||||
// echo $per;
|
||||
// echo $class;
|
||||
// echo $per >= 80 ? 'rcorners_green' : 'SOME';
|
||||
// die();
|
||||
// }
|
||||
if($bsk == 'location_suited_for_busienss')
|
||||
{
|
||||
$answer = $address_type_remarks_caption[ $business_score['answer'] ];
|
||||
}
|
||||
else if($bsk == 'cerificates')
|
||||
{
|
||||
$answer = $per > 0 ? 'Yes' : 'No';
|
||||
}
|
||||
else if($bsk == 'no_of_years_business_run')
|
||||
{
|
||||
$answer = isset($business_score['answer']) ? $business_score['answer'].' Yrs' : '';
|
||||
}
|
||||
else if($bsk == 'business_seasonality')
|
||||
{
|
||||
$answer = isset($business_score['answer']) ? ((!strcasecmp($business_score['answer'], 'yes')) ? 'Seasonal': 'Not Seasonal') : '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$answer = isset($business_score['answer']) ? $business_score['answer'] : '';
|
||||
}
|
||||
|
||||
if(strcasecmp($answer,'Not Applicable'))
|
||||
{
|
||||
echo '<tr> <td style="width:70%;">'. $business_captions[$bsk] .'</td> <td style="width:30%;">'. '<div id="'. $class .'"></div></td> <td class="customtd">'. ucfirst($answer).'</td> </tr>';
|
||||
}
|
||||
}
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '<br><br><br>';
|
||||
|
||||
echo '<table class="mini_scorecard_table">';
|
||||
echo '<tr> <th style="width:70%;font-size:16px;" colspan="2">Other Parameters Impacting Score</th><th style="width:30%;font-size:16px;">Response</th> </tr>';
|
||||
|
||||
echo '<tbody>';
|
||||
foreach($pd_score['general'] as $gsk => $general_score)
|
||||
{
|
||||
$class = null;
|
||||
$per = $general_score['attributed_score'] > 0 && $general_score['max_score'] > 0 ? ( ($general_score['attributed_score'] / $general_score['max_score']) * 100) : 0;
|
||||
|
||||
$class = ( $per >= 80 ? 'rcorners_green' : ($per >= 65 && $per < 80 ? 'rcorners_light_green' : ($per >= 50 && $per < 65 ? 'rcorners_amber' : 'rcorners_red')));
|
||||
|
||||
$answer = ucfirst($general_score['answer']);
|
||||
|
||||
if($gsk == 'value_of_other_assets')
|
||||
{
|
||||
//print_r($general_score);die();
|
||||
$answer = round((($answer/$loan_form['loan_amount']) * 100),2) .' %';
|
||||
if($gsk == 'value_of_other_assets')
|
||||
{
|
||||
//print_r($general_score);die();
|
||||
$answer = round((($answer/$loan_form['loan_amount']) * 100),2) .' %';
|
||||
|
||||
}
|
||||
|
||||
if(strcasecmp($answer,'Not Applicable'))
|
||||
{
|
||||
echo '<tr> <td style="width:70%;">'. $general_captions[$gsk] .'</td> <td style="width:30%;">'. '<div id="'. $class .'"></div></td> <td class="customtd">'. $answer.'</td> </tr>';
|
||||
}
|
||||
}
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(strcasecmp($answer,'Not Applicable'))
|
||||
{
|
||||
echo '<tr> <td style="width:70%;">'. $general_captions[$gsk] .'</td> <td style="width:30%;">'. '<div id="'. $class .'"></div></td> <td class="customtd">'. $answer.'</td> </tr>';
|
||||
}
|
||||
}
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
|
||||
|
||||
//
|
||||
|
||||
} //end of is score card enabled for this pd
|
||||
|
||||
?>
|
||||
<!-- ####################### Address Details Section Statred ############################-->
|
||||
@ -3747,7 +3747,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
<?php if(count($familyResult)>0){
|
||||
//print_r($familyResult);
|
||||
?>
|
||||
<div id='page_break'></div>
|
||||
<!-- <div id='page_break'></div> -->
|
||||
|
||||
<?php foreach($familyResult as $fmKey => $fmValue) { ?>
|
||||
<!-- <p><strong><?php //echo ($fmKey+1).'. '.$fmValue['selected_person']; ?></strong></p> -->
|
||||
@ -3855,7 +3855,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
//
|
||||
}
|
||||
else {?>
|
||||
<p><b>As per loan applicant he does not have any existing loan obligations.</b></p>
|
||||
<p>As per loan applicant he does not have any existing loan obligations.</p>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if($existing_loan_form_common_remarks != ""){ echo '<p>'.$existing_loan_form_common_remarks.'</p>';}
|
||||
@ -3941,13 +3941,14 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
// echo 'CREDIT ********************';
|
||||
// print_r($data['pd_processed_forms'][24]);
|
||||
//print_r($credit_officier_specific_queries);
|
||||
if(count($credit_officier_specific_queries))
|
||||
{
|
||||
|
||||
if(count($credit_officier_specific_queries['additional_requirements_processed']))
|
||||
// if(count($credit_officier_specific_queries))
|
||||
// {
|
||||
echo '<br>';
|
||||
echo '<h3>Credit Manager`s Specific Queries:</h3>';
|
||||
//echo '<br>';
|
||||
if(isset($credit_officier_specific_queries['additional_requirements_processed']) && count($credit_officier_specific_queries['additional_requirements_processed']))
|
||||
{
|
||||
echo '<h3>A . Credit Manager`s Specific Queries:</h3>';
|
||||
echo '<br>';
|
||||
|
||||
|
||||
foreach ($credit_officier_specific_queries['additional_requirements_processed'] as $key => $value)
|
||||
{
|
||||
@ -3956,11 +3957,17 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
echo '<br><br>';
|
||||
}
|
||||
}
|
||||
|
||||
if(count($credit_officier_specific_queries['docs_to_be_sighted_processed']))
|
||||
else
|
||||
{
|
||||
echo '<h3>B . Documents to be collected: </h3>';
|
||||
echo '<br>';
|
||||
echo 'There are no specific queries raised by Credit Manager.';
|
||||
}
|
||||
|
||||
echo '<br>';
|
||||
echo '<h3>Documents to be collected: </h3>';
|
||||
//
|
||||
if(isset($credit_officier_specific_queries['docs_to_be_sighted_processed']) && count($credit_officier_specific_queries['docs_to_be_sighted_processed']))
|
||||
{
|
||||
|
||||
|
||||
foreach ($credit_officier_specific_queries['docs_to_be_sighted_processed'] as $doc_key => $doc_value)
|
||||
{
|
||||
@ -3972,9 +3979,13 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
}
|
||||
echo '<br><br>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'There are no specific documents to be collect.';
|
||||
}
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
?>
|
||||
|
||||
@ -3982,7 +3993,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
<!-- #################Final Remarks Section#################-->
|
||||
<div class="page_break"></div>
|
||||
<h3 contenteditable="true">PD OFFICER`S REMARKS ON CUSTOMER BEHAVIOUR, BUSINESS LOCATION & OVERALL PD STATUS</h3>
|
||||
<br><h3 contenteditable="true">PD OFFICER`S REMARKS ON CUSTOMER BEHAVIOUR, BUSINESS LOCATION & OVERALL PD STATUS</h3>
|
||||
<?php
|
||||
//print_r($final_remark_data);
|
||||
$polite = null;$rude = null; $other_behaviour = null;$other_behaviour_remarks = null;
|
||||
|
||||
@ -65,14 +65,18 @@
|
||||
}
|
||||
else if(isset($_SERVER['HTTP_HOST']) && !strcasecmp($_SERVER['HTTP_HOST'],'pdgenie.com') && isset($_SERVER['REQUEST_URI']) && substr_count($_SERVER['REQUEST_URI'], 'sparqprod') == 1)
|
||||
{
|
||||
define('ENVIRONMENT','sparqprod');
|
||||
define('ENVIRONMENT','production');
|
||||
}
|
||||
else if(isset($_SERVER['HTTP_HOST']) && !strcasecmp($_SERVER['HTTP_HOST'],'localhost') && isset($_SERVER['REQUEST_URI']) && substr_count($_SERVER['REQUEST_URI'], 'sparqapi') == 1)
|
||||
{
|
||||
define('ENVIRONMENT','testing');
|
||||
}
|
||||
else
|
||||
{
|
||||
define('ENVIRONMENT','development');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------
|
||||
* ERROR REPORTING
|
||||
|
||||
Loading…
Reference in New Issue
Block a user