diff --git a/application/controllers/employeedetails.php b/application/controllers/employeedetails.php index 0b7ee897..af95a1c2 100755 --- a/application/controllers/employeedetails.php +++ b/application/controllers/employeedetails.php @@ -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 ""; $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 ""; $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 ""; // 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 ""; } //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 ""; $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 ""; $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 ""; if ($exportData) { $i = 6; $s = 1; + foreach ($exportData as $data) { @@ -734,6 +755,10 @@ echo ""; $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']); diff --git a/application/views/addemployee.php b/application/views/addemployee.php index b4bc5bf4..2ba937a7 100755 --- a/application/views/addemployee.php +++ b/application/views/addemployee.php @@ -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) {