5th Fixes : ps
This commit is contained in:
parent
29efb88454
commit
4e6d427bd0
@ -22,12 +22,21 @@ class Flyhi_Controller extends REST_Controller {
|
||||
$this->load->library('phpmailer_library');
|
||||
}
|
||||
|
||||
public function getUserAndItsLender(){
|
||||
$headersData = getallheaders();
|
||||
$td = jwt::decode($headersData['Token']);
|
||||
$current_user_id = $td->locale;
|
||||
$default_lender = $this->Flyhi_Model->getEntityFromUserdetails($current_user_id);
|
||||
return $default_lender;
|
||||
}
|
||||
|
||||
## filterFlyPDList
|
||||
public function filterFlyPDList_post() {
|
||||
$records = $this->post('records');
|
||||
$pd_status= $records['pd_status'];
|
||||
$pd_from_date = $records['pd_from_date'];
|
||||
$pd_to_date = $records['pd_to_date'];
|
||||
$pd_lender = (ENVIRONMENT == 'production' ? 19 : 49);
|
||||
$pd_lender = $this->getUserAndItsLender();
|
||||
$pd_products = isset($records['pd_products']) ? $records['pd_products'] : (ENVIRONMENT == 'production' ? 27 : 26) ;
|
||||
$pd_applicant_name = strtolower($records['pd_applicant_name']);
|
||||
$sales_pd_officer_id = isset($records['sales_pd_officer_id']) ? $records['sales_pd_officer_id'] : null ;
|
||||
@ -49,13 +58,13 @@ class Flyhi_Controller extends REST_Controller {
|
||||
}
|
||||
|
||||
public function getMasterForFlyhiPD_get(){
|
||||
$FHFSL_lender = (ENVIRONMENT == 'production' ? 19 : 49);
|
||||
|
||||
$FHFSL_product = (ENVIRONMENT == 'production' ? 27 : 26);
|
||||
$default_product = $FHFSL_product;
|
||||
$default_lender = $FHFSL_lender;
|
||||
$pd_lender = $this->getUserAndItsLender();
|
||||
|
||||
$lender_fields = array('entity_id','full_name','short_name');
|
||||
$lender_where_condition_array = array('isactive' => 1,'entity_id' => $FHFSL_lender);
|
||||
$lender_where_condition_array = array('isactive' => 1,'entity_id' => $pd_lender);
|
||||
$result_data = $this->Flyhi_Model->selectCustomRecords($lender_fields,$lender_where_condition_array,ENTITY,array(),'','full_name');
|
||||
if(count($result_data))
|
||||
{
|
||||
@ -86,21 +95,20 @@ class Flyhi_Controller extends REST_Controller {
|
||||
'jointype' => 'INNER'));
|
||||
$order_by = 'USERPROFILE.userid';
|
||||
$or_where = array();
|
||||
$lender_contact_persons = $this->Flyhi_Model->getJoinRecords($columns,$table,$joins,array('USERPROFILE.fk_entity_id' => $FHFSL_lender),$order_by,'DESC','',$or_where);
|
||||
$lender_contact_persons = $this->Flyhi_Model->getJoinRecords($columns,$table,$joins,array('USERPROFILE.fk_entity_id' => $pd_lender),$order_by,'DESC','',$or_where);
|
||||
$lender_contact_persons = count($lender_contact_persons)>0 ? $lender_contact_persons : 'Credit Person Lender Profile was not found?. Create Credit Person Lender profile';
|
||||
// isset($records['pd_branch_id']) ? $records['pd_branch_id'] : null
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = array('lender'=> $result_data,'products' =>$product,'lender_contact_persons'=>$lender_contact_persons,'default_lender' =>$FHFSL_lender,'default_product' =>$FHFSL_product);
|
||||
$data['records'] = array('lender'=> $result_data,'products' =>$product,'lender_contact_persons'=>$lender_contact_persons,'default_lender' =>$pd_lender,'default_product' =>$FHFSL_product);
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
|
||||
public function lenderMasterForFlyhiPD_get(){
|
||||
$FHFSL_lender = (ENVIRONMENT == 'production' ? 19 : 49);
|
||||
$default_lender = $FHFSL_lender;
|
||||
|
||||
$pd_lender = $this->getUserAndItsLender();
|
||||
|
||||
$lender_fields = array('entity_id','full_name','short_name');
|
||||
$lender_where_condition_array = array('isactive' => 1,'entity_id' => $FHFSL_lender);
|
||||
$lender_where_condition_array = array('isactive' => 1,'entity_id' => $pd_lender);
|
||||
$result_data = $this->Flyhi_Model->selectCustomRecords($lender_fields,$lender_where_condition_array,ENTITY,array(),'','full_name');
|
||||
$result_data = count($result_data)>0 ? $result_data : 'Lender was not found';
|
||||
|
||||
@ -125,10 +133,10 @@ class Flyhi_Controller extends REST_Controller {
|
||||
}
|
||||
|
||||
public function branchMasterForFlyhiPD_get(){
|
||||
$FHFSL_lender = (ENVIRONMENT == 'production' ? 19 : 49);
|
||||
$pd_lender = $this->getUserAndItsLender();
|
||||
$branches = array();
|
||||
$lender_fields = array('entity_id','full_name','short_name');
|
||||
$lender_where_condition_array = array('isactive' => 1,'entity_id' => $FHFSL_lender);
|
||||
$lender_where_condition_array = array('isactive' => 1,'entity_id' => $pd_lender);
|
||||
$result_data = $this->Flyhi_Model->selectCustomRecords($lender_fields,$lender_where_condition_array,ENTITY,array(),'','full_name');
|
||||
if(count($result_data))
|
||||
{
|
||||
@ -150,7 +158,7 @@ class Flyhi_Controller extends REST_Controller {
|
||||
}
|
||||
|
||||
public function lenderCreditPersonForFlyhiPD_get(){
|
||||
$FHFSL_lender = (ENVIRONMENT == 'production' ? 19 : 49);
|
||||
$pd_lender = $this->getUserAndItsLender();
|
||||
$FHFSL_product = (ENVIRONMENT == 'production' ? 27 : 26);
|
||||
|
||||
$columns = array('USERPROFILE.userid','concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as user_name','USERPROFILE.fk_entity_id','USERPROFILE.fk_city','USERPROFILEROLES.user_role','USERPROFILE.fk_entity_type_id','ROLES.role_name','if( POSITION("credit" IN ROLES.role_name),"CREDIT","SALES") as role_type');
|
||||
@ -162,7 +170,7 @@ class Flyhi_Controller extends REST_Controller {
|
||||
'condition' =>'ROLES.role_id = USERPROFILEROLES.user_role',
|
||||
'jointype' => 'INNER'));
|
||||
$order_by = 'USERPROFILE.userid';
|
||||
$where_condition_array['USERPROFILE.fk_entity_id'] = $FHFSL_lender;
|
||||
$where_condition_array['USERPROFILE.fk_entity_id'] = $pd_lender;
|
||||
$key_date="ROLES.role_name LIKE '%credit%'";
|
||||
$condition_value=null;
|
||||
$where_condition_array[$key_date] = $condition_value;
|
||||
@ -177,7 +185,7 @@ class Flyhi_Controller extends REST_Controller {
|
||||
}
|
||||
|
||||
public function lenderSalesPersonForFlyhiPD_get(){
|
||||
$FHFSL_lender = (ENVIRONMENT == 'production' ? 19 : 49);
|
||||
$pd_lender = $this->getUserAndItsLender();
|
||||
$FHFSL_product = (ENVIRONMENT == 'production' ? 27 : 26);
|
||||
|
||||
$columns = array('USERPROFILE.userid','concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as user_name','USERPROFILE.fk_entity_id','USERPROFILE.fk_city','USERPROFILEROLES.user_role','USERPROFILE.fk_entity_type_id','ROLES.role_name','if( POSITION("credit" IN ROLES.role_name),"CREDIT","SALES") as role_type');
|
||||
@ -190,7 +198,7 @@ class Flyhi_Controller extends REST_Controller {
|
||||
'jointype' => 'INNER'));
|
||||
$order_by = 'USERPROFILE.userid';
|
||||
$or_where = array();
|
||||
$where_condition_array['USERPROFILE.fk_entity_id'] = $FHFSL_lender;
|
||||
$where_condition_array['USERPROFILE.fk_entity_id'] = $pd_lender;
|
||||
$key_date="ROLES.role_name LIKE '%sale%'";
|
||||
$condition_value=null;
|
||||
$where_condition_array[$key_date] = $condition_value;
|
||||
@ -206,7 +214,7 @@ class Flyhi_Controller extends REST_Controller {
|
||||
|
||||
public function listFlyhiPD_get(){
|
||||
|
||||
$user_id = $this->uri->segment(1);
|
||||
$user_id = $this->uri->segment(2);
|
||||
$columns = array('SALES_PD_DATA.sales_pd_id','SALES_PD_DATA.sales_pd_sno','SALES_PD_DATA.applicant_name','concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name','SALES_PD_DATA.applicant_id','SALES_PD_DATA.lender_id','SALES_PD_DATA.is_pdf','SALES_PD_DATA.is_edited','ENTITY.full_name','ENTITY.short_name','SALES_PD_DATA.status','SALES_PD_DATA.sales_pd_type','SALES_PD_DATA.rand_string','SALES_PD_DATA.isactive','SALES_PD_DATA.city_id','CITY.name as city_name',
|
||||
'SALES_PD_DATA.lender_sales_person','concat(LENDERSALESPERSON.first_name," ",LENDERSALESPERSON.last_name) as lender_sales_person_name','LENDERSALESPERSON.mobile_no as lender_sales_contact_mobileno','LENDERSALESPERSON.email as lender_sales_person_email',
|
||||
'SALES_PD_DATA.lender_credit_person','concat(LENDERCREDITPERSON.first_name," ",LENDERCREDITPERSON.last_name) as lender_credit_person_name','LENDERCREDITPERSON.mobile_no as lender_credit_person_contact_mobileno','LENDERCREDITPERSON.email as lender_credit_person_email',
|
||||
@ -248,11 +256,15 @@ class Flyhi_Controller extends REST_Controller {
|
||||
$where_condition_array[$key_date] = $condition_value;
|
||||
// ----END OF FILTERING THE LAST 10 DAYS RECORDS---
|
||||
|
||||
$FHFSL_lender = (ENVIRONMENT == 'production' ? 19 : 49);
|
||||
$pd_lender = $this->getUserAndItsLender();
|
||||
$FHFSL_lender = (ENVIRONMENT == 'production' ? 19 : 31);
|
||||
|
||||
if($user_id && is_numeric($user_id))
|
||||
{ $where_condition_array['SALES_PD_DATA.createdby'] = $user_id; }
|
||||
|
||||
$where_condition_array['SALES_PD_DATA.sales_pd_type not in (1,2,3,4)'] = null; // comment this
|
||||
|
||||
if($pd_lender == $FHFSL_lender) $where_condition_array['SALES_PD_DATA.sales_pd_type in (3,4)'] = null;
|
||||
else $where_condition_array['SALES_PD_DATA.sales_pd_type in (5)'] = null;
|
||||
$order_by = 'SALES_PD_DATA.sales_pd_id';
|
||||
|
||||
$Flyhi_pd_data = $this->Flyhi_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC','',$or_where);
|
||||
@ -411,7 +423,7 @@ class Flyhi_Controller extends REST_Controller {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getFlyhiPDReport_get()
|
||||
{
|
||||
$pd_id = $this->uri->segment(2);
|
||||
@ -507,7 +519,6 @@ class Flyhi_Controller extends REST_Controller {
|
||||
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name, $bucket_key,'30 minutes');
|
||||
$view_data['satellite_image'] = $singed_uri;
|
||||
// $view_data['satellite_image'] = $this->Flyhi_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $pd_id,'img_name' => 'satellite','isactive' => 1),SALEPD_DOCS);
|
||||
// die();
|
||||
//$view_name = $flyhipd_data[0]['short_name'].'_'.$flyhipd_data[0]['abbr'];
|
||||
$view_name = $flyhipd_data[0]['short_name'];
|
||||
$html_content = $this->load->view('sale_pd_templates/'.$view_name,$view_data,true);
|
||||
@ -1098,8 +1109,8 @@ class Flyhi_Controller extends REST_Controller {
|
||||
{
|
||||
$records = $this->post('records');
|
||||
$FHFSL_product = (ENVIRONMENT == 'production' ? 27 : 26);
|
||||
$FHFSL_lender = (ENVIRONMENT == 'production' ? 19 : 49);
|
||||
$lender = isset($records['lender_id']) ? $records['lender_id'] : $FHFSL_lender;
|
||||
$pd_lender = $this->getUserAndItsLender();
|
||||
$lender = isset($records['lender_id']) ? $records['lender_id'] : $pd_lender;
|
||||
$product = isset($records['product_id']) ? $records['product_id'] : $FHFSL_product;
|
||||
$records['lender_id'] = $lender;
|
||||
$records['product_id'] = $product;
|
||||
|
||||
@ -220,7 +220,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo isset($section1['are_you_willing_to_provide_collateral_or_a_cosigner_for_the_loan']) && !empty($section1['are_you_willing_to_provide_collateral_or_a_cosigner_for_the_loan'])?$section1['are_you_willing_to_provide_collateral_or_a_cosigner_for_the_loan']:'Not Provided'; ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"> 6. Have you ever been convicted of any financial crimes or fraud?"</td>
|
||||
<td colspan="3"> 6. Have you ever been convicted of any financial crimes or fraud?</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo isset($section1['have_you_ever_been_convicted_of_any_financial_crimes_or_fraud']) && !empty($section1['have_you_ever_been_convicted_of_any_financial_crimes_or_fraud']) ?$section1['have_you_ever_been_convicted_of_any_financial_crimes_or_fraud']:'Not Provided'; ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -232,7 +232,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo isset($section1['do_you_have_any_outstanding_legal_judgments_or_liens_against_you?']) && !empty($section1['do_you_have_any_outstanding_legal_judgments_or_liens_against_you?']) ?$section1['do_you_have_any_outstanding_legal_judgments_or_liens_against_you?']:'Not Provided'; ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"> 9. Are you familiar with the terms and conditions of the loan, including interest rates and repayment terms?"</td>
|
||||
<td colspan="3"> 9. Are you familiar with the terms and conditions of the loan, including interest rates and repayment terms?</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo isset($section1['are_you_familiar_with_the_terms_and_conditions_of_the_loan_including_interest_rates_and_repayment_terms']) && !empty($section1['are_you_familiar_with_the_terms_and_conditions_of_the_loan_including_interest_rates_and_repayment_terms']) ? $section1['are_you_familiar_with_the_terms_and_conditions_of_the_loan_including_interest_rates_and_repayment_terms'] :'Not Provided'; ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
Loading…
Reference in New Issue
Block a user