Merge branch 'dev' of bitbucket.org:jubilian/nhance-enrollment into dev
This commit is contained in:
commit
fbb5abe2eb
@ -761,32 +761,41 @@ class EmployeeController extends AdminController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function empby_client_clientbranch($client_id, $branch_id)
|
public function empby_client_clientbranch($client_id, $branch_id, $client_policy_id)
|
||||||
{
|
{
|
||||||
|
|
||||||
$results = $this->clientModel->select('employees.id as employee_id, employees.name as employee_name,
|
$results = $this->clientModel->select('
|
||||||
employees.relationship, employees.emp_code,
|
employees.id as employee_id,
|
||||||
employees.emp_status, auth_history.user_type')
|
employees.name as employee_name,
|
||||||
->join('employees', $client_id .'= employees.client_id AND ' . $branch_id . '= employees.client_branch_id', 'left')
|
employees.relationship,
|
||||||
->join('auth_history', 'employees.id = auth_history.user_id AND "employee" = auth_history.user_type', 'left')
|
employees.emp_code,
|
||||||
->where('employees.is_active', 1)
|
employees.emp_status,
|
||||||
->where('employees.emp_status !=', 'truncated')
|
auth_history.user_type
|
||||||
->groupBy('employees.id')
|
')
|
||||||
->findAll();
|
->join('employees', $client_id . '= employees.client_id AND ' . $branch_id . '= employees.client_branch_id', 'left')
|
||||||
|
->join('employee_polices', 'employees.id = employee_polices.employee_id')
|
||||||
|
->join('auth_history', 'employees.id = auth_history.user_id AND "employee" = auth_history.user_type', 'left')
|
||||||
|
->where('employees.is_active', 1)
|
||||||
|
->where('employees.emp_status !=', 'truncated')
|
||||||
|
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||||
|
->where('employee_polices.is_active', 1)
|
||||||
|
->where('employee_polices.status !=', 'truncated')
|
||||||
|
->groupBy('employees.id')
|
||||||
|
->findAll();
|
||||||
|
|
||||||
$groupedData = [];
|
$groupedData = [];
|
||||||
$employeeId = '';
|
$employeeId = '';
|
||||||
|
|
||||||
foreach ($results as $row) {
|
foreach ($results as $row) {
|
||||||
|
|
||||||
if($employeeId != $row['employee_id']){
|
if ($employeeId != $row['employee_id']) {
|
||||||
$employeeId = $row['employee_id'];
|
$employeeId = $row['employee_id'];
|
||||||
}else{
|
} else {
|
||||||
$employeeId = null;
|
$employeeId = null;
|
||||||
}
|
}
|
||||||
$employeeName = $row['employee_name'] ;
|
$employeeName = $row['employee_name'];
|
||||||
$employeeRelationship = $row['relationship'] ;
|
$employeeRelationship = $row['relationship'];
|
||||||
$employeeEmpCode = $row['emp_code'] ;
|
$employeeEmpCode = $row['emp_code'];
|
||||||
$employeeEmpStatus = $row['emp_status'];
|
$employeeEmpStatus = $row['emp_status'];
|
||||||
$employeeUserType = $row['user_type'];
|
$employeeUserType = $row['user_type'];
|
||||||
|
|
||||||
@ -802,14 +811,14 @@ class EmployeeController extends AdminController
|
|||||||
'emp_status' => $employeeEmpStatus,
|
'emp_status' => $employeeEmpStatus,
|
||||||
'user_type' => $employeeUserType
|
'user_type' => $employeeUserType
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
$employeeId = $row['employee_id'];
|
$employeeId = $row['employee_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// print_r($groupedData); die;
|
||||||
|
|
||||||
return json_encode($groupedData);
|
return json_encode($groupedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -314,17 +314,18 @@
|
|||||||
|
|
||||||
var client_id = $('#clients').val();
|
var client_id = $('#clients').val();
|
||||||
var branch_id = $('#branch_id').val();
|
var branch_id = $('#branch_id').val();
|
||||||
if (client_id == '0' || branch_id == '0') {
|
var client_policy_id = $('#client_policy_id').val();
|
||||||
|
if (client_id == '0' || branch_id == '0' || client_policy_id == '0') {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: "warning!",
|
title: "warning!",
|
||||||
text: 'Please select the Client and Client Branch.',
|
text: 'Please select the Client, Client Branch and Client Policy.',
|
||||||
icon: "warning"
|
icon: "warning"
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?php echo base_url(); ?>' + '/employee/empby_client_clientbranch/' + client_id + '/' + branch_id,
|
url: '<?php echo base_url(); ?>' + '/employee/empby_client_clientbranch/' + client_id + '/' + branch_id + '/' + client_policy_id,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
@ -359,7 +360,7 @@
|
|||||||
var loggedIn_count = 0;
|
var loggedIn_count = 0;
|
||||||
data.forEach(function(employee, index) {
|
data.forEach(function(employee, index) {
|
||||||
|
|
||||||
if(employee.emp_status !== 'draft'){
|
if(employee.emp_status === 'enrolled'){
|
||||||
var enrolled = 'Yes';
|
var enrolled = 'Yes';
|
||||||
enrolled_count++;
|
enrolled_count++;
|
||||||
}else{
|
}else{
|
||||||
@ -370,7 +371,12 @@
|
|||||||
var loggedIn = 'Yes';
|
var loggedIn = 'Yes';
|
||||||
loggedIn_count++;
|
loggedIn_count++;
|
||||||
}else{
|
}else{
|
||||||
var loggedIn = 'No';
|
|
||||||
|
if (employee.relationship && employee.relationship.toLowerCase() === "self") {
|
||||||
|
var loggedIn = 'No';
|
||||||
|
}else{
|
||||||
|
var loggedIn = '-';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
table.row.add([
|
table.row.add([
|
||||||
@ -485,6 +491,8 @@
|
|||||||
|
|
||||||
|
|
||||||
$('#emp_enrolled_view_click').on('click', function() {
|
$('#emp_enrolled_view_click').on('click', function() {
|
||||||
|
|
||||||
|
console.log($(this).hasClass('click_hover'));
|
||||||
if ($(this).hasClass('click_hover')) {
|
if ($(this).hasClass('click_hover')) {
|
||||||
// $(this).removeClass('click_hover');
|
// $(this).removeClass('click_hover');
|
||||||
$('.click_hover').each(function() {
|
$('.click_hover').each(function() {
|
||||||
@ -496,7 +504,7 @@
|
|||||||
$(this).removeClass('click_hover');
|
$(this).removeClass('click_hover');
|
||||||
});
|
});
|
||||||
$('#emp_enrolled_view_click').addClass('click_hover');
|
$('#emp_enrolled_view_click').addClass('click_hover');
|
||||||
filterTable(3, 'Yes'); // Filter "Enrolled" column (4th column, index 3)
|
filterTable(4, 'Yes'); // Filter "Enrolled" column (4th column, index 3)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -512,7 +520,7 @@
|
|||||||
$(this).removeClass('click_hover');
|
$(this).removeClass('click_hover');
|
||||||
});
|
});
|
||||||
$('#emp_not_enrolled_view_click').addClass('click_hover');
|
$('#emp_not_enrolled_view_click').addClass('click_hover');
|
||||||
filterTable(3, 'No'); // Filter "Enrolled" column (4th column, index 3)
|
filterTable(4, 'No'); // Filter "Enrolled" column (4th column, index 3)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -528,7 +536,7 @@
|
|||||||
$(this).removeClass('click_hover');
|
$(this).removeClass('click_hover');
|
||||||
});
|
});
|
||||||
$('#emp_logged_in_view_click').addClass('click_hover');
|
$('#emp_logged_in_view_click').addClass('click_hover');
|
||||||
filterTable(4, 'Yes'); // Filter "Logged-In" column (5th column, index 4)
|
filterTable(5, 'Yes'); // Filter "Logged-In" column (5th column, index 4)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -544,7 +552,7 @@
|
|||||||
$(this).removeClass('click_hover');
|
$(this).removeClass('click_hover');
|
||||||
});
|
});
|
||||||
$('#emp_not_logged_in_view_click').addClass('click_hover');
|
$('#emp_not_logged_in_view_click').addClass('click_hover');
|
||||||
filterTable(4, 'No'); // Filter "Logged-In" column (5th column, index 4)
|
filterTable(5, 'No'); // Filter "Logged-In" column (5th column, index 4)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -738,7 +746,6 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function sendManualReminder(input)
|
function sendManualReminder(input)
|
||||||
{
|
{
|
||||||
console.log('sendManualReminder function called');
|
console.log('sendManualReminder function called');
|
||||||
@ -779,44 +786,45 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: "Do you want to send reminder mail?",
|
title: "Do you want to send reminder mail?",
|
||||||
showDenyButton: true,
|
showDenyButton: true,
|
||||||
showCancelButton: false,
|
showCancelButton: false,
|
||||||
confirmButtonText: "Yes,Send",
|
confirmButtonText: "Yes,Send",
|
||||||
denyButtonText: "Don't Send"
|
denyButtonText: "Don't Send"
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
|
|
||||||
if (result.isConfirmed) {
|
if (result.isConfirmed) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?= base_url("util/send_manual_reminder/") ?>' + client_id + '/' + client_branch_id + '/' + client_policy_id,
|
url: '<?= base_url("util/send_manual_reminder/") ?>' + client_id + '/' + client_branch_id + '/' + client_policy_id,
|
||||||
type: "GET",
|
type: "GET",
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
|
|
||||||
console.log('send_manual_reminder', res)
|
console.log('send_manual_reminder', res)
|
||||||
|
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
|
||||||
if(res.status == false){
|
if(res.status == false){
|
||||||
toastr.info(res.message, 'INFO');
|
toastr.info(res.message, 'INFO');
|
||||||
}else{
|
}else{
|
||||||
toastr.success(res.message, 'SUCCESS');
|
toastr.success(res.message, 'SUCCESS');
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
console.error(xhr.responseText);
|
||||||
|
console.error(status, error);
|
||||||
|
$('.loader').fadeOut();
|
||||||
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
}
|
}
|
||||||
|
});
|
||||||
},
|
// Swal.fire("Saved!", "", "success");
|
||||||
error: function(xhr, status, error) {
|
}
|
||||||
console.error(xhr.responseText);
|
});
|
||||||
console.error(status, error);
|
|
||||||
$('.loader').fadeOut();
|
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// Swal.fire("Saved!", "", "success");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user