FIX_ODC_ISSUES
This commit is contained in:
parent
7bb4b1937e
commit
6c251fa47d
@ -227,7 +227,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
'format' => 'mobile',
|
'format' => 'mobile',
|
||||||
'allowed_values' => null,
|
'allowed_values' => null,
|
||||||
'custom' => 'check_dup_mobileno',
|
'custom' => 'check_dup_mobileno',
|
||||||
'params' => ['row', 'existing_mobilenos']
|
'params' => ['row', 'existing_mobilenos', 'excel_data', 'row_key']
|
||||||
],
|
],
|
||||||
'email' => [
|
'email' => [
|
||||||
'col_idx' => 13,
|
'col_idx' => 13,
|
||||||
|
|||||||
@ -230,7 +230,7 @@ class EmployeeServiceController extends AdminController
|
|||||||
'format' => 'mobile',
|
'format' => 'mobile',
|
||||||
'allowed_values' => null,
|
'allowed_values' => null,
|
||||||
'custom' => 'check_dup_mobileno',
|
'custom' => 'check_dup_mobileno',
|
||||||
'params' => ['row', 'existing_mobilenos']
|
'params' => ['row', 'existing_mobilenos', 'excel_data', 'row_key']
|
||||||
],
|
],
|
||||||
'email' => [
|
'email' => [
|
||||||
'col_idx' => 13,
|
'col_idx' => 13,
|
||||||
|
|||||||
@ -1162,28 +1162,28 @@ class TicketController extends BaseController
|
|||||||
// --- EMPLOYEE DETAILS ---
|
// --- EMPLOYEE DETAILS ---
|
||||||
'emp_code' => [
|
'emp_code' => [
|
||||||
'label' => 'Employee ID',
|
'label' => 'Employee ID',
|
||||||
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9_-]+$/]',
|
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'required' => 'Employee ID is required.',
|
'required' => 'Employee ID is required.',
|
||||||
'regex_match' => 'Employee ID cannot contain spaces or special characters (only letters, numbers, hyphens and underscores. allowed).'
|
'regex_match' => 'Employee ID can only contain letters, numbers, spaces, slashes (/), hyphens (-) and underscores (_).'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'emp_name' => [
|
'emp_name' => [
|
||||||
'label' => 'Employee Name',
|
'label' => 'Employee Name',
|
||||||
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s_-]+$/]',
|
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'required' => 'Employee Name is required',
|
'required' => 'Employee Name is required',
|
||||||
'min_length' => 'Employee Name must be at least 3 characters long',
|
'min_length' => 'Employee Name must be at least 3 characters long',
|
||||||
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, hyphens, and underscores.'
|
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, slashes (/), hyphens (-), and underscores (_).'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'insured_name' => [
|
'insured_name' => [
|
||||||
'label' => 'Insured Name',
|
'label' => 'Insured Name',
|
||||||
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s_-]+$/]',
|
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'required' => 'Insured Name is required',
|
'required' => 'Insured Name is required',
|
||||||
'min_length' => 'Insured Name must be at least 3 characters long',
|
'min_length' => 'Insured Name must be at least 3 characters long',
|
||||||
'regex_match' => 'Insured Name can only contain letters, numbers, spaces, hyphens, and underscores.'
|
'regex_match' => 'Insured Name can only contain letters, numbers, spaces, slashes (/), hyphens (-), and underscores (_).'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'relationship' => ['label' => 'Relationship','rules' => 'required',
|
'relationship' => ['label' => 'Relationship','rules' => 'required',
|
||||||
@ -1393,19 +1393,19 @@ class TicketController extends BaseController
|
|||||||
// --- EMPLOYEE DETAILS ---
|
// --- EMPLOYEE DETAILS ---
|
||||||
'emp_code' => [
|
'emp_code' => [
|
||||||
'label' => 'Employee ID',
|
'label' => 'Employee ID',
|
||||||
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9_-]+$/]',
|
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'required' => 'Employee ID is required.',
|
'required' => 'Employee ID is required.',
|
||||||
'regex_match' => 'Employee ID cannot contain spaces or special characters (only letters, numbers, hyphens and underscores. allowed).',
|
'regex_match' => 'Employee ID can only contain letters, numbers, spaces, slashes (/), hyphens (-) and underscores (_).',
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'emp_name' => [
|
'emp_name' => [
|
||||||
'label' => 'Employee Name',
|
'label' => 'Employee Name',
|
||||||
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s_-]+$/]',
|
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'required' => 'Employee Name is required',
|
'required' => 'Employee Name is required',
|
||||||
'min_length' => 'Employee Name must be at least 3 characters long',
|
'min_length' => 'Employee Name must be at least 3 characters long',
|
||||||
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, hyphens, and underscores.'
|
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, slashes (/), hyphens (-), and underscores (_).'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'emp_mobile' => ['label' => 'Employee Mobile No','rules' => 'required|numeric|exact_length[10]',
|
'emp_mobile' => ['label' => 'Employee Mobile No','rules' => 'required|numeric|exact_length[10]',
|
||||||
@ -1650,28 +1650,28 @@ class TicketController extends BaseController
|
|||||||
// --- EMPLOYEE DETAILS ---
|
// --- EMPLOYEE DETAILS ---
|
||||||
'emp_code' => [
|
'emp_code' => [
|
||||||
'label' => 'Employee ID',
|
'label' => 'Employee ID',
|
||||||
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9_-]+$/]',
|
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'required' => 'Employee ID is required.',
|
'required' => 'Employee ID is required.',
|
||||||
'regex_match' => 'Employee ID cannot contain spaces or special characters (only letters, numbers, hyphens and underscores. allowed).',
|
'regex_match' => 'Employee ID can only contain letters, numbers, spaces, slashes (/), hyphens (-) and underscores (_).',
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'emp_name' => [
|
'emp_name' => [
|
||||||
'label' => 'Employee Name',
|
'label' => 'Employee Name',
|
||||||
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s_-]+$/]',
|
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'required' => 'Employee Name is required',
|
'required' => 'Employee Name is required',
|
||||||
'min_length' => 'Employee Name must be at least 3 characters long',
|
'min_length' => 'Employee Name must be at least 3 characters long',
|
||||||
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, hyphens, and underscores.'
|
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, slashes (/), hyphens (-), and underscores (_).'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'insured_name' => [
|
'insured_name' => [
|
||||||
'label' => 'Insured Name',
|
'label' => 'Insured Name',
|
||||||
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s_-]+$/]',
|
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'required' => 'Insured Name is required',
|
'required' => 'Insured Name is required',
|
||||||
'min_length' => 'Insured Name must be at least 3 characters long',
|
'min_length' => 'Insured Name must be at least 3 characters long',
|
||||||
'regex_match' => 'Insured Name can only contain letters, numbers, spaces, hyphens, and underscores.'
|
'regex_match' => 'Insured Name can only contain letters, numbers, spaces, slashes (/), hyphens (-), and underscores (_).'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'relationship' => ['label' => 'Relationship','rules' => 'required',
|
'relationship' => ['label' => 'Relationship','rules' => 'required',
|
||||||
@ -1882,19 +1882,19 @@ class TicketController extends BaseController
|
|||||||
// --- EMPLOYEE DETAILS ---
|
// --- EMPLOYEE DETAILS ---
|
||||||
'emp_code' => [
|
'emp_code' => [
|
||||||
'label' => 'Employee ID',
|
'label' => 'Employee ID',
|
||||||
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9_-]+$/]',
|
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'required' => 'Employee ID is required.',
|
'required' => 'Employee ID is required.',
|
||||||
'regex_match' => 'Employee ID cannot contain spaces or special characters (only letters, numbers, hyphens and underscores. allowed).',
|
'regex_match' => 'Employee ID can only contain letters, numbers, spaces, slashes (/), hyphens (-) and underscores (_).',
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'emp_name' => [
|
'emp_name' => [
|
||||||
'label' => 'Employee Name',
|
'label' => 'Employee Name',
|
||||||
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s_-]+$/]',
|
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'required' => 'Employee Name is required',
|
'required' => 'Employee Name is required',
|
||||||
'min_length' => 'Employee Name must be at least 3 characters long',
|
'min_length' => 'Employee Name must be at least 3 characters long',
|
||||||
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, hyphens, and underscores.'
|
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, slashes (/), hyphens (-), and underscores (_).'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'emp_mobile' => ['label' => 'Employee Mobile No','rules' => 'required|numeric|exact_length[10]',
|
'emp_mobile' => ['label' => 'Employee Mobile No','rules' => 'required|numeric|exact_length[10]',
|
||||||
|
|||||||
@ -2107,8 +2107,8 @@ if (!function_exists('remap_default_age_ratio_into_relationship')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('check_dup_mobileno')) {
|
if (!function_exists('check_dup_mobileno_old')) {
|
||||||
function check_dup_mobileno(array $row, array $existing_mobilenos)
|
function check_dup_mobileno_old(array $row, array $existing_mobilenos)
|
||||||
{
|
{
|
||||||
if(!empty($row['12'])){
|
if(!empty($row['12'])){
|
||||||
foreach ($existing_mobilenos as $k => $value) {
|
foreach ($existing_mobilenos as $k => $value) {
|
||||||
@ -2122,6 +2122,41 @@ if (!function_exists('check_dup_mobileno')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('check_dup_mobileno')) {
|
||||||
|
function check_dup_mobileno(array $row, array $existing_mobilenos, $excel_data = [], $row_key = null)
|
||||||
|
{
|
||||||
|
if(!empty($row['12'])){
|
||||||
|
$current_relation = strtolower(trim($row['5'] ?? ''));
|
||||||
|
$current_mobile = trim((string) $row['12']);
|
||||||
|
|
||||||
|
foreach ($existing_mobilenos as $k => $value) {
|
||||||
|
if ($current_relation == 'self' && $current_mobile == trim((string) ($value['mobile'] ?? ''))) {
|
||||||
|
return array('status' => false, 'error' => "Duplicate Mobile No");
|
||||||
|
// break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($excel_data as $ed_row => $value) {
|
||||||
|
if ($row_key !== null && (string) $ed_row === (string) $row_key) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$excel_relation = strtolower(trim($value['5'] ?? ''));
|
||||||
|
$excel_mobile = trim((string) ($value['12'] ?? ''));
|
||||||
|
|
||||||
|
if ($current_relation == 'self' && $excel_relation == 'self' && $excel_mobile !== '' && $current_mobile == $excel_mobile) {
|
||||||
|
$duplicate_row_no = is_numeric($ed_row) ? $ed_row + 1 : $ed_row;
|
||||||
|
$current_row_no = is_numeric($row_key) ? $row_key + 1 : $row_key;
|
||||||
|
return array('status' => false, 'error' => "This mobile number has already been used for another self in Excel at row no. " . ($duplicate_row_no) . " and " . ($current_row_no));
|
||||||
|
// break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return array('status' => true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if (!function_exists('check_dup_email')) {
|
// if (!function_exists('check_dup_email')) {
|
||||||
// function check_dup_email(array $row, array $existing_mobilenos)
|
// function check_dup_email(array $row, array $existing_mobilenos)
|
||||||
// {
|
// {
|
||||||
|
|||||||
@ -298,6 +298,7 @@ $fl_col_width_px = nhance_dt_column_widths_px($fl_header_labels, $fl_col_max_len
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form class="parsley-examples" id="uploadForm" action="<?php echo base_url() . 'employee/upload' ?>"
|
<form class="parsley-examples" id="uploadForm" action="<?php echo base_url() . 'employee/upload' ?>"
|
||||||
|
method="post"
|
||||||
enctype="multipart/form-data">
|
enctype="multipart/form-data">
|
||||||
<input type="hidden" id="file_client_id" name="client_id">
|
<input type="hidden" id="file_client_id" name="client_id">
|
||||||
<input type="hidden" id="file_policy_id" name="policy_id">
|
<input type="hidden" id="file_policy_id" name="policy_id">
|
||||||
@ -537,12 +538,14 @@ $fl_col_width_px = nhance_dt_column_widths_px($fl_header_labels, $fl_col_max_len
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#uploadForm').submit(function() {
|
$('#uploadForm').submit(function(event) {
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
var isValid = $('#uploadForm').parsley().validate();
|
var isValid = $('#uploadForm').parsley().validate();
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
console.log('Form is Empty', 'Warning');
|
console.log('Form is Empty', 'Warning');
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create FormData object
|
// Create FormData object
|
||||||
@ -595,6 +598,8 @@ $fl_col_width_px = nhance_dt_column_widths_px($fl_header_labels, $fl_col_max_len
|
|||||||
window.location.reload(true);
|
window.location.reload(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
})
|
})
|
||||||
|
|
||||||
$('body').on('click', '.reload', function() {
|
$('body').on('click', '.reload', function() {
|
||||||
|
|||||||
@ -1358,10 +1358,17 @@
|
|||||||
toastr.error(response.message || 'Unable to fetch data', 'Error');
|
toastr.error(response.message || 'Unable to fetch data', 'Error');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
window.location.reload();
|
||||||
|
}, 500);
|
||||||
|
|
||||||
}, function(xhr, status, error) {
|
}, function(xhr, status, error) {
|
||||||
console.error('Error fetching data:', error);
|
console.error('Error fetching data:', error);
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
toastr.error('An error occurred while fetching TPA ID.', 'Error');
|
toastr.error('An error occurred while fetching TPA ID.', 'Error');
|
||||||
|
setTimeout(function() {
|
||||||
|
window.location.reload();
|
||||||
|
}, 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user