add and edit page for Employee details
This commit is contained in:
parent
d3451b3f81
commit
87e40e7573
@ -170,6 +170,7 @@ class employeedetails extends BaseController
|
||||
|
||||
$this->form_validation->set_rules('ContactNumber', 'ContactNumber', 'trim|required|min_length[10]|max_length[10]');
|
||||
$this->form_validation->set_rules('emailid', 'emailid', 'trim|required|valid_email');
|
||||
$this->form_validation->set_rules('comemailid', 'emailid', 'trim|required|valid_email');
|
||||
$this->form_validation->set_rules('gender', 'gender', 'callback_Gender_validate');
|
||||
$this->form_validation->set_rules('MartialStatus', 'MartialStatus', 'callback_Martial_validate');
|
||||
|
||||
@ -203,6 +204,7 @@ class employeedetails extends BaseController
|
||||
$DateofBirth = $this->input->post('DateofBirth');
|
||||
$ContactNumber = $this->input->post('ContactNumber');
|
||||
$EmailId = $this->input->post('emailid');
|
||||
$comEmailId = $this->input->post('comemailid');
|
||||
$Gender = $this->input->post('gender');
|
||||
$MartialStatus = $this->input->post('MartialStatus');
|
||||
|
||||
@ -229,7 +231,11 @@ class employeedetails extends BaseController
|
||||
$ValidTill = $this->input->post('ValidTill');
|
||||
$addinfo = $this->input->post('addinfo');
|
||||
$IsActive = '1';
|
||||
$driverlicense = $this->input->post ( 'driverlicense' );
|
||||
$licenseExpiryDate = $this->input->post ( 'licenseExpiryDate' );
|
||||
$VoterID = $this->input->post ( 'voterID' );
|
||||
$createdby = $this->session->userdata ( 'userId' );
|
||||
$licenseExpiryDate = $this->getDateformat($licenseExpiryDate);
|
||||
|
||||
|
||||
$DOB = $this->getDateformat($DateofBirth);
|
||||
@ -244,8 +250,8 @@ class employeedetails extends BaseController
|
||||
}
|
||||
|
||||
//echo $DOB;
|
||||
$Employee = array('FirstName'=>$FirstName, 'LastName'=>$LastName,'FatherName'=>$FatherName,'Gender'=>$Gender,'DateofBirth'=>$DOB,'ContactNumber'=>$ContactNumber,'EmailId'=>$EmailId,'BloodGroup'=>$BloodGroup,'MartialStatus'=>$MartialStatus,'DateofJoining'=>$DOJ,'PreviousYearsOfExp'=>$Previousexperience,'Designation'=>$desigination,'Departmentcode'=>$departmentCode,'PresentAddress'=>$CurrentAddress,'PermanentAddress'=>$permanentaddress,'EmergencyContactName'=>$emergencycontactname,'EmergencyContactNumber'=>$emergencycontactnumber,'Edu_Qualification'=>$eduqualifaction,'Additional_Qualification'=>$addqualification,'AadharNo'=>$aadharno,'PANNo'=>$panno,'BankAccountNo'=>$accountno,'IFSCCode'=>$ifsccode,'BankBranchName'=>$bankbranchname,'BankAddress'=>$bankaddress,'PassportNo'=>$passportno,'Passport_Valid_till'=>$Valid,'IsActive'=>$IsActive,'ProfilePic'=>$Picture,'Reference_Name'=>$referredby,'Reference_ContactNumber'=>$referrercontno,'Remarks'=>$addinfo,'CreatedBy'=>$createdby);
|
||||
|
||||
$Employee = array('FirstName'=>$FirstName, 'LastName'=>$LastName,'FatherName'=>$FatherName,'Gender'=>$Gender,'DateofBirth'=>$DOB,'ContactNumber'=>$ContactNumber,'EmailId'=>$EmailId,'BloodGroup'=>$BloodGroup,'MartialStatus'=>$MartialStatus,'DateofJoining'=>$DOJ,'PreviousYearsOfExp'=>$Previousexperience,'Designation'=>$desigination,'Departmentcode'=>$departmentCode,'PresentAddress'=>$CurrentAddress,'PermanentAddress'=>$permanentaddress,'EmergencyContactName'=>$emergencycontactname,'EmergencyContactNumber'=>$emergencycontactnumber,'Edu_Qualification'=>$eduqualifaction,'Additional_Qualification'=>$addqualification,'AadharNo'=>$aadharno,'PANNo'=>$panno,'BankAccountNo'=>$accountno,'IFSCCode'=>$ifsccode,'BankBranchName'=>$bankbranchname,'BankAddress'=>$bankaddress,'PassportNo'=>$passportno,'Passport_Valid_till'=>$Valid,'IsActive'=>$IsActive,'ProfilePic'=>$Picture,'Reference_Name'=>$referredby,'Reference_ContactNumber'=>$referrercontno,'Remarks'=>$addinfo,'CreatedBy'=>$createdby,'personalEmailId'=>$comEmailId,'DriverLicense'=>$driverlicense,'LicenseValidtill'=>$licenseExpiryDate,'VoterID'=>$VoterID);
|
||||
//print_r($Employee);die();
|
||||
$this->load->model('employeedetails_model');
|
||||
$result = $this->employeedetails_model->addNewemployee($Employee);
|
||||
|
||||
@ -473,6 +479,7 @@ echo "<script>alert('Record Not Saved!');</script>";
|
||||
$DateofBirth = $this->input->post('DateofBirth');
|
||||
$ContactNumber = $this->input->post('ContactNumber');
|
||||
$EmailId = $this->input->post('emailid');
|
||||
$comEmailId = $this->input->post('comemailid');
|
||||
$Gender = $this->input->post('gender');
|
||||
$MartialStatus = $this->input->post('MartialStatus');
|
||||
$BloodGroup = $this->input->post('bloodgroup');
|
||||
@ -497,7 +504,9 @@ echo "<script>alert('Record Not Saved!');</script>";
|
||||
$passportno = $this->input->post('passportno');
|
||||
$ValidTill = $this->input->post('ValidTill');
|
||||
$addinfo = $this->input->post('addinfo');
|
||||
|
||||
$driverlicense = $this->input->post ( 'Driverlicense' );
|
||||
$licenseExpiryDate = $this->input->post ( 'LicenseExpiryDate' );
|
||||
$VoterID = $this->input->post ( 'VoterID' );
|
||||
$chked = $this->input->post('isactive');
|
||||
// echo 'chkvalue'. $chked ;
|
||||
if( $chked != '')
|
||||
@ -511,7 +520,7 @@ echo "<script>alert('Record Not Saved!');</script>";
|
||||
// echo 'chkvalue'. $IsActive ;
|
||||
$UpdatedBY = $this->session->userdata ( 'userId' );
|
||||
|
||||
|
||||
$licenseExpiryDate = $this->getDateformat($licenseExpiryDate);
|
||||
$DOB = $this->getDateformat($DateofBirth);
|
||||
$DOJ = $this->getDateformat($dateofjoining);
|
||||
if($ValidTill != '')
|
||||
@ -524,9 +533,9 @@ echo "<script>alert('Record Not Saved!');</script>";
|
||||
}
|
||||
|
||||
//echo $DOB;
|
||||
$Employee = array('FirstName'=>$FirstName, 'LastName'=>$LastName,'FatherName'=>$FatherName,'Gender'=>$Gender,'DateofBirth'=>$DOB,'ContactNumber'=>$ContactNumber,'EmailId'=>$EmailId,'BloodGroup'=>$BloodGroup,'MartialStatus'=>$MartialStatus,'DateofJoining'=>$DOJ,'PreviousYearsOfExp'=>$Previousexperience,'Designation'=>$desigination,'Departmentcode'=>$departmentCode,'PresentAddress'=>$CurrentAddress,'PermanentAddress'=>$permanentaddress,'EmergencyContactName'=>$emergencycontactname,'EmergencyContactNumber'=>$emergencycontactnumber,'Edu_Qualification'=>$eduqualifaction,'Additional_Qualification'=>$addqualification,'AadharNo'=>$aadharno,'PANNo'=>$panno,'BankAccountNo'=>$accountno,'IFSCCode'=>$ifsccode,'BankBranchName'=>$bankbranchname,'BankAddress'=>$bankaddress,'PassportNo'=>$passportno,'Passport_Valid_till'=>$Valid,'IsActive'=>$IsActive,'ProfilePic'=>$Picture,'Reference_Name'=>$referredby,'Reference_ContactNumber'=>$referrercontno,'Remarks'=>$addinfo,'UpdatedBY'=>$UpdatedBY);
|
||||
$Employee = array('FirstName'=>$FirstName, 'LastName'=>$LastName,'FatherName'=>$FatherName,'Gender'=>$Gender,'DateofBirth'=>$DOB,'ContactNumber'=>$ContactNumber,'EmailId'=>$EmailId,'BloodGroup'=>$BloodGroup,'MartialStatus'=>$MartialStatus,'DateofJoining'=>$DOJ,'PreviousYearsOfExp'=>$Previousexperience,'Designation'=>$desigination,'Departmentcode'=>$departmentCode,'PresentAddress'=>$CurrentAddress,'PermanentAddress'=>$permanentaddress,'EmergencyContactName'=>$emergencycontactname,'EmergencyContactNumber'=>$emergencycontactnumber,'Edu_Qualification'=>$eduqualifaction,'Additional_Qualification'=>$addqualification,'AadharNo'=>$aadharno,'PANNo'=>$panno,'BankAccountNo'=>$accountno,'IFSCCode'=>$ifsccode,'BankBranchName'=>$bankbranchname,'BankAddress'=>$bankaddress,'PassportNo'=>$passportno,'Passport_Valid_till'=>$Valid,'IsActive'=>$IsActive,'ProfilePic'=>$Picture,'Reference_Name'=>$referredby,'Reference_ContactNumber'=>$referrercontno,'Remarks'=>$addinfo,'UpdatedBY'=>$UpdatedBY,'personalEmailId'=>$comEmailId,'DriverLicense'=>$driverlicense,'LicenseValidtill'=>$licenseExpiryDate,'VoterID'=>$VoterID);
|
||||
|
||||
|
||||
//print_r($Employee);die();
|
||||
$result = $this->employeedetails_model->UpdateEmployee($Employee,$EmpId);
|
||||
|
||||
if($result > 0)
|
||||
@ -597,7 +606,10 @@ echo "<script>alert('Record Not Updated!');</script>";
|
||||
$this->excel->getActiveSheet()->setCellValue('AI5', 'UpdatedBY');
|
||||
$this->excel->getActiveSheet()->setCellValue('AJ5', 'PF_Balance');
|
||||
$this->excel->getActiveSheet()->setCellValue('AK5', 'PF_Bal_On');
|
||||
//$this->excel->getActiveSheet()->setCellValue('AK5', 'Date OF Birth');
|
||||
$this->excel->getActiveSheet()->setCellValue('AL5', 'Official Email ID');
|
||||
$this->excel->getActiveSheet()->setCellValue('AM5', 'Driving License');
|
||||
$this->excel->getActiveSheet()->setCellValue('AN5', 'Driving License Expiry Date');
|
||||
$this->excel->getActiveSheet()->setCellValue('AO5', 'Voter ID');
|
||||
|
||||
|
||||
|
||||
@ -685,6 +697,14 @@ echo "<script>alert('Record Not Updated!');</script>";
|
||||
$this->excel->getActiveSheet()->getStyle('AJ5')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('AK5')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('AK5')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('AL5')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('AL5')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('AM5')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('AM5')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('AN5')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('AN5')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('AO5')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('AO5')->getFont()->setBold(true);
|
||||
|
||||
|
||||
|
||||
@ -694,6 +714,7 @@ echo "<script>alert('Record Not Updated!');</script>";
|
||||
if ($exportData) {
|
||||
$i = 6;
|
||||
$s = 1;
|
||||
|
||||
foreach ($exportData as $data) {
|
||||
|
||||
|
||||
@ -734,6 +755,10 @@ echo "<script>alert('Record Not Updated!');</script>";
|
||||
$this->excel->getActiveSheet()->setCellValue('AI'. $i,$data['UpdatedBY']);
|
||||
$this->excel->getActiveSheet()->setCellValue('AJ'. $i,$data['PF_Balance']);
|
||||
$this->excel->getActiveSheet()->setCellValue('AK'. $i,$data['PF_Bal_On']);
|
||||
$this->excel->getActiveSheet()->setCellValue('AL'. $i,$data['personalEmailId']);
|
||||
$this->excel->getActiveSheet()->setCellValue('AM'. $i,$data['DriverLicense']);
|
||||
$this->excel->getActiveSheet()->setCellValue('AN'. $i,$data['LicenseValidtill']);
|
||||
$this->excel->getActiveSheet()->setCellValue('AO'. $i,$data['VoterID']);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
reader.onload = function (e) {
|
||||
$('#profilepicture')
|
||||
.attr('src', e.target.result)
|
||||
.width(166)
|
||||
.height(166);
|
||||
.width(180)
|
||||
.height(180);
|
||||
};
|
||||
|
||||
reader.readAsDataURL(input.files[0]);
|
||||
@ -124,7 +124,7 @@ function validateEmail() {
|
||||
{
|
||||
if (reg.test(email) == false)
|
||||
{
|
||||
alert('Please Enter Valid Email Address');
|
||||
alert('Please Enter Valid Personal Email Address');
|
||||
return (false);
|
||||
}
|
||||
else
|
||||
@ -138,6 +138,50 @@ function validateEmail() {
|
||||
}
|
||||
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please Enter email id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function validateDriverLicense() {
|
||||
|
||||
|
||||
var reg = /^[A-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 getAge() {
|
||||
|
||||
var dateString = $("#DateofBirth").val();
|
||||
@ -181,6 +225,9 @@ $(function() {
|
||||
});
|
||||
$("#ValidTill").datepicker({dateFormat: 'mm/dd/yy',minDate :'now',changeMonth: true, changeYear: true,yearRange: '-0:+100'
|
||||
});
|
||||
$("#LicenseExpiryDate").datepicker({dateFormat: 'mm/dd/yy',minDate :'now',changeMonth: true, changeYear: true,yearRange: '-0:+100'
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
@ -264,7 +311,7 @@ function onlyAlphabets(evt) {
|
||||
<form role="form" id="addemployee" action="<?php echo base_url() ?>employeedetails/AddNewEmployee" method="post" enctype="multipart/form-data">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-10 col-md-offset-1" style="border:3px solid #3c8dbc;">
|
||||
<div class="col-md-10 col-md-offset-1">
|
||||
<form class="form-horizontal" role="form" >
|
||||
<fieldset>
|
||||
|
||||
@ -273,13 +320,18 @@ function onlyAlphabets(evt) {
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
|
||||
<div class="box-header">
|
||||
<img id="profilepicture" src="<?php echo base_url(); ?>assets/dist/img/avatar.png" alt="your image" style="width: 139px;"/><br/>
|
||||
<input type='file' onchange="readURL(this);" id="photo" name="photo"/>
|
||||
<label for="photo">Select profile picture<br/><small>(only .jpg or .png)</small></label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-9">
|
||||
|
||||
<div class="col-md-6 pad">
|
||||
@ -304,7 +356,7 @@ function onlyAlphabets(evt) {
|
||||
<div class="col-md-6 pad"><span>Contact Number</span><span class="badge">*</span>
|
||||
<input type="text" name="ContactNumber" onchange="return getMobileValidation();" onkeypress="return event.charCode >= 48 && event.charCode <= 57" id="ContactNumber" required pattern="(.){10,10}" maxlength="10" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6 pad"><span>Email ID</span><span class="badge">*</span>
|
||||
<div class="col-md-6 pad"><span>Personal Email ID</span><span class="badge">*</span>
|
||||
<input type="email" name="emailid" id="emailid" required maxlength="100" class="form-control">
|
||||
</div>
|
||||
|
||||
@ -325,25 +377,15 @@ function onlyAlphabets(evt) {
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 pad"><span>Marital Status</span><span class="badge">*</span>
|
||||
<select id="MartialStatus" name="MartialStatus" type="text" required placeholder="Marital status" class="form-control">
|
||||
<option value="-1">Select Marital Status</option>
|
||||
<?php
|
||||
if(!empty($Martial))
|
||||
{
|
||||
foreach ($Martial as $rl)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="col-md-6 pad"> <span>Official Email ID</span><span class="badge">*</span>
|
||||
<input type="email" name="comemailid" id="mail" required maxlength="100" class="form-control">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-6 pad"><span>Blood group</span><span class="badge">*</span>
|
||||
<div class="col-md-6 pad">
|
||||
<div class="col-md-6 " style="padding:0px;">
|
||||
|
||||
<span>Blood group</span><span class="badge">*</span>
|
||||
<select id="bloodgroup" name="bloodgroup" required class="form-control">
|
||||
<option value="-1">Select Blood group</option>
|
||||
<?php
|
||||
@ -358,6 +400,23 @@ function onlyAlphabets(evt) {
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6" style="padding:0px;"><span>Marital Status</span><span class="badge">*</span>
|
||||
<select id="MartialStatus" name="MartialStatus" type="text" required placeholder="Marital status" class="form-control">
|
||||
<option value="-1">Select Marital Status</option>
|
||||
<?php
|
||||
if(!empty($Martial))
|
||||
{
|
||||
foreach ($Martial as $rl)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -368,20 +427,20 @@ function onlyAlphabets(evt) {
|
||||
<!-- Form Name -->
|
||||
<legend>Address Details</legend>
|
||||
<!-- Text input-->
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-12"><span>Current Address</span><span class="badge">*</span>
|
||||
<input type="text" id="currentaddress" required name="currentaddress" maxlength="500" class="form-control">
|
||||
<input type="text" id="currentaddress" required title="Enter more then 20 letters" name="currentaddress" pattern=".{20,500}" maxlength="500" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-10">
|
||||
<input type="checkbox" id="checksame" name="sameaddress" onclick="CheckClick"> Current address same as permanent address
|
||||
</div>
|
||||
</div>
|
||||
<!-- Text input-->
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-12"><span>Permanent Address</span><span class="badge">*</span>
|
||||
<input type="text" id="permanentaddress" required name="permanentaddress" maxlength="500" class="form-control">
|
||||
<input type="text" id="permanentaddress" required title="Enter more then 20 letters" name="permanentaddress" pattern=".{20,500}" maxlength="500" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<!-- Text input-->
|
||||
@ -392,7 +451,7 @@ function onlyAlphabets(evt) {
|
||||
<!-- Form Name -->
|
||||
<legend>Emergency Contact Information</legend>
|
||||
<!-- Text input-->
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-6"><span>Emergency Contact Name</span><span class="badge">*</span>
|
||||
<input type="text" id="emergencycontactname" onkeypress="return onlyAlphabets(event);" maxlength="100" required name="emergencycontactname" class="form-control">
|
||||
</div>
|
||||
@ -408,7 +467,7 @@ function onlyAlphabets(evt) {
|
||||
<legend>Work Profile</legend>
|
||||
<!-- Text input-->
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-3"><span>Designation</span>
|
||||
<select type="text" id="desigination" name="desigination" required class="form-control">
|
||||
<option value="-1">Select Designation</option>
|
||||
@ -451,7 +510,7 @@ function onlyAlphabets(evt) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-3"><span>Qualification</span><span class="badge">*</span>
|
||||
<select type="text" id="eduqualifaction" name="eduqualifaction" required class="form-control">
|
||||
<option value="-1">Select Qualification</option>
|
||||
@ -484,12 +543,12 @@ function onlyAlphabets(evt) {
|
||||
<legend>Bank Details</legend>
|
||||
<!-- Text input-->
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-3"><span>Account Number</span>
|
||||
<input type="text" id="accountno" onkeypress="return event.charCode >= 48 && event.charCode <= 57" maxlength="20" name="accountno" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3"><span>IFSC Code</span>
|
||||
<input type="text" id="ifsccode" name="ifsccode" maxlength="12" class="form-control">
|
||||
<input type="text" id="ifsccode" style="text-transform: uppercase" name="ifsccode" maxlength="12" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3"><span>Bank Branch Name</span>
|
||||
<input type="text" id="bankbranchname" maxlength="200" name="bankbranchname" class="form-control">
|
||||
@ -502,25 +561,39 @@ function onlyAlphabets(evt) {
|
||||
<legend>ID Proof</legend>
|
||||
<!-- Text input-->
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-3"><span>Aadhar Number</span>
|
||||
<input type="text" id="aadharno" name="aadharno" maxlength="12" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3"><span>PAN Number</span>
|
||||
<input type="text" id="panno" maxlength="10" name="panno" onchange="validatePAN();" class="form-control">
|
||||
<input type="text" id="panno" maxlength="10" style="text-transform: uppercase" name="panno" onchange="validatePAN();" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3"><span>Passport Number</span>
|
||||
<input type="text" id="passportno" maxlength="8" onchange="ValidatePassport();" name="passportno" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3"><span>Valid Till</span>
|
||||
<div class="col-md-3"><span>Passport Expiry Date</span>
|
||||
<input id="ValidTill" name="ValidTill" onkeypress="return false;" maxlength="10" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-3"><span>Voter ID</span>
|
||||
<input type="text" id="VoterID" name="voterID" maxlength="12" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3"><span>Driving License</span>
|
||||
<input type="text" id="Driverlicense" onchange="validateDriverLicense();" pattern="[A-Z]{2}[0-9]{2}\s[0-9]{11}" title="EX:TN82 12345678900"maxlength="16" name="driverlicense" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="col-md-3"><span>Driving License Expiry Date</span>
|
||||
<input id="LicenseExpiryDate" name="licenseExpiryDate" onkeypress="return false;" maxlength="10" class="form-control">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Command -->
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-3 col-md-offset-9">
|
||||
<div class="pull-right">
|
||||
<input type="reset" id="reset" onclick="resetphoto();" class="btn btn-info" value="Reset" />
|
||||
@ -607,15 +680,24 @@ function Validate()
|
||||
|
||||
if($("#emailid").val().length < 1)
|
||||
{
|
||||
alert('Please Enter Email ID');
|
||||
alert('Please Enter Personal Email ID');
|
||||
return false;
|
||||
}
|
||||
else if(!validateEmail())
|
||||
{
|
||||
return false;
|
||||
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');
|
||||
@ -683,6 +765,7 @@ function Validate()
|
||||
ValidatePassport();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
$("#emailid").change(function () {
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
$DateofBirth = '';
|
||||
$ContactNumber ='';
|
||||
$EmailId = '';
|
||||
|
||||
$BloodGroup ='';
|
||||
$MartialStatus= '';
|
||||
$DateofJoining = '';
|
||||
@ -38,6 +39,10 @@
|
||||
$Age = '';
|
||||
$DOB = '';
|
||||
$DOJ = '';
|
||||
$personalEmailId='';
|
||||
$DriverLicense='';
|
||||
$LicenseValidtill='';
|
||||
$VoterID='';
|
||||
if(!empty($EmpDetails))
|
||||
{
|
||||
foreach ($EmpDetails as $Emp)
|
||||
@ -54,6 +59,7 @@ if(!empty($EmpDetails))
|
||||
$DOB = $from ->format('Y-m-d');
|
||||
$ContactNumber = $Emp->ContactNumber;
|
||||
$EmailId = $Emp->EmailId;
|
||||
//$comEmailId = $Emp->comEmailId;
|
||||
$BloodGroup = $Emp->BloodGroup;
|
||||
$MartialStatus =$Emp->MartialStatus;
|
||||
$DateofJoining = $Emp->DateofJoining;
|
||||
@ -87,6 +93,12 @@ if(!empty($EmpDetails))
|
||||
$Reference_Name = $Emp->Reference_Name;
|
||||
$Reference_ContactNumber = $Emp->Reference_ContactNumber;
|
||||
$Remarks = $Emp->Remarks;
|
||||
$personalEmailId = $Emp->personalEmailId;
|
||||
$DriverLicense = $Emp->DriverLicense;
|
||||
$LicenseValidtill = $Emp->LicenseValidtill;
|
||||
$VoterID = $Emp->VoterID;
|
||||
$dtLicenseValidtill = new DateTime($LicenseValidtill);
|
||||
$LicenseValidtill = $dtLicenseValidtill ->format('Y-m-d');
|
||||
|
||||
}
|
||||
}
|
||||
@ -158,6 +170,26 @@ function validatePAN() {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function validateDriverLicense() {
|
||||
|
||||
|
||||
var reg = /^[A-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()
|
||||
{
|
||||
@ -190,15 +222,24 @@ function Validate()
|
||||
{ return;}
|
||||
|
||||
|
||||
if($("#emailid").val().length < 1)
|
||||
if($("#email").val().length < 1)
|
||||
{
|
||||
alert('Please Enter Email ID');
|
||||
return;
|
||||
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')
|
||||
@ -295,7 +336,7 @@ function getValidReferNumber() {
|
||||
function validateEmail() {
|
||||
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
||||
|
||||
var email = $('#emailid').val();
|
||||
var email = $('#email').val();
|
||||
|
||||
if(email != '')
|
||||
{
|
||||
@ -310,6 +351,25 @@ function validateEmail() {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
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 getAge() {
|
||||
|
||||
@ -354,6 +414,8 @@ $(function() {
|
||||
});
|
||||
$("#ValidTill").datepicker({dateFormat: 'mm/dd/yy',minDate :'now',changeMonth: true, changeYear: true,yearRange: '-0:+100'
|
||||
});
|
||||
$("#LicenseExpiryDate").datepicker({dateFormat: 'mm/dd/yy',minDate :'now',changeMonth: true, changeYear: true,yearRange: '-0:+100'
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@ -422,14 +484,14 @@ function ValidatePassport()
|
||||
<form role="form" id="addemployee" action="<?php echo base_url() ?>employeedetails/UpdateEmployee" method="post" enctype="multipart/form-data">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-10 col-md-offset-1" style="border:3px solid #3c8dbc;">
|
||||
<div class="col-md-10 col-md-offset-1">
|
||||
<form class="form-horizontal" role="form" >
|
||||
<fieldset>
|
||||
|
||||
<!-- Form Name -->
|
||||
<legend>Personal Information</legend>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-3">
|
||||
<div class="box-header">
|
||||
<img id="profilepicture" src="<?php echo base_url().'uploads/images/'.$ProfilePic ; ?>" alt="your image" style="width: 139px;"/><br/>
|
||||
@ -438,7 +500,9 @@ function ValidatePassport()
|
||||
|
||||
<input type="hidden" name="Image" id="Image" value="<?php echo $ProfilePic ; ?>" class="form-control" readonly>
|
||||
<input type="text" name="employeeid" id="employeeid" value="<?php echo $EmpID ; ?>" placeholder="Employee ID" class="form-control" readonly>
|
||||
<br/><input type="checkbox" id="isactive" value="<?php echo $IsActive ; ?>" name="isactive" onclick="checkactive"> IsActive
|
||||
|
||||
|
||||
<input type="checkbox" id="isactive" value="<?php echo $IsActive ; ?>" name="isactive" onclick="checkactive"> IsActive
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
@ -464,8 +528,8 @@ function ValidatePassport()
|
||||
<div class="col-md-6 pad"><span>Contact Number</span><span class="badge">*</span>
|
||||
<input type="text" name="ContactNumber" value="<?php echo $ContactNumber ; ?>" onchange="getMobileValidation();" onkeypress="return event.charCode >= 48 && event.charCode <= 57" id="ContactNumber" required placeholder="Contact Number" maxlength="10" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6 pad"><span>Email ID</span><span class="badge">*</span>
|
||||
<input type="mail" name="emailid" value="<?php echo $EmailId ; ?>" id="emailid" placeholder="Email ID" maxlength="100" class="form-control">
|
||||
<div class="col-md-6 pad"><span>Personal Email ID</span><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-6 pad"><span>Gender</span><span class="badge">*</span>
|
||||
@ -484,8 +548,32 @@ function ValidatePassport()
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 pad"><span>Marital Status</span><span class="badge">*</span>
|
||||
<div class="col-md-6 pad"> <span>Official Email ID</span><span class="badge">*</span>
|
||||
<input type="email" name="comemailid" id="mail" required value="<?php echo $personalEmailId;?>"maxlength="100" class="form-control">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-6 pad">
|
||||
<div class="col-md-6" style="padding:0px;">
|
||||
<span>Blood group</span><span class="badge">*</span>
|
||||
<select id="bloodgroup" name="bloodgroup" required class="form-control">
|
||||
<option value="<?php echo $BloodGroup ; ?>"><?php echo $BloodGroup ?></option>
|
||||
<?php
|
||||
if(!empty($BloodGroupList))
|
||||
{
|
||||
foreach ($BloodGroupList as $rl)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6" style="padding:0px;">
|
||||
<span>Marital Status</span><span class="badge">*</span>
|
||||
<select id="MartialStatus" name="MartialStatus" type="text" required placeholder="Marital status" class="form-control">
|
||||
<option value="<?php echo $MartialStatus?>"><?php echo $MartialStatus; ?></option>
|
||||
<?php
|
||||
@ -501,23 +589,6 @@ function ValidatePassport()
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-6 pad"><span>Blood group</span><span class="badge">*</span>
|
||||
<select id="bloodgroup" name="bloodgroup" required class="form-control">
|
||||
<option value="<?php echo $BloodGroup ; ?>"><?php echo $BloodGroup ?></option>
|
||||
<?php
|
||||
if(!empty($BloodGroupList))
|
||||
{
|
||||
foreach ($BloodGroupList as $rl)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -529,19 +600,25 @@ function ValidatePassport()
|
||||
<legend>Address Details</legend>
|
||||
<!-- Text input-->
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-12"><span>Current Address</span><span class="badge">*</span>
|
||||
<input type="text" id="currentaddress" required name="currentaddress" value="<?php echo $PresentAddress ; ?>" maxlength="500" placeholder="Current Address" class="form-control">
|
||||
<input type="text" id="currentaddress" pattern=".{20,500}" title="Enter more then 20 letters" required name="currentaddress"maxlength="500" value="<?php echo $PresentAddress ; ?>" placeholder="Current Address" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-10">
|
||||
<input type="checkbox" id="checksame" name="sameaddress" onclick="CheckClick"> Current address same as permanent address
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Text input-->
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-12"><span>Permanent Address</span><span class="badge">*</span>
|
||||
<input type="text" id="permanentaddress" required name="permanentaddress" value="<?php echo $PermanentAddress; ?>" maxlength="500" placeholder="Permanent Address " class="form-control">
|
||||
<input type="text" id="permanentaddress" required name="permanentaddress" pattern=".{20,500}" value="<?php echo $PermanentAddress; ?>" maxlength="500" title="Enter more then 20 letters" placeholder="Permanent Address " class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Text input-->
|
||||
@ -553,12 +630,14 @@ function ValidatePassport()
|
||||
<legend>Emergency Contact Information</legend>
|
||||
<!-- Text input-->
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-6"><span>Emergency Contact Name</span><span class="badge">*</span>
|
||||
<input type="text" id="emergencycontactname" maxlength="100" required name="emergencycontactname" value="<?php echo $EmergencyContactName ; ?>" placeholder="Emergency Contact Name" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6"><span>Emergency Contact Number</span><span class="badge">*</span>
|
||||
<input type="text" id="emergencycontactnumber" required name="emergencycontactnumber" onchange="getValidEmergencyNumber();" onkeypress="return event.charCode >= 48 && event.charCode <= 57" maxlength="10" value="<?php echo $EmergencyContactNumber; ?>" placeholder="Emergency Contact Number" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -569,6 +648,7 @@ function ValidatePassport()
|
||||
<!-- Text input-->
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-3"><span>Designation</span><span class="badge">*</span>
|
||||
<select type="text" id="desigination" name="desigination" required class="form-control">
|
||||
<option value="<?php echo $Designation ; ?>"><?php echo $Designation; ?></option>
|
||||
@ -609,9 +689,11 @@ function ValidatePassport()
|
||||
<div class="col-md-3"><span>Previous Years of Experience</span>
|
||||
<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 class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-3"><span>Qualification</span><span class="badge">*</span>
|
||||
<select type="text" id="eduqualifaction" name="eduqualifaction" required class="form-control">
|
||||
<option value="<?php echo $Edu_Qualification; ?>"><?php echo $Edu_Qualification ; ?></option>
|
||||
@ -638,17 +720,19 @@ function ValidatePassport()
|
||||
<div class="col-md-3"><span>Referrer Contact Number</span>
|
||||
<input type="text" id="referrercontno" name="referrercontno" value="<?php echo $Reference_ContactNumber ; ?>" onchange="getValidReferNumber();" maxlength="10" onkeypress="return event.charCode >= 48 && event.charCode <= 57" placeholder="Referrer Contact Number" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<legend>Bank Details</legend>
|
||||
<!-- Text input-->
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-3"><span>Account Number</span>
|
||||
<input type="text" id="accountno" onkeypress="return event.charCode >= 48 && event.charCode <= 57" maxlength="20" name="accountno" placeholder="Account Number" class="form-control" value="<?php echo $BankAccountNo ; ?>">
|
||||
</div>
|
||||
<div class="col-md-3"><span>IFSC Code</span>
|
||||
<input type="text" id="ifsccode" name="ifsccode" placeholder="IFSC Code" maxlength="12" class="form-control" value="<?php echo $IFSCCode ; ?>">
|
||||
<input type="text" id="ifsccode" style="text-transform: uppercase" name="ifsccode" placeholder="IFSC Code" maxlength="12" class="form-control" value="<?php echo $IFSCCode ; ?>">
|
||||
</div>
|
||||
<div class="col-md-3"><span>Bank Branch Name</span>
|
||||
<input type="text" id="bankbranchname" maxlength="200" name="bankbranchname" placeholder="Bank Branch Name" class="form-control" value="<?php echo $BankBranchName ; ?>">
|
||||
@ -656,17 +740,19 @@ function ValidatePassport()
|
||||
<div class="col-md-3"><span>Bank Address</span>
|
||||
<input type="text" id="bankaddress" maxlength="200" name="bankaddress" placeholder="Bank Address" class="form-control" value="<?php echo $BankAddress ; ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<legend>ID Proof</legend>
|
||||
<!-- Text input-->
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-3"><span>Aadhar Number</span>
|
||||
<input type="text" id="aadharno" name="aadharno" maxlength="12" placeholder="Aadhar Number" class="form-control" value="<?php echo $AadharNo ; ?>">
|
||||
</div>
|
||||
<div class="col-md-3"><span>PAN Number</span>
|
||||
<input type="text" id="panno" maxlength="10" name="panno" placeholder="PAN Number" onchange="validatePAN();" class="form-control" value="<?php echo $PANNo ; ?>">
|
||||
<input type="text" id="panno" style="text-transform: uppercase" maxlength="10" name="panno" placeholder="PAN Number" onchange="validatePAN();" class="form-control" value="<?php echo $PANNo ; ?>">
|
||||
</div>
|
||||
<div class="col-md-3"><span>Passport Number</span>
|
||||
<input type="text" id="passportno" maxlength="8" onchange="ValidatePassport();" name="passportno" placeholder="Passport Number" class="form-control" value="<?php echo $PassportNo ; ?>">
|
||||
@ -674,22 +760,35 @@ function ValidatePassport()
|
||||
<div class="col-md-3"><span>Valid Till</span>
|
||||
<input id="ValidTill" name="ValidTill" maxlength="10" placeholder="ValidTill" class="form-control" value="<?php echo $DOPassport ; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 pad">
|
||||
<div class="col-md-3"><span>Voter ID</span>
|
||||
<input type="text" id="VoterID" name="VoterID" maxlength="12" value="<?php echo $VoterID;?>" class="form-control" placeholder="VoterID" value="">
|
||||
</div>
|
||||
<div class="col-md-3"><span>Driving License</span>
|
||||
<input type="text" id="Driverlicense" maxlength="16" onchange="validateDriverLicense();" pattern="[A-Z]{2}[0-9]{2}\s[0-9]{11}" value="<?php echo $DriverLicense;?>"name="Driverlicense" title="EX:TN82 12345678900" class="form-control" value=""placeholder="Driverlicense">
|
||||
</div>
|
||||
|
||||
<div class="col-md-3"><span>Driving License Expiry Date</span>
|
||||
<input id="LicenseExpiryDate" name="LicenseExpiryDate" value="<?php echo $LicenseValidtill;?>" onkeypress="return false;" class="form-control" placeholder="License Expiry Date" value="">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Command -->
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-3 col-md-offset-9">
|
||||
<div class="col-md-3 col-md-offset-9" style="padding: 10px;">
|
||||
<div class="pull-right">
|
||||
<input type="submit" onclick="Validate();" class="btn btn-primary">
|
||||
<a href="<?php echo base_url() ?>employeeListing" class="btn btn-info" id="cancel" value="Cancel">Cancel</a>
|
||||
|
||||
<input type="submit" onclick="Validate();" class="btn btn-primary">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
</div><!-- /.col-lg-12 -->
|
||||
@ -735,9 +834,9 @@ function ValidatePassport()
|
||||
<script src="<?php echo base_url(); ?>assets/js/addUser.js" type="text/javascript"></script>
|
||||
<script>
|
||||
|
||||
$("#emailid").change(function () {
|
||||
$("#email").change(function () {
|
||||
|
||||
var id = $('#emailid').val();
|
||||
var id = $('#email').val();
|
||||
if(validateEmail())
|
||||
{
|
||||
$.ajax({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user