Lifemankind Domain (User addition form)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m41s Details

This commit is contained in:
Tanuja Pansare 2026-09-18 12:00:04 +05:30
parent b442dcd9c8
commit 2bb5e580f1
1 changed files with 15 additions and 10 deletions

View File

@ -48,6 +48,11 @@
$employeeCodes = []; $employeeCodes = [];
foreach ($submissions as $submission) { foreach ($submissions as $submission) {
if (isset($id) && !empty($id) && isset($submission->id) && $submission->id == $id) {
continue;
}
if (isset($submission->formdata->employee_code)) { if (isset($submission->formdata->employee_code)) {
$employeeCodes[] = $submission->formdata->employee_code; $employeeCodes[] = $submission->formdata->employee_code;
} }
@ -329,7 +334,7 @@
$('#field-employee_code').on('input', function () { $('#field-employee_code').on('input', function () {
let value = $(this).val(); let value = $(this).val();
// फक्त numbers
value = value.replace(/\D/g, ''); value = value.replace(/\D/g, '');
// Maximum 8 digits // Maximum 8 digits
@ -342,7 +347,7 @@
$('#field-position_code').on('input', function () { $('#field-position_code').on('input', function () {
let value = $(this).val(); let value = $(this).val();
// फक्त numbers
value = value.replace(/\D/g, ''); value = value.replace(/\D/g, '');
// Maximum 8 digits // Maximum 8 digits
@ -354,7 +359,7 @@
$('#field-emp_code_of_previous_employee').on('input', function () { $('#field-emp_code_of_previous_employee').on('input', function () {
let value = $(this).val(); let value = $(this).val();
// फक्त numbers
value = value.replace(/\D/g, ''); value = value.replace(/\D/g, '');
// Maximum 8 digits // Maximum 8 digits
@ -366,7 +371,7 @@
$('#field-l1_manager_code_emp_code').on('input', function () { $('#field-l1_manager_code_emp_code').on('input', function () {
let value = $(this).val(); let value = $(this).val();
// फक्त numbers
value = value.replace(/\D/g, ''); value = value.replace(/\D/g, '');
// Maximum 8 digits // Maximum 8 digits
@ -378,10 +383,10 @@
$('#field-l2_manager_emp_code').on('input', function () { $('#field-l2_manager_emp_code').on('input', function () {
let value = $(this).val(); let value = $(this).val();
// फक्त numbers
value = value.replace(/\D/g, ''); value = value.replace(/\D/g, '');
// Maximum 8 digits
value = value.substring(0, 8); value = value.substring(0, 8);
$(this).val(value); $(this).val(value);
@ -392,7 +397,7 @@
$('#field-email_id').on('input', function () { $('#field-email_id').on('input', function () {
let email = $(this).val().trim(); let email = $(this).val().trim();
// @mankindpharma.com सोडून दुसरा domain असल्यास validation
if (email !== '' && !/@mankindpharma\.com$/i.test(email)) { if (email !== '' && !/@mankindpharma\.com$/i.test(email)) {
this.setCustomValidity('Email must end with @mankindpharma.com'); this.setCustomValidity('Email must end with @mankindpharma.com');
} else { } else {
@ -403,10 +408,10 @@
$('#field-mobile_number').on('input', function () { $('#field-mobile_number').on('input', function () {
let value = $(this).val(); let value = $(this).val();
// फक्त numbers
value = value.replace(/\D/g, ''); value = value.replace(/\D/g, '');
// Maximum 10 digits
value = value.substring(0, 10); value = value.substring(0, 10);
$(this).val(value); $(this).val(value);
@ -447,7 +452,7 @@
} }
// Exactly 8 digits आणि first digit 1-4 // Exactly 8 digits आणि first digit 1-4
if (!/^[1-4][0-9]{7}$/.test(emp_code_of_previous_employee)) { if (emp_code_of_previous_employee !== '' && !/^[1-4][0-9]{7}$/.test(emp_code_of_previous_employee)) {
event.preventDefault(); event.preventDefault();
alert('Previous Employee Code must be exactly 8 digits and must start with 1, 2, 3, or 4.'); alert('Previous Employee Code must be exactly 8 digits and must start with 1, 2, 3, or 4.');