QUES MAS CHANGED

This commit is contained in:
velz 2018-09-27 17:20:30 +05:30
parent d5fc15dd4a
commit aa19fe1967
6 changed files with 27 additions and 48 deletions

View File

@ -245,8 +245,8 @@ defined('PDSTATUSID') OR define('PDSTATUSID','pd_status_id');
defined('PDTEAM') OR define('PDTEAM','m_pdteam'); defined('PDTEAM') OR define('PDTEAM','m_pdteam');
defined('PDTEAMID') OR define('PDTEAMID','pdteam_id'); defined('PDTEAMID') OR define('PDTEAMID','pdteam_id');
defined('PDTEAMCITYMAP') OR define('PDTEAMCITYMAP','m_pdteam_city_mapping'); defined('PDTEAMMAP') OR define('PDTEAMMAP','m_pdteam_map');
defined('PDTEAMCITYMAPID') OR define('PDTEAMCITYMAPID','pdteam_city_mapping_id'); defined('PDTEAMMAPID') OR define('PDTEAMMAPID','pdteam_map_id');
defined('PDOFFICIERSDETAILS') OR define('PDOFFICIERSDETAILS','m_pd_officiers_details'); defined('PDOFFICIERSDETAILS') OR define('PDOFFICIERSDETAILS','m_pd_officiers_details');
defined('PDOFFICIERSDETAILSID') OR define('PDOFFICIERSDETAILSID','pd_officier_id'); defined('PDOFFICIERSDETAILSID') OR define('PDOFFICIERSDETAILSID','pd_officier_id');

View File

@ -203,8 +203,8 @@ class PD_Controller extends REST_Controller {
/***********************PD ALLOCATION TYPE PROCESS **********/ /***********************PD ALLOCATION TYPE PROCESS **********/
$where_condition_array = array('fk_city_id' => $pd_details['fk_city']); $where_condition_array = array('fk_city_id' => $pd_details['fk_city'],'fk_lender_id' => $pd_details['fk_lender_id']);
$temp_city_id = $this->PD_Model->selectRecords(PDTEAMCITYMAP,$where_condition_array,$limit=0,$offset=0); $temp_city_id = $this->PD_Model->selectRecords(PDTEAMMAP,$where_condition_array,$limit=0,$offset=0);
if(count($temp_city_id)) if(count($temp_city_id))
{ {
if($temp_city_id[0]['type'] == 0) // Allocate to Vendor if($temp_city_id[0]['type'] == 0) // Allocate to Vendor
@ -218,30 +218,6 @@ class PD_Controller extends REST_Controller {
if($local_pd_allocation_type == 1)// AUTO - Load Balance Allocation if($local_pd_allocation_type == 1)// AUTO - Load Balance Allocation
{ {
//1.select list pd officers from lender_pd offices map table and choose minimun allocated one
$fields = array('fk_user_id');
$where_condition_array = array('fk_lender_id'=>$pd_details['fk_lender_id'],'isactive' => 1);
$lender_specific_pdofficers_list = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDOFFICIERSDETAILS);
if(count($lender_specific_pdofficers_list))
{
//select currently allocated PD values from PDOFFICIERSDETAILS table to find min value
$lender_specific_pdofficer_list_and_allocated_values = $this->PD_Model->getLenderSpecificPDOfficersListAndAllocatedValues($lender_specific_pdofficers_list);
if(count($lender_specific_pdofficer_list_and_allocated_values))
{
$allocated_values = array_column($lender_specific_pdofficer_list_and_allocated_values,'allocated');
$min_allocated = min($allocated_values);
$key = array_search($min_allocated,$allocated_values);
$final_pd_officer_to_allocate = $lender_specific_pdofficer_list_and_allocated_values[$key]['fk_user_id'];
$pd_details['fk_pd_allocated_to'] = $final_pd_officer_to_allocate;
$pd_details['fk_pd_status'] = ALLOCATED;
}
}
else
{
//select list of pd officers based on pd type, product, customer segment, and team from table (t_pd_officiers_details) and choose minimun allocated one and assign pd Officer and change status form TRIGGERED to ALLOCATED //select list of pd officers based on pd type, product, customer segment, and team from table (t_pd_officiers_details) and choose minimun allocated one and assign pd Officer and change status form TRIGGERED to ALLOCATED
$fields = array('fk_user_id,allocated'); $fields = array('fk_user_id,allocated');
@ -261,7 +237,7 @@ class PD_Controller extends REST_Controller {
$pd_details['fk_pd_allocated_to'] = $final_pd_officer_to_allocate; $pd_details['fk_pd_allocated_to'] = $final_pd_officer_to_allocate;
$pd_details['fk_pd_status'] = ALLOCATED; $pd_details['fk_pd_status'] = ALLOCATED;
}
} }
else if($local_pd_allocation_type == 2) // AUTO - NEAREST Allocation else if($local_pd_allocation_type == 2) // AUTO - NEAREST Allocation

View File

@ -106,7 +106,7 @@ class Question_Management_Controller extends REST_Controller {
if(array_key_exists('answers',$records)) if(array_key_exists('answers',$records))
{ {
$answers = $records['answers']; $answers = $records['answers'];
unset($records['ansewrs']); unset($records['answers']);
} }
$where_condtion_array = array('question_id'=>$records['question_id']); $where_condtion_array = array('question_id'=>$records['question_id']);

View File

@ -19,6 +19,7 @@ class User_Management_Controller extends REST_Controller {
parent::__construct(); parent::__construct();
$this->load->model('User_Management_Model'); $this->load->model('User_Management_Model');
$this->load->library('AWS_S3'); $this->load->library('AWS_S3');
$this->load->library('AWS_SES');
} }
public function listAllUsers_get() public function listAllUsers_get()
@ -44,7 +45,7 @@ class User_Management_Controller extends REST_Controller {
public function saveNewUser_post() public function saveNewUser_post()
{ {
//print_r(json_decode($this->post('pdofficer'),true));die;
$roles = ""; $roles = "";
$lender_hierarchy = ""; $lender_hierarchy = "";
$pdofficer = ""; $pdofficer = "";
@ -55,11 +56,7 @@ class User_Management_Controller extends REST_Controller {
$records = json_decode($this->post('records'),true); $records = json_decode($this->post('records'),true);
//print_r($records);die;
//$roles = json_decode($this->post('roles'),true);
//print_r(json_decode($this->post('lender_hierarchy'),true));die;
//$lender_hierarchy = json_decode($this->post('lender_hierarchy'),true);
//echo $_FILES['profilepic']['name'];die;
if(!empty($_FILES['profilepic']['tmp_name'])) if(!empty($_FILES['profilepic']['tmp_name']))
{ {
@ -118,14 +115,14 @@ class User_Management_Controller extends REST_Controller {
$this->User_Management_Model->saveRecords($role_array,USERPROFILEROLES); $this->User_Management_Model->saveRecords($role_array,USERPROFILEROLES);
} }
} }
//$user_id = 52;
if($lender_hierarchy != "") if($lender_hierarchy != "")
{ {
//print_r($lender_hierarchy);die;
foreach($lender_hierarchy as $hierarchy) foreach($lender_hierarchy as $hierarchy)
{ //echo $hierarchy['lender_hierarchy_id'];die; {
$hierarchy = array('fk_hierarchy_id'=>$hierarchy['lender_hierarchy_id'],'fk_user_id'=>$user_id);//insert hierarchy againest lender type users $hierarchy = array('fk_hierarchy_id'=>$hierarchy['lender_hierarchy_id'],'fk_user_id'=>$user_id);
$this->User_Management_Model->saveRecords($hierarchy,USERPROFILEHIERARCHY); $this->User_Management_Model->saveRecords($hierarchy,USERPROFILEHIERARCHY);
} }
} }
@ -137,6 +134,10 @@ class User_Management_Controller extends REST_Controller {
} }
if($user_id != '' || $user_id != null) if($user_id != '' || $user_id != null)
{ {
// send a verification mail for registered user to get PD alert informations
// They have to clik a verification link from sent mail
$this->aws_ses->verifyEmailIdentity($records['email']);
$data['dataStatus'] = true; $data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK; $data['status'] = REST_Controller::HTTP_OK;
$data['record'] = $user_id; $data['record'] = $user_id;

View File

@ -113,8 +113,9 @@ class PDALERTS
/* /*
* * **********************************************************************************************************
* EMAIL FUNCTIONALITY * EMAIL FUNCTIONALITY
************************************************************************************************************
*/ */
@ -173,10 +174,11 @@ class PDALERTS
} }
//$msg = "PD for Lender Applicant ID:".$core_details['lender_applicant_id']."has been".$core_details['pd_status_name']; // status base configurable //$msg = "PD for Lender Applicant ID:".$core_details['lender_applicant_id']."has been".$core_details['pd_status_name']; // status base configurable
foreach($mobile_nos_to_send_notification as $no) foreach($email_ids_to_send_notification as $email)
{ {
//email SES //email SES have to config
//$CI->aws_ses->sendMail($email);
} }

View File

@ -25,20 +25,20 @@ class AWS_SES
} }
public function sendMail() public function sendMail($email)
{ {
$sender_email = 'velmurugan.s@venbainfotech.com'; $sender_email = 'velmurugan.s@venbainfotech.com';
// Replace these sample addresses with the addresses of your recipients. If // Replace these sample addresses with the addresses of your recipients. If
// your account is still in the sandbox, these addresses must be verified. // your account is still in the sandbox, these addresses must be verified.
$recipient_emails = ['raro@spindl-e.com']; $recipient_emails = [$email];
// Specify a configuration set. If you do not want to use a configuration // Specify a configuration set. If you do not want to use a configuration
// set, comment the following variable, and the // set, comment the following variable, and the
// 'ConfigurationSetName' => $configuration_set argument below. // 'ConfigurationSetName' => $configuration_set argument below.
//$configuration_set = 'ConfigSet'; //$configuration_set = 'ConfigSet';
$subject = 'SineEdge Test'; $subject = 'SineEdge PD Test';
$plaintext_body = 'This email was sent with Amazon SES using the AWS SDK for PHP.' ; $plaintext_body = 'This email was sent with Amazon SES using the AWS SDK for PHP.' ;
$html_body = '<h1>AWS Amazon Simple Email Service Test Email</h1>'. $html_body = '<h1>AWS Amazon Simple Email Service Test Email</h1>'.
'<p>This email was sent with <a href="https://aws.amazon.com/ses/">'. '<p>This email was sent with <a href="https://aws.amazon.com/ses/">'.
@ -89,7 +89,7 @@ class AWS_SES
'EmailAddress' => $email, 'EmailAddress' => $email,
]); ]);
print_r($result); //print_r($result);
} }
public function sendCustomVerificationEmail($email,$template_name = 'myCustom') public function sendCustomVerificationEmail($email,$template_name = 'myCustom')
@ -113,7 +113,7 @@ class AWS_SES
'TemplateSubject' => 'customTemlate', // REQUIRED 'TemplateSubject' => 'customTemlate', // REQUIRED
]); ]);
print_r($result); //print_r($result);
} }