employee module bug fix for date realted - vadivel j

This commit is contained in:
vadivel J 2024-09-19 14:15:47 +05:30
parent 430b601382
commit 22cee5127c
2 changed files with 30 additions and 7 deletions

View File

@ -691,6 +691,9 @@ class Employeedetails extends BaseController
$LastName = $this->request->getPost('LastName');
$FatherName = $this->request->getPost('FatherName');
$DateofBirth = $this->request->getPost('DateofBirth');
// dd($DateofBirth);
$ContactNumber = $this->request->getPost('ContactNumber');
$EmailId = $this->request->getPost('emailid');
$comEmailId = $this->request->getPost('comemailid');
@ -704,6 +707,9 @@ class Employeedetails extends BaseController
$desigination = $this->request->getPost('desigination');
$departmentCode = $this->request->getPost('departmentname');
$dateofjoining = $this->request->getPost('dateofjoining');
// dd($dateofjoining);
//$Previousexperience = $this->request->getPost('Previousexperience');
$pre_experience = $this->request->getPost('Previousexperience');
@ -728,9 +734,18 @@ class Employeedetails extends BaseController
$ValidTill = $this->request->getPost('ValidTill');
$addinfo = $this->request->getPost('addinfo');
$driverlicense = $this->request->getPost('driverlicense');
// dd($driverlicense);
$driverlicense = $driverlicense !== null && is_string($driverlicense) ? strtoupper($driverlicense) : null;
$licenseExpiryDate = $this->request->getPost('LicenseExpiryDate');
$VoterID = $this->request->getPost('voterID');
//dd($VoterID);
$VoterID = $VoterID !== null && is_string($VoterID) ? strtoupper($VoterID) : null;
$pfno = $this->request->getPost('pfno');
$pfno = $pfno !== null && is_string($pfno) ? strtoupper($pfno) : null;
@ -752,16 +767,21 @@ class Employeedetails extends BaseController
$UpdatedBY = $this->session->get('userId');
//$licenseExpiryDate = get_date_time_format($licenseExpiryDate);
$DOB = get_date_format($DateofBirth);
$DOJ = get_date_format($dateofjoining);
$DOB = get_date_time_format($DateofBirth);
$DOJ = get_date_time_format($dateofjoining);
if ($ValidTill != '') {
$Valid = get_date_format($ValidTill);
$Valid = get_date_time_format($ValidTill);
} else {
$Valid = null;
}
if ($licenseExpiryDate != '') {
$License_ExpiryDate = get_date_format($licenseExpiryDate);
$License_ExpiryDate = get_date_time_format($licenseExpiryDate);
} else {
$License_ExpiryDate = null;
}

View File

@ -951,7 +951,7 @@ if (!empty($EmpDetails)) {
<div class="row">
<div class="col-md-3">
<label>Voter ID</label>
<input type="text" id="VoterID" name="VoterID" maxlength="12"
<input type="text" id="VoterID" name="voterID" maxlength="12"
value="<?php echo $VoterID; ?>" class="form-control"
placeholder="VoterID" onkeypress="return alpha(event);"
style="text-transform: uppercase">
@ -962,7 +962,7 @@ if (!empty($EmpDetails)) {
<input type="text" id="Driverlicense" maxlength="16"
onchange="validateDriverLicense();"
pattern="[a-zA-Z]{2}[0-9]{2}\s[0-9]{11}"
value="<?php echo $DriverLicense; ?>" name="Driverlicense"
value="<?php echo $DriverLicense; ?>" name="driverlicense"
title="EX:TN82 12345678900" class="form-control"
placeholder="Driverlicense"
style="text-transform: uppercase"
@ -1770,6 +1770,7 @@ if (!empty($EmpDetails)) {
e.preventDefault();
var isValid = true;
var combinedFormData = new FormData();
var formIds = ['#accountForm', '#profileForm', '#bankForm', '#proofForm', '#fileForm']; // Add all your form IDs here
formIds.forEach(function(formId) {
var $form = $(formId);
@ -1781,6 +1782,8 @@ if (!empty($EmpDetails)) {
}
// Append the form data to FormData
$form.serializeArray().forEach(function(field) {
console.log(field.name);
console.log(field.value);
combinedFormData.append(field.name, field.value);
});
// Handle file inputs separately
@ -1809,7 +1812,7 @@ if (!empty($EmpDetails)) {
console.log('Form submitted successfully:', response == 'true');
if (response == 'true') {
window.location.href = '<?php echo base_url("employeeListing"); ?>';
// window.location.href = '<?php echo base_url("employeeListing"); ?>';
} else {
alert('Employee details Not Update...');
}