2249 lines
118 KiB
PHP
Executable File
2249 lines
118 KiB
PHP
Executable File
<style>
|
|
.row {
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
label {
|
|
font-style: bold;
|
|
}
|
|
|
|
input[type="file"] {
|
|
white-space: normal;
|
|
word-wrap: break-word;
|
|
overflow-wrap: break-word;
|
|
width: 100%;
|
|
}
|
|
</style>
|
|
<?php
|
|
|
|
$EmpID = '';
|
|
$FirstName = '';
|
|
$LastName = '';
|
|
$FatherName = '';
|
|
$Gender = '';
|
|
$DateofBirth = '';
|
|
$ContactNumber = '';
|
|
$EmailId = '';
|
|
$MartialStatus = '';
|
|
$DateofJoining = '';
|
|
$PreviousYearsOfExp = '';
|
|
$Designation = '';
|
|
$work_location = '';
|
|
$Departmentcode = '';
|
|
$PresentAddress = '';
|
|
$PermanentAddress = '';
|
|
$EmergencyContactName = '';
|
|
$EmergencyContactNumber = '';
|
|
$Edu_Qualification = '';
|
|
$Additional_Qualification = '';
|
|
$AadharNo = '';
|
|
$PANNo = '';
|
|
$BankAccountNo = '';
|
|
$IFSCCode = '';
|
|
$BankBranchName = '';
|
|
$BankAddress = '';
|
|
$PassportNo = '';
|
|
$Passport_Valid_till = '';
|
|
$IsActive = '';
|
|
$ProfilePic = '';
|
|
$Reference_Name = '';
|
|
$Reference_ContactNumber = '';
|
|
$Remarks = '';
|
|
$DepartmentName = '';
|
|
$DOPassport = '';
|
|
$Age = '';
|
|
$DOB = '';
|
|
$DOJ = '';
|
|
$personalEmailId = '';
|
|
$DriverLicense = '';
|
|
$LicenseValidtill = '';
|
|
$VoterID = '';
|
|
$pfno = '';
|
|
$esino = '';
|
|
$nominee = '';
|
|
$uano = '';
|
|
$is_management_team = 0;
|
|
$esi_applicable = 0;
|
|
$pf_applicable = 0;
|
|
$TDS_Rate = '';
|
|
$tds_apllicable = 0;
|
|
$is_driver = 0;
|
|
$reason = '';
|
|
if (!empty($EmpDetails)) {
|
|
foreach ($EmpDetails as $Emp) {
|
|
$EmpID = $Emp->EmpID;
|
|
$FirstName = $Emp->FirstName;
|
|
$LastName = $Emp->LastName;
|
|
$FatherName = $Emp->FatherName;
|
|
$Gender = $Emp->Gender;
|
|
$DateofBirth = $Emp->DateofBirth;
|
|
$from = new DateTime($DateofBirth);
|
|
$to = new DateTime('today');
|
|
$Age = $from->diff($to)->y;
|
|
$DOB = $from->format('d-m-Y');
|
|
$ContactNumber = $Emp->ContactNumber;
|
|
$EmailId = $Emp->EmailId;
|
|
$MartialStatus = $Emp->MartialStatus;
|
|
$DateofJoining = $Emp->DateofJoining;
|
|
$dtDOJ = new DateTime($DateofJoining);
|
|
$DOJ = $dtDOJ->format('d-m-Y');
|
|
$PreviousYearsOfExp = $Emp->PreviousYearsOfExp;
|
|
$Designation = $Emp->Designation;
|
|
$work_location = $Emp->work_location;
|
|
$Departmentcode = $Emp->Departmentcode;
|
|
$DepartmentName = $Emp->DepartmentName;
|
|
$PresentAddress = $Emp->PresentAddress;
|
|
$PermanentAddress = $Emp->PermanentAddress;
|
|
$EmergencyContactName = $Emp->EmergencyContactName;
|
|
$EmergencyContactNumber = $Emp->EmergencyContactNumber;
|
|
$Edu_Qualification = $Emp->Edu_Qualification;
|
|
$Additional_Qualification = $Emp->Additional_Qualification;
|
|
$AadharNo = $Emp->AadharNo;
|
|
$PANNo = $Emp->PANNo;
|
|
$BankAccountNo = $Emp->BankAccountNo;
|
|
$IFSCCode = $Emp->IFSCCode;
|
|
$BankBranchName = $Emp->BankBranchName;
|
|
$BankAddress = $Emp->BankAddress;
|
|
$TDS_Rate = $Emp->TDS_Rate;
|
|
$tds_applicable = $Emp->tds_applicable;
|
|
$PassportNo = $Emp->PassportNo;
|
|
$Passport_Valid_till = $Emp->Passport_Valid_till;
|
|
if ($Passport_Valid_till != '' && $Passport_Valid_till != '0000-00-00 00:00:00') {
|
|
$dtpassport = new DateTime($Passport_Valid_till);
|
|
$DOPassport = $dtpassport->format('d-m-Y');
|
|
} else {
|
|
|
|
$DOPassport = '';
|
|
}
|
|
|
|
$isactive = $Emp->IsActive;
|
|
$ProfilePicPath = '';
|
|
$is_driver = $Emp->is_driver;
|
|
|
|
if (!empty($Emp->ProfilePic)) {
|
|
|
|
$ProfilePicPath = base_url() . 'public/uploads/images/' . $Emp->ProfilePic;
|
|
} else {
|
|
$ProfilePicPath = base_url() . 'public/assets/dist/img/avatar.png';
|
|
}
|
|
$Reference_Name = $Emp->Reference_Name;
|
|
$Reference_ContactNumber = $Emp->Reference_ContactNumber;
|
|
$Remarks = $Emp->Remarks;
|
|
$personalEmailId = $Emp->personalEmailId;
|
|
$DriverLicense = $Emp->DriverLicense;
|
|
$VoterID = $Emp->VoterID;
|
|
$pfno = $Emp->PFNO;
|
|
$esino = $Emp->ESI;
|
|
$nominee = $Emp->NomineeDetails;
|
|
|
|
|
|
if ($Emp->LicenseValidtill != '' && $Emp->LicenseValidtill != '0000-00-00 00:00:00') {
|
|
$License = new DateTime($Emp->LicenseValidtill);
|
|
$LicenseValidtill = $License->format('d-m-Y');
|
|
} else {
|
|
$LicenseValidtill = '';
|
|
}
|
|
//$chk = $uf->IsActive;
|
|
if ($isactive == 1) {
|
|
$IsActive = 'checked';
|
|
} else {
|
|
$IsActive = '';
|
|
}
|
|
|
|
$is_management_team = $Emp->is_management_team;
|
|
$esi_applicable = $Emp->esi_applicable;
|
|
$pf_applicable = $Emp->pf_applicable;
|
|
$reason = $Emp->reason;
|
|
}
|
|
}
|
|
?>
|
|
|
|
|
|
<div class="content-page">
|
|
<div class="content">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<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
|
|
class="bold">Back</span></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-xl-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div id="rootwizard">
|
|
<ul class="nav nav-pills nav-justified form-wizard-header mb-3">
|
|
<li class="nav-item" data-target-form="#accountForm">
|
|
<a href="#first" data-toggle="tab" class="nav-link active">
|
|
<!-- <a data-toggle="tab" class="nav-link active"> -->
|
|
<span class="number">1</span>
|
|
<span class="d-none d-sm-inline">Personal Information</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item" data-target-form="#profileForm">
|
|
<a href="#second" data-toggle="tab" class="nav-link">
|
|
<!-- <a data-toggle="tab" class="nav-link"> -->
|
|
<span class="number">2</span>
|
|
<span class="d-none d-sm-inline">Work Profile</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item" data-target-form="#bankForm">
|
|
<a href="#third" data-toggle="tab" class="nav-link">
|
|
<!-- <a data-toggle="tab" class="nav-link"> -->
|
|
<span class="number">3</span>
|
|
<span class="d-none d-sm-inline">Bank & Emp Benefits</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item" data-target-form="#proofForm">
|
|
<a href="#fourth" data-toggle="tab" class="nav-link">
|
|
<!-- <a data-toggle="tab" class="nav-link"> -->
|
|
<span class="number">4</span>
|
|
<span class="d-none d-sm-inline">Proof</span>
|
|
</a>
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<div class="tab-content mb-0 b-0">
|
|
|
|
<div class="tab-pane active" id="first">
|
|
|
|
<form id="accountForm" method="post" action="#" enctype="multipart/form-data"
|
|
class="form-horizontal">
|
|
<div class="row">
|
|
|
|
<div class="col-md-2">
|
|
|
|
<div class="form-row">
|
|
<div class="box-header">
|
|
|
|
<img id="profilepicture"
|
|
src="<?php echo $ProfilePicPath; ?>" alt="your image"
|
|
style="width: 139px;" />
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<br />
|
|
|
|
<div class="form-row">
|
|
|
|
<label for="photo">Select profile picture<br /><small>(only .jpg
|
|
or
|
|
.png)</small>
|
|
</label>
|
|
|
|
<br>
|
|
|
|
<input type='file' onchange="readURL(this);" id="photo"
|
|
name="photo" />
|
|
|
|
<?php if($Emp->ProfilePic){ ?>
|
|
<br/>
|
|
<label style="white-space: normal; word-wrap: break-word; overflow-wrap: break-word; width: 100%;"><span>previously uploaded profile picture - </span>
|
|
<small><?= $Emp->ProfilePic; ?></small></label>
|
|
<?php } ?>
|
|
|
|
<input type="hidden" name="oldImageName" id="Image"
|
|
value="<?php echo $Emp->ProfilePic; ?>" class="form-control"
|
|
readonly>
|
|
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<div class="form-row">
|
|
<label>Employee ID</label><span class="badge">*</span>
|
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
|
|
<input type="text" name="employeeid" id="employeeid"
|
|
value="<?php echo $EmpID; ?>" placeholder="Employee ID"
|
|
class="form-control w-50" readonly>
|
|
</div>
|
|
|
|
<br>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-md-4 pad">
|
|
<label>Full Name</label><span class="badge">*</span>
|
|
<input type="text" name="FirstName" maxlength="100"
|
|
value="<?php echo $FirstName; ?>" id="FirstName"
|
|
placeholder="First Name" class="form-control" required
|
|
onkeypress="return onlyAlphabets(event);">
|
|
</div>
|
|
|
|
<div class="col-md-4 pad">
|
|
<label>Father / Husband Name</label><span
|
|
class="badge">*</span>
|
|
<input type="text" name="FatherName" id="FatherName"
|
|
maxlength="200" value="<?php echo $FatherName; ?>"
|
|
placeholder="Father / Husband Name"
|
|
class="form-control" required
|
|
onkeypress="return onlyAlphabets(event);">
|
|
</div>
|
|
|
|
<div class="col-md-4 pad">
|
|
<label>Contact Number</label><span class="badge">*</span>
|
|
<input type="text" name="ContactNumber"
|
|
value="<?php echo $ContactNumber; ?>"
|
|
onchange="getMobileValidation();" id="ContactNumber"
|
|
required placeholder="Contact Number" maxlength="10"
|
|
class="form-control"
|
|
onkeypress="return isNumberKey(event)">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-md-4 pad">
|
|
<label>Gender</label><span class="badge">*</span>
|
|
<select id="gender" name="gender" type="text"
|
|
placeholder="Gender" required
|
|
class="form-control select2">
|
|
<option value="<?php echo $Gender; ?>">
|
|
<?php echo $Gender; ?>
|
|
</option>
|
|
<?php foreach ($GenderList as $rl): ?>
|
|
<?php $rl1 = $rl->ConfigValue; ?>
|
|
<?php if (trim($rl1) != trim($Gender)): ?>
|
|
<?php if (isset($_POST['gender']) && $_POST['gender'] == $rl1): ?>
|
|
<option value="<?= esc($rl1) ?>" selected="selected">
|
|
<?= esc($rl->ConfigValue) ?>
|
|
</option>
|
|
<?php else: ?>
|
|
<option value="<?= esc($rl1) ?>">
|
|
<?= esc($rl->ConfigValue) ?>
|
|
</option>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
|
|
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-md-4 pad">
|
|
<label>Date Of Birth</label><span class="badge">*</span>
|
|
<input id="DateofBirth" required name="DateofBirth"
|
|
value="<?php echo $DOB; ?>" maxlength="10"
|
|
placeholder="Date Of Birth" onchange="getAge();"
|
|
class="form-control" data-provide="datepicker"
|
|
data-date-format="dd-mm-yyyy">
|
|
</div>
|
|
|
|
<div class="col-md-4 pad">
|
|
<label>Age</label><span class="badge">*</span>
|
|
<input type="text" name="age" placeholder="Age" id="age"
|
|
value="<?php echo $Age; ?>" class="form-control"
|
|
readonly>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- <div class="row mb-3">
|
|
|
|
<div class="col-md-4 pad">
|
|
<label>Official Email ID</label><span class="badge">*</span>
|
|
<input type="mail" name="emailid"
|
|
value="<?php echo $EmailId; ?>" id="email" required
|
|
placeholder="Email ID" maxlength="100" class="form-control">
|
|
</div>
|
|
|
|
<div class="col-md-4 pad">
|
|
<label>Personal Email ID</label>
|
|
<input type="email" name="comemailid" id="mail"
|
|
placeholder="Official Email ID"
|
|
value="<?php echo $personalEmailId; ?>" maxlength="100"
|
|
class="form-control">
|
|
</div>
|
|
|
|
|
|
|
|
</div> -->
|
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-md-4 pad">
|
|
<label>Current Address</label><span class="badge">*</span>
|
|
<input type="text" id="currentaddress" pattern=".{1,500}"
|
|
required name="currentaddress" maxlength="500"
|
|
value="<?php echo $PresentAddress; ?>"
|
|
placeholder="Current Address" class="form-control">
|
|
</div>
|
|
|
|
|
|
<div class="col-md-4 pad" style="margin-top: 36px;">
|
|
<input type="checkbox" id="checksame" name="sameaddress"
|
|
onclick="CheckClick">
|
|
<label> Current address same as permanent
|
|
address</label>
|
|
</div>
|
|
|
|
<div class="col-md-4 pad">
|
|
<label>Permanent Address</label><span class="badge">*</span>
|
|
<input type="text" id="permanentaddress" required
|
|
name="permanentaddress" pattern=".{0,500}"
|
|
value="<?php echo $PermanentAddress; ?>" maxlength="500"
|
|
placeholder="Permanent Address " class="form-control">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row mb-3">
|
|
|
|
|
|
|
|
|
|
<div class="col-md-4 pad">
|
|
<label>Marital Status</label><span class="badge">*</span>
|
|
<select id="MartialStatus" name="MartialStatus" type="text"
|
|
required placeholder="Marital status"
|
|
class="form-control select2">
|
|
<option value="<?php echo $MartialStatus ?>">
|
|
<?php echo $MartialStatus; ?>
|
|
</option>
|
|
<?php foreach ($MartialList as $rl): ?>
|
|
<?php $rl1 = $rl->ConfigValue; ?>
|
|
<?php if (trim($rl1) != trim($MartialStatus)): ?>
|
|
<?php if (isset($_POST['MartialStatus']) && $_POST['MartialStatus'] == $rl1): ?>
|
|
<option value="<?= esc($rl1) ?>" selected="selected">
|
|
<?= esc($rl->ConfigValue) ?>
|
|
</option>
|
|
<?php else: ?>
|
|
<option value="<?= esc($rl1) ?>">
|
|
<?= esc($rl->ConfigValue) ?>
|
|
</option>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-md-4 pad">
|
|
|
|
<input type="checkbox" id="isactive" <?php echo $IsActive; ?>
|
|
name="isactive" value="1" onchange="handleCheckboxChange()">
|
|
<label style="margin-top:8px;">
|
|
Is Active
|
|
</label>
|
|
</div>
|
|
|
|
<div class="col-md-4 pad" id="reasonContainer" style="display: none;">
|
|
<label>Reason</label>
|
|
<textarea class="form-control" id="reason" name="reason" style="display: none;"><?php echo $reason ?></textarea>
|
|
</div>
|
|
|
|
<!-- <div class="col-md-4 pad">
|
|
<label>Emergency Contact Name</label>
|
|
<input type="text" id="emergencycontactname" maxlength="100"
|
|
name="emergencycontactname"
|
|
value="<?php echo $EmergencyContactName; ?>"
|
|
placeholder="Emergency Contact Name" class="form-control">
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
<label>Emergency Contact Number</label>
|
|
<input type="text" id="emergencycontactnumber"
|
|
name="emergencycontactnumber"
|
|
onchange="getValidEmergencyNumber();" maxlength="10"
|
|
value="<?php echo $EmergencyContactNumber; ?>"
|
|
placeholder="Emergency Contact Number" class="form-control"
|
|
onkeypress="return isNumberKey(event)">
|
|
</div> -->
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<ul class="list-inline wizard mb-0">
|
|
<li class="previous list-inline-item"><a href="javascript: void(0);"
|
|
class="btn btn-secondary">Previous</a>
|
|
</li>
|
|
<li class="next list-inline-item float-right"><a href="javascript: void(0);"
|
|
class="btn btn-secondary">Next</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="second">
|
|
<form id="profileForm" method="post" action="#" class="form-horizontal">
|
|
<div class="row">
|
|
<div class="col-md-1">
|
|
</div>
|
|
<div class="col-md-11">
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<label>Designation</label><span class="badge">*</span>
|
|
<select type="text" id="desigination" name="desigination"
|
|
required class="form-control select2">
|
|
<option value="<?php echo $Designation; ?>">
|
|
<?php echo $Designation; ?>
|
|
</option>
|
|
<?php foreach ($DesignationList as $rl): ?>
|
|
<?php $rl1 = $rl->ConfigValue; ?>
|
|
<?php if (trim($rl1) != trim($Designation)): ?>
|
|
<?php if (isset($_POST['Designation']) && $_POST['Designation'] == $rl1): ?>
|
|
<option value="<?= esc($rl1) ?>" selected="selected">
|
|
<?= esc($rl->ConfigValue) ?>
|
|
</option>
|
|
<?php else: ?>
|
|
<option value="<?= esc($rl1) ?>">
|
|
<?= esc($rl->ConfigValue) ?>
|
|
</option>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
|
|
</select>
|
|
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Department</label><span class="badge">*</span>
|
|
<select type="text" id="departmentname"
|
|
name="departmentname" required
|
|
class="form-control select2">
|
|
<option value="<?php echo $Departmentcode; ?>">
|
|
<?php echo $Departmentcode . " - " . $DepartmentName; ?>
|
|
</option>
|
|
<?php foreach ($DepartmentList as $rl): ?>
|
|
<?php $rl1 = $rl->DEPCode; ?>
|
|
<?php if (trim($rl1) != trim($Departmentcode)): ?>
|
|
<?php if (isset($_POST['Departmentcode']) && $_POST['Departmentcode'] == $rl1): ?>
|
|
<option value="<?= esc($rl1) ?>" selected="selected">
|
|
<?= esc($rl->DEPCode) . " - " . esc($rl->DepartmentName); ?>
|
|
</option>
|
|
<?php else: ?>
|
|
<option value="<?= esc($rl1) ?>">
|
|
<?= esc($rl->DEPCode) . " - " . esc($rl->DepartmentName); ?>
|
|
</option>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Date Of Joining</label><span class="badge">*</span>
|
|
<input id="dateofjoining" name="dateofjoining"
|
|
value="<?php echo $DOJ; ?>" maxlength="10" required
|
|
placeholder="Date Of Joining" class="form-control"
|
|
data-provide="datepicker" data-date-format="dd-mm-yyyy">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Previous Years of Experience</label>
|
|
<input type="text" id="Previousexperience"
|
|
value="<?php echo $PreviousYearsOfExp; ?>"
|
|
name="Previousexperience" maxlength="4"
|
|
onkeypress="return isNumberKey(event)"
|
|
placeholder="Previous Years of Experience"
|
|
class="form-control">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-1">
|
|
</div>
|
|
<div class="col-md-11">
|
|
<div class="row">
|
|
|
|
<div class="col-md-3">
|
|
<label>Qualification</label><span class="badge">*</span>
|
|
<select type="text" id="eduqualifaction"
|
|
name="eduqualifaction" required
|
|
class="form-control select2">
|
|
<option value="<?php echo $Edu_Qualification; ?>">
|
|
<?php echo $Edu_Qualification; ?>
|
|
</option>
|
|
<?php foreach ($QualificationList as $rl): ?>
|
|
<?php $rl1 = $rl->ConfigValue; ?>
|
|
<?php if (trim($rl1) != trim($Designation)): ?>
|
|
<?php if (isset($_POST['Edu_Qualification']) && $_POST['Edu_Qualification'] == $rl1): ?>
|
|
<option value="<?= esc($rl1) ?>" selected="selected">
|
|
<?= esc($rl->ConfigValue) ?>
|
|
</option>
|
|
<?php else: ?>
|
|
<option value="<?= esc($rl1) ?>">
|
|
<?= esc($rl->ConfigValue) ?>
|
|
</option>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-3" style="display:none">
|
|
<label>Additional Qualification</label>
|
|
<input type="text" id="addqualification"
|
|
name="addqualification"
|
|
value="<?php echo $Additional_Qualification; ?>"
|
|
maxlength="100" placeholder="Additional Qualification"
|
|
class="form-control">
|
|
</div>
|
|
<div class="col-md-3" style="display:none">
|
|
<label>Referred By</label>
|
|
<input type="text" id="referredby" name="referredby"
|
|
value="<?php echo $Reference_Name; ?>"
|
|
placeholder="Referred By" maxlength="100"
|
|
class="form-control">
|
|
</div>
|
|
<div class="col-md-3" style="display:none">
|
|
<label>Referrer Contact Number</label>
|
|
<input type="text" id="referrercontno" name="referrercontno"
|
|
value="<?php echo $Reference_ContactNumber; ?>"
|
|
onchange="getValidReferNumber();" maxlength="10"
|
|
placeholder="Referrer Contact Number"
|
|
class="form-control"
|
|
onkeypress="return isNumberKey(event)">
|
|
</div>
|
|
|
|
|
|
<div class="col-md-3">
|
|
<label>Work Location</label><span class="badge">*</span>
|
|
<select type="text" id="work_location" name="work_location"
|
|
required class="form-control select2">
|
|
<option value="<?php echo $work_location; ?>">
|
|
<?php echo $work_location; ?>
|
|
</option>
|
|
<?php foreach ($Location as $rl): ?>
|
|
<?php $rl1 = $rl->ConfigValue; ?>
|
|
<?php if (trim($rl1) != trim($work_location)): ?>
|
|
<?php if (isset($_POST['work_location']) && $_POST['work_location'] == $rl1): ?>
|
|
<option value="<?= esc($rl1) ?>" selected="selected">
|
|
<?= esc($rl->ConfigValue) ?>
|
|
</option>
|
|
<?php else: ?>
|
|
<option value="<?= esc($rl1) ?>">
|
|
<?= esc($rl->ConfigValue) ?>
|
|
</option>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3" style="margin-top: 36px;">
|
|
<div class="form-group">
|
|
|
|
<label class="switch">
|
|
<input type="checkbox" name="is_management_team"
|
|
value="<?= $is_management_team; ?>" <?php echo $is_management_team == '1' ? 'checked' : ''; ?>
|
|
onchange="updateSwitchValue(this)" />
|
|
<span class="slider"></span>
|
|
</label>
|
|
|
|
<label
|
|
style="display: inline-block; vertical-align: bottom; margin-right: 10px; margin-bottom: 10px;">
|
|
Management
|
|
Team</label>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3" style="margin-top: 36px;">
|
|
<div class="form-group">
|
|
|
|
<label class="switch">
|
|
<input type="checkbox" name="is_driver"
|
|
value="<?= $is_driver; ?>" <?php echo $is_driver == '1' ? 'checked' : ''; ?>
|
|
onchange="updateSwitchValue(this);driverCheck(this);" />
|
|
<span class="slider"></span>
|
|
</label>
|
|
<label
|
|
style="display: inline-block; vertical-align: bottom; margin-right: 10px; margin-bottom: 10px;">Driver
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<br>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<!-- end row -->
|
|
</form>
|
|
<ul class="list-inline wizard mb-0">
|
|
<li class="previous list-inline-item"><a href="javascript: void(0);"
|
|
class="btn btn-secondary">Previous</a>
|
|
</li>
|
|
<li class="next list-inline-item float-right"><a href="javascript: void(0);"
|
|
class="btn btn-secondary">Next</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="third">
|
|
<form id="bankForm" method="post" action="#" class="form-horizontal">
|
|
|
|
<div class="row mb-2">
|
|
<div class="col-md-1">
|
|
</div>
|
|
<div class="col-md-11">
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<label>Bank Name<span class="badge">*</span></label>
|
|
<input type="text" id="bankbranchname" name="bankbranchname"
|
|
class="form-control"
|
|
value="<?php echo $BankBranchName; ?>" required>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Account Number<span class="badge">*</span></label>
|
|
<input type="text" id="accountno" maxlength="20"
|
|
name="accountno" placeholder="Account Number"
|
|
class="form-control"
|
|
value="<?php echo $BankAccountNo; ?>"
|
|
onkeypress="return isNumberKey(event)" required>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>IFSC Code<span class="badge">*</span></label>
|
|
<input type="text" id="ifsccode" name="ifsccode" onkeyup="convertToUpperCase()"
|
|
placeholder="IFSC Code" class="form-control"
|
|
value="<?php echo $IFSCCode; ?>" required>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Bank Address</label>
|
|
<input type="text" id="bankaddress" name="bankaddress"
|
|
placeholder="Bank Address" class="form-control"
|
|
value="<?php echo $BankAddress; ?>">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- end col -->
|
|
</div>
|
|
|
|
<div class="row" style="margin-bottom:0px;">
|
|
<div class="col-md-1">
|
|
</div>
|
|
<div class="col-md-11">
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<label for="Basic_Pay">Total Salary</label>
|
|
<font color="Red">*</font>
|
|
|
|
<input type="text" name="Total_salary" id="Total_salary"
|
|
value="<?php echo $empPay->TotalSalary; ?>"
|
|
pattern="([0-9]{1,8}([.][0-9]{1,2})?)"
|
|
class="form-control num"
|
|
style="text-transform:uppercase;"
|
|
title="Enter Valid Total salary Amount, Minimum Four Digit Positive Number"
|
|
onchange="calculalteHRA();" />
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<label for="Basic_Pay">Basic Pay</label>
|
|
<font color="Red">*</font>
|
|
<input type="text" name="Basic_Pay" id="Basic_Pay"
|
|
value="<?php echo $empPay->Basic_Pay; ?>"
|
|
pattern="[0-9]{4,6}" class="form-control num"
|
|
style="text-transform:uppercase;"
|
|
title="Enter Valid Basic Pay Amount, Minimum Four Digit Positive Number"
|
|
readonly />
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<label for="HRA_Rate">HRA Rate(%)</label>
|
|
<font color="Red">*</font>
|
|
|
|
<input type="text" name="HRA_Rate" id="HRA_Rate"
|
|
value="<?php echo $empPay->HRA_Rate; ?>"
|
|
class="form-control num"
|
|
style="text-transform:uppercase;"
|
|
pattern="([0-9]{1,2}([.][0-9]{1,2})?)"
|
|
title="Enter the Valid HRA Rate, Minimum 1 digit, Maximum 2 digit"
|
|
readonly />
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<label for="HRA_Rate">HRA Amount</label>
|
|
<font color="Red">*</font>
|
|
<input type="text" name="HRA_Amount" id="HRA_Amount"
|
|
class="form-control num"
|
|
value="<?php echo $empPay->HRA_Amount; ?>"
|
|
style="text-transform:uppercase;" readonly />
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row" style="margin-bottom:0px;">
|
|
<div class="col-md-1">
|
|
|
|
</div>
|
|
<div class="col-md-11">
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<label>UAN</label>
|
|
<input type="text" id="pfno" name="pfno" maxlength="22"
|
|
value="<?php echo $pfno; ?>"
|
|
onchange="validatePF();" class="form-control"
|
|
style="text-transform:uppercase" pattern="\d{12}"
|
|
title="12 Digit number"
|
|
onkeypress="return alpha(event);">
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<label for="PF_Rate">PF Rate(%)</label>
|
|
<font color="Red">*</font>
|
|
<input type="text" name="PF_Rate"
|
|
value="<?php echo $empPay->PF_Rate; ?>"
|
|
class="form-control num"
|
|
style="text-transform:uppercase;"
|
|
pattern="([0-9]{1,2}([.][0-9]{1,2})?)"
|
|
title="Enter the valid PF Rate, Minimum 1 digit, Maximum 2 digits"
|
|
readonly />
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<label>ESI Number</label>
|
|
<input type="text" id="esino" name="esino"
|
|
maxlength="10" onchange="validateESI();"
|
|
class="form-control" title=" 10 digit number"
|
|
value="<?php echo $esino; ?>"
|
|
onkeypress="return isNumberKey(event)">
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<label for="ESI_Rate">ESI Rate(%)</label>
|
|
<font color="Red">*</font>
|
|
<input type="text" name="ESI_Rate"
|
|
value="<?php echo $empPay->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>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row" style="margin-bottom:0px;">
|
|
<div class="col-md-1"></div>
|
|
<div class="col-md-11">
|
|
<div class="row">
|
|
|
|
<div class="col-md-3">
|
|
|
|
<div class="form-group">
|
|
<label for="PF_Rate">TDS Rate(%)</label>
|
|
|
|
<input type="text" name="TDS_Rate"
|
|
value="<?php echo $TDS_Rate; ?>"
|
|
class="form-control num"
|
|
title="Enter the valid TDS Rate, Minimum 1 digit"
|
|
readonly />
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<label class="switch">
|
|
<input type="checkbox" name="tds_applicable"
|
|
value="<?= $tds_applicable; ?>" <?php echo $tds_applicable == '1' ? 'checked' : ''; ?>
|
|
onchange="updateSwitchValue(this)" />
|
|
<span class="slider"></span>
|
|
</label>
|
|
|
|
<label class="mt-4">TDS
|
|
Applicable</label>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<label class="switch">
|
|
<input type="checkbox" name="esi_applicable"
|
|
value="<?= $esi_applicable; ?>" <?php echo $esi_applicable == '1' ? 'checked' : ''; ?>
|
|
onchange="updateSwitchValue(this)" />
|
|
<span class="slider"></span>
|
|
</label>
|
|
|
|
<label class="mt-4">ESI
|
|
Applicable</label>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<label class="switch">
|
|
<input type="checkbox" name="pf_applicable"
|
|
value="<?= $pf_applicable; ?>" <?php echo $pf_applicable == '1' ? 'checked' : ''; ?>
|
|
onchange="updateSwitchValue(this)" />
|
|
<span class="slider"></span>
|
|
</label>
|
|
|
|
<label class="mt-4">PF
|
|
Applicable</label>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- end row -->
|
|
</form>
|
|
<ul class="list-inline wizard mb-0">
|
|
<li class="previous list-inline-item"><a href="javascript: void(0);"
|
|
class="btn btn-secondary">Previous</a>
|
|
</li>
|
|
<li class="next list-inline-item float-right"><a href="javascript: void(0);"
|
|
class="btn btn-secondary">Next</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="fourth">
|
|
<form id="proofForm" method="post" enctype="multipart/form-data" action="#"
|
|
class="form-horizontal">
|
|
<div class="row">
|
|
<div class="col-md-1">
|
|
</div>
|
|
<div class="col-md-11">
|
|
<?php if (count($emp_data) > 0) {
|
|
|
|
$aadharFileName = '';
|
|
$panFileName = '';
|
|
$passportFileName = '';
|
|
$bankPassBookFileName = '';
|
|
$otherDocumentFileName = '';
|
|
$aadharFile = '';
|
|
$panFile = '';
|
|
$passportFile = '';
|
|
$bankPassBookFile = '';
|
|
$otherDocumentFile = '';
|
|
|
|
foreach ($emp_data as $emp_proofFile) {
|
|
|
|
if ($emp_proofFile['file_name'] == 'Aadhar') {
|
|
$aadharFileName = $emp_proofFile['file_name'];
|
|
$aadharFile = $emp_proofFile['emp_file'];
|
|
|
|
} elseif ($emp_proofFile['file_name'] == 'PAN') {
|
|
$panFileName = $emp_proofFile['file_name'];
|
|
$panFile = $emp_proofFile['emp_file'];
|
|
} elseif ($emp_proofFile['file_name'] == 'Passport') {
|
|
$passportFileName = $emp_proofFile['file_name'];
|
|
$passportFile = $emp_proofFile['emp_file'];
|
|
} elseif ($emp_proofFile['file_name'] == 'Bank Passbook') {
|
|
$bankPassBookFileName = $emp_proofFile['file_name'];
|
|
$bankPassBookFile = $emp_proofFile['emp_file'];
|
|
} else {
|
|
$otherDocumentFileName = $emp_proofFile['file_name'];
|
|
$otherDocumentFile = $emp_proofFile['emp_file'];
|
|
}
|
|
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<!-- previous code -->
|
|
<!-- <div class="row">
|
|
<div class="col-md-4">
|
|
|
|
<label>File Name</label>
|
|
<input type="text" maxlength="255" class="form-control"
|
|
value="" readonly>
|
|
|
|
|
|
|
|
</div>
|
|
<div class="col-md-1" style="margin-top: 32px;">
|
|
<a href=""
|
|
download>
|
|
<i class="fa fa-download" aria-hidden="true"
|
|
style="font-size: 25px;"></i>
|
|
</a>
|
|
</div>
|
|
<div class="col-md-4" align="left" style="margin-top: 32px;">
|
|
<button type="button" class="btn btn-danger btn-sm"
|
|
id=""
|
|
onclick="removeContact(this)">Delete
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div> -->
|
|
|
|
<!-- new code -->
|
|
<div class="row">
|
|
<div class="col-md-4"><label>Aadhar Number</label> <span
|
|
class="badge">*</span>
|
|
<input type="text" id="aadharno" name="aadharno"
|
|
maxlength="14" onchange="ValidateAadhar();"
|
|
class="form-control"
|
|
onkeypress="return isNumberKey(event)" required
|
|
value="<?= $AadharNo ?>">
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<label>Aadhar File Name</label>
|
|
<input type="text" id="file_name" name="file_name1"
|
|
maxlength="255" class="form-control" value="Aadhar"
|
|
readonly>
|
|
</div>
|
|
<?php
|
|
if (!empty($aadharFile)) { ?>
|
|
<div class="col-md-1">
|
|
<a href="<?php echo base_url() . 'public/uploads/images/emp_files/' . $aadharFile; ?>"
|
|
download>
|
|
<i class="fa fa-download mt-4" aria-hidden="true"
|
|
style="font-size: 25px;"></i>
|
|
</a>
|
|
</div>
|
|
<?php } else { ?>
|
|
<div class="col-md-1"></div>
|
|
<?php } ?>
|
|
|
|
<div class="col-md-4">
|
|
<!-- <label>Update Aadhar File</label> --> <br>
|
|
<input type="file" name="emp_file1" class="" style="padding-top:13px;" value="">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4"><label>PAN Number</label>
|
|
<input type="text" id="panno" maxlength="10"
|
|
style="text-transform:uppercase" name="panno"
|
|
onchange="validatePAN();" class="form-control"
|
|
pattern="([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}"
|
|
title=" 5 character,4 Digit Numbers,1 character (ex:ABCDE1234A) "
|
|
onkeypress="return alpha(event);" value="<?= $PANNo ?>">
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<label>PAN File Name</label>
|
|
<input type="text" id="file_name" name="file_name2"
|
|
maxlength="255" class="form-control" value="PAN"
|
|
readonly>
|
|
</div>
|
|
<?php if (!empty($panFile)) { ?>
|
|
<div class="col-md-1">
|
|
<a href="<?php echo base_url() . 'public/uploads/images/emp_files/' . $panFile; ?>"
|
|
download>
|
|
<i class="fa fa-download mt-4" aria-hidden="true"
|
|
style="font-size: 25px;"></i>
|
|
</a>
|
|
</div>
|
|
<?php } else { ?>
|
|
<div class="col-md-1"></div>
|
|
<?php } ?>
|
|
|
|
<div class="col-md-4">
|
|
<!-- <label>Update PAN File</label> --> <br>
|
|
<input type="file" name="emp_file2" class="" style="padding-top:13px;">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4"><label>Passport Number</label>
|
|
<input type="text" id="passportno" maxlength="9"
|
|
onchange="ValidatePassport();" name="passportno"
|
|
style="text-transform:uppercase" class="form-control"
|
|
title="The first digit or the last digit will never be 0
|
|
(eg:A12 34567)"
|
|
onkeypress="return alpha(event);"
|
|
value="<?= $PassportNo ?>">
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<label>Passport File Name</label>
|
|
<input type="text" id="file_name" name="file_name3"
|
|
maxlength="255" class="form-control" value="Passport"
|
|
readonly>
|
|
</div>
|
|
<?php if (!empty($passportFile)) { ?>
|
|
<div class="col-md-1">
|
|
<a href="<?php echo base_url() . 'public/uploads/images/emp_files/' . $passportFile; ?>"
|
|
download>
|
|
<i class="fa fa-download mt-4" aria-hidden="true"
|
|
style="font-size: 25px;"></i>
|
|
</a>
|
|
</div>
|
|
<?php } else { ?>
|
|
<div class="col-md-1"></div>
|
|
<?php } ?>
|
|
|
|
<div class="col-md-4">
|
|
<!-- <label>Update Passport File</label> --> <br>
|
|
<input type="file" name="emp_file3" class="" style="padding-top:13px;">
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-4"></div>
|
|
<div class="col-md-3">
|
|
<label>Bank Passbook Name</label>
|
|
<input type="text" id="file_name" name="file_name4"
|
|
maxlength="255" class="form-control"
|
|
value="Bank Passbook" readonly>
|
|
</div>
|
|
<?php if (!empty($bankPassBookFile)) { ?>
|
|
<div class="col-md-1">
|
|
<a href="<?php echo base_url() . 'public/uploads/images/emp_files/' . $bankPassBookFile; ?>"
|
|
download>
|
|
<i class="fa fa-download mt-4" aria-hidden="true"
|
|
style="font-size: 25px;"></i>
|
|
</a>
|
|
</div>
|
|
<?php } else { ?>
|
|
<div class="col-md-1"></div>
|
|
<?php } ?>
|
|
|
|
<div class="col-md-4">
|
|
<!-- <label>Update Bank Passbook File</label> --> <br>
|
|
<input type="file" name="emp_file4" class="" style="padding-top:13px;">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-4"></div>
|
|
<div class="col-md-3">
|
|
<label> Other Document File Name</label>
|
|
<input type="text" id="file_name" name="file_name5"
|
|
maxlength="255" class="form-control"
|
|
value="<?= $otherDocumentFileName ?>">
|
|
</div>
|
|
<?php if (!empty($otherDocumentFile)) { ?>
|
|
<div class="col-md-1">
|
|
<a href="<?php echo base_url() . 'public/uploads/images/emp_files/' . $otherDocumentFile; ?>"
|
|
download>
|
|
<i class="fa fa-download mt-4" aria-hidden="true"
|
|
style="font-size: 25px;"></i>
|
|
</a>
|
|
</div>
|
|
<?php } else { ?>
|
|
<div class="col-md-1"></div>
|
|
<?php } ?>
|
|
|
|
<div class="col-md-4">
|
|
<!-- <label>Update Other Document File </label> --> <br>
|
|
<input type="file" name="emp_file5" class="" style="padding-top:13px;">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<?php } else { ?>
|
|
|
|
<div class="row">
|
|
<div class="col-md-4"><label>Aadhar Number</label> <span
|
|
class="badge">*</span>
|
|
<input type="text" id="aadharno" name="aadharno"
|
|
maxlength="14" onchange="ValidateAadhar();"
|
|
class="form-control"
|
|
onkeypress="return isNumberKey(event)" required
|
|
value="<?= $AadharNo ?>">
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label>Aadhar File Name</label>
|
|
<input type="text" id="file_name" name="file_name1"
|
|
maxlength="255" class="form-control" value="Aadhar">
|
|
</div>
|
|
<div class="col-md-4">
|
|
<!-- <label>Select Aadhar File</label> -->
|
|
<input type="file" name="emp_file1" class="" style="padding-top:13px;">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4"><label>PAN Number</label>
|
|
<input type="text" id="panno" maxlength="10"
|
|
style="text-transform:uppercase" name="panno"
|
|
onchange="validatePAN();" class="form-control"
|
|
pattern="([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}"
|
|
title=" 5 character,4 Digit Numbers,1 character (ex:ABCDE1234A) "
|
|
onkeypress="return alpha(event);"
|
|
value="<?= $PANNo ?>" >
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label>PAN File Name</label>
|
|
<input type="text" id="file_name" name="file_name2"
|
|
maxlength="255" class="form-control" value="PAN">
|
|
</div>
|
|
<div class="col-md-4">
|
|
<!-- <label>Select PAN File</label> -->
|
|
<input type="file" name="emp_file2" class="" style="padding-top:13px;">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4"><label>Passport Number</label>
|
|
<input type="text" id="passportno" maxlength="9"
|
|
name="passportno" style="text-transform:uppercase"
|
|
value="<?= $PassportNo ?>"
|
|
class="form-control"
|
|
pattern="^[A-Z][1-9]\d\s?\d{4}[1-9]$"
|
|
title="
|
|
The first character must be an uppercase alphabet.
|
|
The next two characters should be numbers,
|
|
with the first character ranging from 1 to 9 and the second character from 0 to 9.
|
|
It may include zero or one white space character.
|
|
The subsequent four characters can be any number from 0 to 9.
|
|
The last character should be any number from 1 to 9.">
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label>Passport File Name</label>
|
|
<input type="text" id="file_name" name="file_name3"
|
|
maxlength="255" class="form-control" value="Passport">
|
|
</div>
|
|
<div class="col-md-4">
|
|
<!-- <label>Select Passport File</label> -->
|
|
<input type="file" name="emp_file3" class="" style="padding-top:13px;">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-4"></div>
|
|
<div class="col-md-4">
|
|
<label>Bank Passbook Name</label>
|
|
<input type="text" id="file_name" name="file_name4"
|
|
maxlength="255" class="form-control"
|
|
value="Bank Passbook">
|
|
</div>
|
|
<div class="col-md-4">
|
|
<!-- <label>Bank Passbook File</label> -->
|
|
<input type="file" name="emp_file4" class="" style="padding-top:13px;">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-4"></div>
|
|
<div class="col-md-4">
|
|
<label>Other Document File Name</label>
|
|
<input type="text" id="file_name" name="file_name5"
|
|
maxlength="255" class="form-control"
|
|
value="Other Document">
|
|
</div>
|
|
<div class="col-md-4">
|
|
<!-- <label>Other Document File </label> -->
|
|
<input type="file" name="emp_file5" class="" style="padding-top:13px;">
|
|
</div>
|
|
</div>
|
|
|
|
<?php } ?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</form>
|
|
<ul class="list-inline wizard mb-0">
|
|
<li class="previous list-inline-item"><a href="javascript: void(0);"
|
|
class="btn btn-secondary">Previous</a>
|
|
</li>
|
|
<li class="next list-inline-item float-right">
|
|
<button type="submit"
|
|
class="btn btn-primary submit float-right">Submit</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div> <!-- tab-content -->
|
|
</div> <!-- end #rootwizard-->
|
|
</div> <!-- end card-body -->
|
|
</div> <!-- end card-->
|
|
</div> <!-- end col -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function readURL(input) {
|
|
if (input.files && input.files[0]) {
|
|
var reader = new FileReader();
|
|
|
|
reader.onload = function (e) {
|
|
$('#profilepicture')
|
|
.attr('src', e.target.result)
|
|
.width(166)
|
|
.height(166);
|
|
};
|
|
|
|
reader.readAsDataURL(input.files[0]);
|
|
$('#ModifyImage').val(input.files[0]['name']);
|
|
|
|
}
|
|
}
|
|
|
|
$(function () {
|
|
$('#checksame').click(function () {
|
|
if ($('#checksame').prop('checked')) {
|
|
|
|
$('#permanentaddress').val($('#currentaddress').val());
|
|
|
|
} else {
|
|
$('#permanentaddress').val('');
|
|
}
|
|
|
|
});
|
|
$("#currentaddress, #permanentaddress").on("keyup change", function () {
|
|
if ($("#currentaddress").val().trim() === $("#permanentaddress").val().trim()) {
|
|
$("#checksame").prop("disabled", false);
|
|
$("#checksame").prop("checked", true);
|
|
} else {
|
|
$("#checksame").prop("disabled", true);
|
|
$("#checksame").prop("checked", false);
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
function isNumberKey(evt) {
|
|
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
|
if (charCode != 46 && charCode != 32 && charCode >= 33 &&
|
|
(charCode < 48 || charCode > 57))
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
function alpha(e) {
|
|
var k;
|
|
document.all ? k = e.keyCode : k = e.which;
|
|
return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8 || k == 32 || (k >= 48 && k <= 57));
|
|
}
|
|
|
|
//PAN Validate
|
|
//PAN Validate
|
|
function validatePAN() {
|
|
//var reg = /(?=.*[A-Za-z]).{5,}(?=.*[0-9]).{4,}(?=.*[A-Za-z]).{1,}$/;
|
|
var regpan = /^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$/;
|
|
|
|
var PAN = $('#panno').val().trim();
|
|
|
|
if (PAN != '') {
|
|
if (regpan.test(PAN) == false) {
|
|
alert('Please Enter Valid PAN Number');
|
|
return (false);
|
|
} else {
|
|
return true;
|
|
}
|
|
} else {
|
|
alert('Please Enter PAN Number');
|
|
return (false);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function ValidateAadhar() {
|
|
//alert('validation entered');
|
|
var reg = /^\d{4}\s\d{4}\s\d{4}$/
|
|
var aadhar = $('#aadharno').val().trim();
|
|
var aadhar_count = $('#aadharno').val().length;
|
|
|
|
if (aadhar != '') // && aadhar_count != '')
|
|
{
|
|
|
|
if (reg.test(aadhar) == false) {
|
|
//alert('alskdjsakjf');
|
|
alert('Please Enter Valid Aadhar Number');
|
|
return (false);
|
|
} else {
|
|
//alert('value inserted into database');
|
|
return true;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function validateDriverLicense() {
|
|
|
|
|
|
var reg = /^[a-zA-Z]{2}[0-9]{2}\s[0-9]{11}$/;
|
|
// alert();
|
|
var VehicleNo = $('#Driverlicense').val();
|
|
if (VehicleNo != "") {
|
|
if (reg.test(VehicleNo) == false) {
|
|
alert('Please Enter Valid Driver License Number');
|
|
return (false);
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function Validate() {
|
|
if ($("#FirstName").val().length < 1) {
|
|
alert('Please Enter FirstName');
|
|
return;
|
|
}
|
|
if ($("#LastName").val().length < 1) {
|
|
alert('Please Enter LastName');
|
|
return;
|
|
}
|
|
if ($("#FatherName").val().length < 1) {
|
|
alert('Please Enter FatherName');
|
|
return;
|
|
}
|
|
if ($("#DateofBirth").val().length < 1) {
|
|
alert('Please Enter Date of Birth');
|
|
return;
|
|
}
|
|
if ($('#ContactNumber').val().length < 1) {
|
|
alert('Please Enter Contact Number');
|
|
return;
|
|
} else if (!getMobileValidation()) {
|
|
return;
|
|
}
|
|
|
|
|
|
// if($("#email").val().length < 1)
|
|
// {
|
|
// alert('Please Enter Personal Email ID');
|
|
// return false;
|
|
// }
|
|
// else if(!validateEmail())
|
|
// {
|
|
// return;
|
|
// }
|
|
// if($("#mail").val().length < 1)
|
|
// {
|
|
// alert('Please Enter Company Email ID');
|
|
// return false;
|
|
// }
|
|
// else if(!validatecomEmail())
|
|
// {
|
|
// return;
|
|
// }
|
|
|
|
|
|
if ($("option:selected", $("#gender")).val() == '-1') {
|
|
alert('Please Select Gender');
|
|
$('#gender').focus();
|
|
return;
|
|
}
|
|
|
|
if ($("option:selected", $("#MartialStatus")).val() == "-1") {
|
|
alert('Please Select Martial Status');
|
|
$('#MartialStatus').focus();
|
|
return;
|
|
}
|
|
|
|
|
|
if ($("#currentaddress").val().length < 1) {
|
|
alert('Please Enter Current Address');
|
|
return;
|
|
}
|
|
if ($("#permanentaddress").val().length < 1) {
|
|
alert('Please Enter Permanent Address');
|
|
return;
|
|
}
|
|
if ($("#emergencycontactname").val().length < 1) {
|
|
alert('Please Enter Emergency Contact Name');
|
|
return;
|
|
}
|
|
if ($("#emergencycontactnumber").val().length < 1) {
|
|
alert('Please Enter Emergency Contact Number');
|
|
return;
|
|
} else if (!getValidEmergencyNumber()) {
|
|
return;
|
|
}
|
|
|
|
|
|
if ($("#referrercontno").val().length > 0) {
|
|
getValidReferNumber();
|
|
}
|
|
|
|
if ($("#passportno").val().length > 1) {
|
|
ValidatePassport();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function getMobileValidation() {
|
|
var contactNumber = $('#ContactNumber').val().length;
|
|
if (contactNumber < 10) {
|
|
alert('Please Enter valid Contact Number');
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
function getValidEmergencyNumber() {
|
|
var contactNumber = $('#emergencycontactnumber').val().length;
|
|
if (contactNumber < 10) {
|
|
alert('Please Enter valid Emergency Contact Number');
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
function getValidReferNumber() {
|
|
var contactNumber = $('#referrercontno').val().length;
|
|
if (contactNumber > 0 && contactNumber < 10) {
|
|
alert('Please Enter valid Refernce Contact Number');
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
function validateEmail() {
|
|
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
|
|
|
var email = $('#email').val();
|
|
|
|
if (email != '') {
|
|
if (reg.test(email) == false) {
|
|
alert('Please Enter Valid Email Address');
|
|
return (false);
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function validatecomEmail() {
|
|
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
|
|
|
var email = $('#mail').val();
|
|
|
|
if (email != '') {
|
|
if (reg.test(email) == false) {
|
|
alert('Please Enter Valid Company Email Address');
|
|
return (false);
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function validateESI() {
|
|
var reg = /(?=.*[0-9]).{10,}$/;
|
|
|
|
var ESI = $('#esino').val();
|
|
|
|
if (ESI != '') {
|
|
if (reg.test(ESI) == false) {
|
|
alert('Please Enter Valid ESI Number');
|
|
return (false);
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function validatePF() {
|
|
var regpf = /^\d{12}$/;
|
|
|
|
var PF = $('#pfno').val();
|
|
|
|
if (PF != '') {
|
|
if (regpf.test(PF) == false) {
|
|
alert('Please Enter Valid UAN');
|
|
return (false);
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function validateUA() {
|
|
var reg = /(?=.*[0-9]).{12,}$/;
|
|
|
|
var UA = $('#uano').val();
|
|
|
|
if (UA != '') {
|
|
if (reg.test(UA) == false) {
|
|
alert('Please Enter Valid UA Number');
|
|
return (false);
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function getAge() {
|
|
|
|
var dateString = $("#DateofBirth").val();
|
|
|
|
var today = new Date();
|
|
|
|
var dd = today.getDate();
|
|
var mm = today.getMonth() + 1;
|
|
var yyyy = today.getFullYear();
|
|
|
|
if (dd < 10) {
|
|
dd = '0' + dd;
|
|
}
|
|
if (mm < 10) {
|
|
mm = '0' + mm;
|
|
}
|
|
|
|
var today = dd + '-' + mm + '-' + yyyy;
|
|
|
|
var ageyear = yyyy - dateString.split("-")[2];
|
|
var agemonth = mm - dateString.split("-")[1];
|
|
var agedate = dateString.split("-")[0];
|
|
|
|
if (agemonth < 0 || (agemonth == 0 && dd < agedate)) {
|
|
ageyear--;
|
|
|
|
}
|
|
|
|
$("#age").val(ageyear);
|
|
|
|
}
|
|
|
|
$(function () {
|
|
var d = new Date();
|
|
|
|
var month = d.getMonth();
|
|
var day = d.getDate();
|
|
var year = d.getFullYear();
|
|
var SIAStartYear = year - 2015;
|
|
var mindt = year - 70;
|
|
var maxdt = year - 15;
|
|
|
|
$("#DateofBirth").datepicker({
|
|
minDate: new Date(mindt, 1, 1),
|
|
maxDate: new Date(maxdt, 1, 1),
|
|
dateFormat: 'dd-mm-yy',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: '-100:+0'
|
|
|
|
|
|
});
|
|
$("#dateofjoining").datepicker({
|
|
minDate: new Date(year - SIAStartYear, 1, 1),
|
|
maxDate: 'now',
|
|
dateFormat: 'dd-mm-yy',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
|
|
|
|
});
|
|
$("#ValidTill").datepicker({
|
|
dateFormat: 'dd-mm-yy',
|
|
minDate: 'now',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: '-0:+100'
|
|
});
|
|
$("#LicenseExpiryDate").datepicker({
|
|
dateFormat: 'dd-mm-yy',
|
|
minDate: 'now',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: '-0:+100'
|
|
});
|
|
|
|
});
|
|
|
|
function resetphoto() {
|
|
|
|
$("#photo").src("");
|
|
}
|
|
|
|
function ValidatePassport() {
|
|
var regsaid = /^[A-Z][1-9]\d\s?\d{4}[1-9]$/;
|
|
|
|
var passport = capitalizeFirstLetter($("#passportno").val().trim());
|
|
|
|
if (regsaid.test(passport) == false) {
|
|
alert('You have entered invalid Passport.');
|
|
alert(`The first character must be an uppercase alphabet. The next two characters should be numbers,with the first character ranging from 1 to 9 and the second character from 0 to 9. It may include zero or one white space character. The subsequent four characters can be any number from 0 to 9. The last character should be any number from 1 to 9."`);
|
|
return (false);
|
|
} else {
|
|
return true;
|
|
}
|
|
|
|
}
|
|
|
|
$(document).ready(function () {
|
|
|
|
var driverChecked = "<?php echo $is_driver; ?>";
|
|
if (driverChecked == "1") {
|
|
$('#Total_salary').prop('required', false);
|
|
$('#Total_salary').prop('readonly', true);
|
|
}
|
|
else{
|
|
$('#Total_salary').prop('required', true);
|
|
$('#Total_salary').prop('readonly', false);
|
|
}
|
|
if ($("#currentaddress").val().trim() === $("#permanentaddress").val().trim()) {
|
|
$("#checksame").prop("disabled", false); // Enable checkbox
|
|
$("#checksame").prop("checked", true); // Optionally check it
|
|
} else {
|
|
$("#checksame").prop("disabled", true); // Disable checkbox
|
|
$("#checksame").prop("checked", false);
|
|
}
|
|
$("#gender").select2();
|
|
$("#MartialStatus").select2();
|
|
$("#desigination").select2();
|
|
$("#departmentname").select2();
|
|
$("#eduqualifaction").select2();
|
|
$("#work_location").select2();
|
|
document.getElementById('aadharno').addEventListener('input', function (e) {
|
|
e.target.value = e.target.value.replace(/[^\d]/g, '').replace(/(.{4})/g, '$1 ').trim();
|
|
});
|
|
});
|
|
|
|
function onlyAlphabets(evt) {
|
|
var charCode;
|
|
if (window.event)
|
|
charCode = window.event.keyCode; //for IE
|
|
else
|
|
charCode = evt.which; //for firefox
|
|
if (charCode == 32) //for <space> symbol
|
|
return true;
|
|
if (charCode > 31 && charCode < 65) //for characters before 'A' in ASCII Table
|
|
return false;
|
|
if (charCode > 90 && charCode < 97) //for characters between 'Z' and 'a' in ASCII Table
|
|
return false;
|
|
if (charCode > 122) //for characters beyond 'z' in ASCII Table
|
|
return false;
|
|
return true;
|
|
}
|
|
</script>
|
|
|
|
|
|
|
|
<script src="<?php echo base_url(); ?>public/assets/js/addUser.js" type="text/javascript"></script>
|
|
<script>
|
|
function updateSwitchValue(checkbox) {
|
|
checkbox.value = checkbox.checked ? "1" : "0";
|
|
}
|
|
function driverCheck(driver) {
|
|
if (driver.checked) {
|
|
$('#Total_salary').prop('required', false);
|
|
$('#Total_salary').prop('readonly', true);
|
|
} else {
|
|
$('#Total_salary').prop('required', true);
|
|
$('#Total_salary').prop('readonly', false);
|
|
}
|
|
}
|
|
function handleCheckboxChange() {
|
|
let checkbox = document.getElementById("isactive");
|
|
let reasonContainer = document.getElementById("reasonContainer");
|
|
let reasonTextarea = document.getElementById("reason");
|
|
reasonTextarea.value = "";
|
|
reasonContainer.style.display = "inline-block";
|
|
reasonTextarea.style.display = "inline-block";
|
|
reasonTextarea.setAttribute("required", "true");
|
|
reasonTextarea.focus(); // Auto-focus
|
|
|
|
alert("please Enter the reason!");
|
|
|
|
|
|
|
|
|
|
// alert("please Enter the reason!");
|
|
// document.getElementById('reason').focus();
|
|
// reasonInput.setAttribute("required", "true");
|
|
// reasonInput.focus();
|
|
// if (checkbox.checked) {
|
|
// alert("called");
|
|
// } else {
|
|
// alert("called2");
|
|
// }
|
|
}
|
|
|
|
function calculalteHRA() {
|
|
//var empid=document.getElementById('emp').value;
|
|
//alert(empid);
|
|
var Totalsalary = document.getElementById('Total_salary').value;
|
|
var HRA = document.getElementById('HRA_Rate').value;
|
|
//if(EmpID == -1){alert("Select Employee ID..!");}
|
|
if (HRA == '') {
|
|
alert("Please Enter HRA RATE..");
|
|
document.getElementById('HRA_Rate').focus();
|
|
} else if (Totalsalary == '') {
|
|
alert("Please Enter Total Salary..");
|
|
document.getElementById('total_salary').focus();
|
|
} else {
|
|
var temp = (Totalsalary * (HRA / 100));
|
|
var basic = Totalsalary - temp;
|
|
document.getElementById('Basic_Pay').value = basic;
|
|
document.getElementById('HRA_Amount').value = temp;
|
|
}
|
|
|
|
deductionCalculation();
|
|
}
|
|
|
|
function deductionCalculation()
|
|
{
|
|
const salaryField = document.getElementById("Total_salary");
|
|
const esiCheckbox = document.getElementsByName("esi_applicable")[0];
|
|
const pfCheckbox = document.getElementsByName("pf_applicable")[0];
|
|
const tdsCheckbox = document.getElementsByName("tds_applicable")[0];
|
|
|
|
const salary = parseFloat(salaryField.value);
|
|
|
|
if (!isNaN(salary)) {
|
|
// ESI Checkbox: Check and set value
|
|
if (salary < 21000) {
|
|
esiCheckbox.checked = true;
|
|
esiCheckbox.value = "1";
|
|
} else {
|
|
esiCheckbox.checked = false;
|
|
esiCheckbox.value = "0";
|
|
}
|
|
|
|
// PF Checkbox: Check and set value
|
|
if (salary > 15000) {
|
|
pfCheckbox.checked = true;
|
|
pfCheckbox.value = "1";
|
|
} else {
|
|
pfCheckbox.checked = false;
|
|
pfCheckbox.value = "0";
|
|
}
|
|
|
|
// TDS Checkbox: Check and set value
|
|
if (salary * 12 > 730000) {
|
|
tdsCheckbox.checked = true;
|
|
tdsCheckbox.value = "1";
|
|
} else {
|
|
tdsCheckbox.checked = false;
|
|
tdsCheckbox.value = "0";
|
|
}
|
|
}
|
|
}
|
|
|
|
function removeContact(button) {
|
|
if (button.id != '') {
|
|
$('#loader').show();
|
|
$.ajax({
|
|
data: {
|
|
id: button.id
|
|
},
|
|
type: "POST",
|
|
url: "<?php echo base_url(); ?>deleteEmployeeFile",
|
|
success: function (data) {
|
|
$('#loader').hide();
|
|
if (data) {
|
|
alert("File removed");
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
});
|
|
}
|
|
$(button).closest('.pad').remove();
|
|
$('#filesContainer .a1').hide();
|
|
$('#filesContainer .pad:last .a1').show();
|
|
var len = $('#filesContainer .pad:last .a1')
|
|
var length = len.length;
|
|
if (length == 0) {
|
|
$('#day').show()
|
|
} else {
|
|
$('#day').hide()
|
|
}
|
|
}
|
|
|
|
|
|
$("#email").change(function () {
|
|
|
|
var emailId = $('#email').val();
|
|
if (validateEmail() && emailId != "<?= $EmailId ?>") {
|
|
$('#loader').show();
|
|
|
|
$.ajax({
|
|
data: {
|
|
emailId
|
|
},
|
|
|
|
type: "POST",
|
|
url: "<?php echo base_url(); ?>employeeEmailExist",
|
|
success: function (response) {
|
|
$('#loader').hide(); // Hide the loader after a successful response
|
|
|
|
let responseCheck = response.data[0];
|
|
let responseEmail = response.data[0].EmailId;
|
|
|
|
if (responseCheck) {
|
|
if (responseEmail == emailId) {
|
|
alert(
|
|
"Another Employee already exists !!.Please Change the mail id");
|
|
$("#email").val('');
|
|
$("#email").focus();
|
|
return false;
|
|
|
|
}
|
|
}
|
|
|
|
},
|
|
complete: function () {
|
|
$('#loader').hide(); // Ensure the loader is always hidden after the request completes
|
|
}
|
|
});
|
|
}
|
|
|
|
});
|
|
$('#ContactNumber').change(function() {
|
|
|
|
var ContactNumber = $('#ContactNumber').val();
|
|
|
|
if (getMobileValidation() && ContactNumber != "<?= $ContactNumber ?>") {
|
|
$('#loader').show();
|
|
$.ajax({
|
|
data: {
|
|
ContactNumber
|
|
},
|
|
|
|
type: "POST",
|
|
url: "<?php echo base_url(); ?>employeeMobileExist",
|
|
success: function(response) {
|
|
$('#loader').hide();
|
|
|
|
let responseCheck = response.data[0];
|
|
let responseContactNumber=response.data[0].ContactNumber;
|
|
|
|
if(responseCheck ){
|
|
if (responseContactNumber == ContactNumber) {
|
|
|
|
var answer = confirm(" Contact Number details is already exists !!.Kindly Provide us another Contact Number"
|
|
)
|
|
|
|
$('#ContactNumber').val('');
|
|
$('#ContactNumber').focus();
|
|
return false;
|
|
|
|
}
|
|
}
|
|
|
|
},
|
|
complete: function() {
|
|
$('#loader').hide(); // Ensure the loader is always hidden after the request completes
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
$('#panno').change(function () {
|
|
|
|
var panNo = $('#panno').val();
|
|
if (validatePAN() && panNo != "<?= $PANNo ?>") {
|
|
$('#loader').show();
|
|
$.ajax({
|
|
data: {
|
|
panNo
|
|
},
|
|
|
|
type: "POST",
|
|
url: "<?php echo base_url(); ?>employeePANExist",
|
|
success: function (response) {
|
|
$('#loader').hide();
|
|
|
|
let responseCheck = response.data[0];
|
|
let responsePanNo = response.data[0].PANNo;
|
|
|
|
if (responseCheck) {
|
|
if (responsePanNo == panNo) {
|
|
alert(
|
|
" Employee with this pan number already exists in the database.Please Change the Pan Card Number"
|
|
);
|
|
$('#panno').val('');
|
|
$('#panno').focus();
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
,
|
|
complete: function () {
|
|
$('#loader').hide(); // Ensure the loader is always hidden after the request completes
|
|
}
|
|
});
|
|
}
|
|
|
|
});
|
|
$('#aadharno').change(function () {
|
|
|
|
var aadharNo = $('#aadharno').val();
|
|
if (ValidateAadhar() && aadharNo != "<?= $AadharNo ?>") {
|
|
$('#loader').show();
|
|
$.ajax({
|
|
data: {
|
|
aadharNo
|
|
},
|
|
type: "POST",
|
|
url: "<?php echo base_url(); ?>employeecheckAadharNoExist",
|
|
success: function (response) {
|
|
$('#loader').hide();
|
|
|
|
|
|
let responseCheck = response.data[0];
|
|
let responseAadharNo = response.data[0].AadharNo;
|
|
|
|
|
|
//let response=response.data[0];
|
|
if (responseCheck) {
|
|
if (responseAadharNo == aadharNo) {
|
|
alert(
|
|
"Another Employee with this aadhar number already exists ..!!.Please Change the Aadhar card Number"
|
|
);
|
|
$('#aadharno').val('');
|
|
$('#aadharno').focus();
|
|
|
|
}
|
|
}
|
|
}
|
|
,
|
|
complete: function () {
|
|
$('#loader').hide(); // Ensure the loader is always hidden after the request completes
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
$('#bankbranchname').change(function () {
|
|
|
|
var bank = $('#bankbranchname').val();
|
|
|
|
if (bank != '-1') {
|
|
|
|
var y = <?php echo json_encode($bankdetails, JSON_PRETTY_PRINT) ?>;
|
|
|
|
$.each(y, function (idx, obj) {
|
|
|
|
if (bank == obj.Bank_name) {
|
|
$("#ifsccode").val(obj.IFSC);
|
|
$("#bankaddress").val(obj.Address);
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
|
|
$(document).ready(function () {
|
|
$('.next').click(function (e) {
|
|
e.preventDefault(); // Prevent default action
|
|
|
|
var isValid = true;
|
|
var $currentTab = $('.tab-pane.active');
|
|
var currentIndex = $('.tab-pane').index($currentTab);
|
|
var $forms = $('.tab-pane form');
|
|
|
|
// Validate all forms before proceeding
|
|
$forms.each(function (index) {
|
|
var $form = $(this);
|
|
if (index <= currentIndex) {
|
|
// Only validate forms up to the current tab
|
|
if (!$form[0].checkValidity()) {
|
|
isValid = false;
|
|
// Show validation errors
|
|
$form.find(':submit').click();
|
|
// Move focus to the invalid form's tab
|
|
var targetTab = $form.closest('.tab-pane').attr('id');
|
|
var $targetNav = $('a[href="#' + targetTab + '"]');
|
|
if ($targetNav.length) {
|
|
$targetNav.tab('show');
|
|
}
|
|
return false; // Break the loop if any form is invalid
|
|
}
|
|
}
|
|
});
|
|
|
|
// if (!isValid) {
|
|
// console.log('Validation failed. Please fill all required fields.');
|
|
// return; // Stop the submission if validation fails
|
|
// }
|
|
|
|
// // Proceed to the next tab
|
|
// var $nextTab = $('.nav-link.active').closest('li').next().find('.nav-link');
|
|
// if ($nextTab.length) {
|
|
// $nextTab.tab('show');
|
|
// }
|
|
});
|
|
|
|
$('.submit').click(function (e) {
|
|
e.preventDefault();
|
|
var isValid = true;
|
|
var combinedFormData = new FormData();
|
|
|
|
var formIds = ['#accountForm', '#profileForm', '#bankForm', '#proofForm']; // Add all your form IDs here
|
|
formIds.forEach(function (formId) {
|
|
var $form = $(formId);
|
|
|
|
if (!$form[0].checkValidity()) {
|
|
isValid = false;
|
|
$form.find(':submit').click(); // Trigger the built-in HTML5 validation to show errors
|
|
return false; // Break the loop if any form is invalid
|
|
}
|
|
// 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
|
|
$form.find('input[type="file"]').each(function () {
|
|
var input = $(this);
|
|
$.each(input[0].files, function (i, file) {
|
|
combinedFormData.append(input.attr('name'), file);
|
|
});
|
|
});
|
|
});
|
|
if (!isValid) {
|
|
console.log('Validation failed. Please fill all required fields.');
|
|
return; // Stop the submission if validation fails
|
|
}
|
|
console.log('Form Data Prepared:', combinedFormData); // Log for debugging
|
|
|
|
// Send the combined data via AJAX
|
|
$('#loader').show();
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: '<?php echo base_url() ?>employeedetails/UpdateEmployee?empId=<?= $EmpID ?>',
|
|
data: combinedFormData,
|
|
processData: false, // Prevent jQuery from processing the data
|
|
contentType: false, // Prevent jQuery from setting the content type
|
|
success: function (response) {
|
|
$('#loader').hide();
|
|
if (response == 'true') {
|
|
window.location.href = '<?php echo base_url("employeeListing"); ?>';
|
|
} else {
|
|
alert('Employee details Not Update...');
|
|
}
|
|
},
|
|
error: function (error) {
|
|
$('#loader').hide();
|
|
console.log('Form submission failed:', error);
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
// Function to navigate to the next tab
|
|
function goToNextTab() {
|
|
var $activeTab = $('#rootwizard').find('ul.nav li.nav-item a.active');
|
|
var $nextTab = $activeTab.parent().next().find('a');
|
|
|
|
if ($nextTab.length) {
|
|
$nextTab.trigger('click');
|
|
} else {
|
|
// If there are no more tabs, submit the form
|
|
$('#fileForm').submit();
|
|
}
|
|
}
|
|
|
|
// Handle form submission
|
|
$('#fileForm').on('submit', function (event) {
|
|
event.preventDefault(); // Prevent default form submission
|
|
// Your form submission logic here
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<script>
|
|
function capitalizeFirstFourLetters(value) {
|
|
if (!value) return ""; // Handle empty or undefined strings
|
|
return (
|
|
value.slice(0, 4).toUpperCase() + // Capitalize the first four letters
|
|
value.slice(4).toLowerCase() // Lowercase the rest of the string
|
|
);
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script>
|
|
function convertToUpperCase() {
|
|
const input = document.getElementById("ifsccode");
|
|
input.value = input.value.toUpperCase();
|
|
}
|
|
|
|
</script>
|