CHANGE_TRACKER_ISSUE_4

This commit is contained in:
aadhavan valli 2024-09-13 18:26:09 +05:30
parent 9f48376c14
commit f6be56e88c
2 changed files with 849 additions and 866 deletions

View File

@ -848,25 +848,6 @@
onkeypress="return alpha(event);">
</div>
</div>
</div>
<div class="col-md-3" >
<div class="form-group"><span>ESI Number</span>
<input type="text" id="esino" name="esino" maxlength="10"
onchange="validateESI();" class="form-control"
title=" 10 digit number"
onkeypress="return isNumberKey(event)">
</div>
</div>
<div class="col-md-3" >
<div class="form-group">
<span for="ESI_Rate">ESI Rate(%)</span>
<font color="Red">*</font>
<input type="text" name="ESI_Rate" value="<?= $esi_rate; ?>"
class="form-control num" style="text-transform:uppercase;"
pattern="([0-9]{1,2}([.][0-9]{1,2})?)"
title="Enter the Valid ESI Rate, Minimum 1 digit, Maximum 2 digits"
readonly />
<div class="col-md-3">
<div class="form-group">

View File

@ -141,16 +141,19 @@ if (!empty($EmpDetails)) {
<div class="content-page">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="col-6">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title">Edit Employee</h4>
<a class="btn btn-secondary" href="<?php echo base_url() ?>employeeListing"><span
</div>
</div>
<div class="col-6 text-right">
<a class=" btn btn-dark waves-effect waves-light" href="<?php echo base_url() ?>employeeListing"><span
class="bold">Back</span></a>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-12">
<div class="card">
@ -222,7 +225,7 @@ if (!empty($EmpDetails)) {
<br><br>
<div>
<div >
<span>Employee ID</span><span class="badge">*</span>
<input type="text" name="employeeid" id="employeeid"
value="<?php echo $EmpID; ?>" placeholder="Employee ID"
@ -962,7 +965,13 @@ if (!empty($EmpDetails)) {
<?php if (count($emp_data) > 0) { ?>
<div class="col-md-10 text-right">
<button type="button" class="btn btn-primary btn-sm a1"
onclick="appendFilesFileds()" id="day"
style="display: inline-block;">
Add New File
</button>
</div>
<?php foreach ($emp_data as $key => $value) { ?>
@ -983,13 +992,7 @@ if (!empty($EmpDetails)) {
<button type="button" class="btn btn-danger btn-sm"
id="<?= $value['id']; ?>"
onclick="removeContact(this)">Delete</button>
<button type="button" class="btn btn-primary btn-sm a1"
onclick="appendFilesFileds()" id="day"
style="display: inline-block;">
Add New File
</button>
</div>
</div>
<?php }
@ -1037,7 +1040,6 @@ if (!empty($EmpDetails)) {
</div> <!-- end card-->
</div> <!-- end col -->
</div>
</div>
</div>
<script>
@ -1045,7 +1047,7 @@ if (!empty($EmpDetails)) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
reader.onload = function (e) {
$('#profilepicture')
.attr('src', e.target.result)
.width(166)
@ -1057,8 +1059,8 @@ if (!empty($EmpDetails)) {
}
}
$(function() {
$('#checksame').click(function() {
$(function () {
$('#checksame').click(function () {
if ($('#checksame').prop('checked')) {
$('#permanentaddress').val($('#currentaddress').val());
@ -1397,7 +1399,7 @@ if (!empty($EmpDetails)) {
}
$(function() {
$(function () {
var d = new Date();
var month = d.getMonth();
@ -1459,7 +1461,7 @@ if (!empty($EmpDetails)) {
}
$(document).ready(function() {
$(document).ready(function () {
$("#gender").select2();
$("#bloodgroup").select2();
$("#MartialStatus").select2();
@ -1467,7 +1469,7 @@ if (!empty($EmpDetails)) {
$("#departmentname").select2();
$("#eduqualifaction").select2();
$("#work_location").select2();
document.getElementById('aadharno').addEventListener('input', function(e) {
document.getElementById('aadharno').addEventListener('input', function (e) {
e.target.value = e.target.value.replace(/[^\d]/g, '').replace(/(.{4})/g, '$1 ').trim();
});
});
@ -1548,7 +1550,7 @@ if (!empty($EmpDetails)) {
},
type: "POST",
url: "<?php echo base_url(); ?>deleteEmployeeFile",
success: function(data) {
success: function (data) {
if (data) {
alert("File removed");
return false;
@ -1571,7 +1573,7 @@ if (!empty($EmpDetails)) {
}
$("#email").change(function() {
$("#email").change(function () {
var id = $('#email').val();
if (validateEmail()) {
@ -1582,7 +1584,7 @@ if (!empty($EmpDetails)) {
type: "POST",
url: "<?php echo base_url(); ?>employeedetails/CheckEmail",
success: function(data) {
success: function (data) {
if (data) {
alert(data + "" +
" Employee already exists in the database.Please Change the mail id");
@ -1595,7 +1597,7 @@ if (!empty($EmpDetails)) {
}
});
$('#panno').change(function() {
$('#panno').change(function () {
var id = $('#panno').val();
if (id != '') {
@ -1606,7 +1608,7 @@ if (!empty($EmpDetails)) {
type: "POST",
url: "<?php echo base_url(); ?>employeedetails/checkPAN",
success: function(data) {
success: function (data) {
if (data) {
alert(data + "" +
" Employee already exists in the database.Please Change the Pan Card Number"
@ -1622,7 +1624,7 @@ if (!empty($EmpDetails)) {
}
});
$('#aadharno').change(function() {
$('#aadharno').change(function () {
var id = $('#aadharno').val();
if (id != '') {
@ -1632,7 +1634,7 @@ if (!empty($EmpDetails)) {
},
type: "POST",
url: "<?php echo base_url(); ?>employeedetails/checkAadharNo",
success: function(data) {
success: function (data) {
if (data) {
alert(data + "" +
" Employee already exists in the database.Please Change the Aadhar card Number"
@ -1649,7 +1651,7 @@ if (!empty($EmpDetails)) {
});
$('#bankbranchname').change(function() {
$('#bankbranchname').change(function () {
var bank = $('#bankbranchname').val();
@ -1657,7 +1659,7 @@ if (!empty($EmpDetails)) {
var y = <?php echo json_encode($bankdetails, JSON_PRETTY_PRINT) ?>;
$.each(y, function(idx, obj) {
$.each(y, function (idx, obj) {
if (bank == obj.Bank_name) {
$("#ifsccode").val(obj.IFSC);
@ -1670,8 +1672,8 @@ if (!empty($EmpDetails)) {
});
$(document).ready(function() {
$('.next').click(function(e) {
$(document).ready(function () {
$('.next').click(function (e) {
e.preventDefault(); // Prevent default action
var isValid = true;
@ -1680,7 +1682,7 @@ if (!empty($EmpDetails)) {
var $forms = $('.tab-pane form');
// Validate all forms before proceeding
$forms.each(function(index) {
$forms.each(function (index) {
var $form = $(this);
if (index <= currentIndex) {
// Only validate forms up to the current tab
@ -1711,12 +1713,12 @@ if (!empty($EmpDetails)) {
}
});
$('.submit').click(function(e) {
$('.submit').click(function (e) {
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) {
formIds.forEach(function (formId) {
var $form = $(formId);
if (!$form[0].checkValidity()) {
@ -1725,13 +1727,13 @@ if (!empty($EmpDetails)) {
return false; // Break the loop if any form is invalid
}
// Append the form data to FormData
$form.serializeArray().forEach(function(field) {
$form.serializeArray().forEach(function (field) {
combinedFormData.append(field.name, field.value);
});
// Handle file inputs separately
$form.find('input[type="file"]').each(function() {
$form.find('input[type="file"]').each(function () {
var input = $(this);
$.each(input[0].files, function(i, file) {
$.each(input[0].files, function (i, file) {
combinedFormData.append(input.attr('name'), file);
});
});
@ -1749,7 +1751,7 @@ if (!empty($EmpDetails)) {
data: combinedFormData,
processData: false, // Prevent jQuery from processing the data
contentType: false, // Prevent jQuery from setting the content type
success: function(response) {
success: function (response) {
console.log(response);
console.log('Form submitted successfully:', response == 'true');
@ -1759,7 +1761,7 @@ if (!empty($EmpDetails)) {
alert('Employee details Not Update...');
}
},
error: function(error) {
error: function (error) {
console.log('Form submission failed:', error);
}
});
@ -1780,7 +1782,7 @@ if (!empty($EmpDetails)) {
}
// Handle form submission
$('#fileForm').on('submit', function(event) {
$('#fileForm').on('submit', function (event) {
event.preventDefault(); // Prevent default form submission
// Your form submission logic here
});