CHANGE_EMP_CURD
This commit is contained in:
parent
b7d8071271
commit
2a8db81a15
@ -51,7 +51,6 @@ class Employeedetails extends BaseController
|
|||||||
$this->session = session();
|
$this->session = session();
|
||||||
helper('form'); //$this->load->library('form_validation');
|
helper('form'); //$this->load->library('form_validation');
|
||||||
$this->isLoggedIn();
|
$this->isLoggedIn();
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This function is used to load the Employee details
|
* This function is used to load the Employee details
|
||||||
@ -202,20 +201,24 @@ class Employeedetails extends BaseController
|
|||||||
|
|
||||||
function AddNewEmployee()
|
function AddNewEmployee()
|
||||||
{
|
{
|
||||||
|
// print_r($this->request->getPost());die;
|
||||||
|
|
||||||
$photo = $this->request->getFile('photo');
|
$photo = $this->request->getFile('photo');
|
||||||
$Picture = "";
|
$Picture = "";
|
||||||
|
if(isset($photoan)){
|
||||||
if ($photo->isValid() && !$photo->hasMoved()) {
|
if ($photo->isValid() && !$photo->hasMoved()) {
|
||||||
$uploadDir = ROOTPATH . 'public/uploads/images/';
|
$uploadDir = ROOTPATH . 'public/uploads/images/';
|
||||||
$allowedTypes = ['jpg', 'jpeg', 'png', 'gif'];
|
$allowedTypes = ['jpg', 'jpeg', 'png', 'gif'];
|
||||||
if (in_array($photo->getExtension(), $allowedTypes)) {
|
if (in_array($photo->getExtension(), $allowedTypes)) {
|
||||||
$newName = $photo->getRandomName();
|
$newName = $photo->getRandomName();
|
||||||
if(!is_dir($uploadDir)) { mkdir($uploadDir, 0777, true); }
|
if (!is_dir($uploadDir)) {
|
||||||
|
mkdir($uploadDir, 0777, true);
|
||||||
|
}
|
||||||
$photo->move($uploadDir, $newName);
|
$photo->move($uploadDir, $newName);
|
||||||
$Picture = $newName;
|
$Picture = $newName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// $Profile = $this->request->getPost('photo');
|
// $Profile = $this->request->getPost('photo');
|
||||||
$FirstName = $this->request->getPost('FirstName');
|
$FirstName = $this->request->getPost('FirstName');
|
||||||
$FatherName = $this->request->getPost('FatherName');
|
$FatherName = $this->request->getPost('FatherName');
|
||||||
@ -290,22 +293,49 @@ class Employeedetails extends BaseController
|
|||||||
|
|
||||||
//echo $DOB;
|
//echo $DOB;
|
||||||
$Employee = array(
|
$Employee = array(
|
||||||
'FirstName' => $FirstName, 'FatherName' => $FatherName,
|
'FirstName' => $FirstName,
|
||||||
'Gender' => $Gender, 'DateofBirth' => $DOB, 'ContactNumber' => $ContactNumber, 'EmailId' => $EmailId,
|
'FatherName' => $FatherName,
|
||||||
'BloodGroup' => $BloodGroup, 'MartialStatus' => $MartialStatus, 'DateofJoining' => $DOJ,
|
'Gender' => $Gender,
|
||||||
'PreviousYearsOfExp' => $Previousexperience, 'Designation' => $desigination,
|
'DateofBirth' => $DOB,
|
||||||
'Departmentcode' => $departmentCode, 'PresentAddress' => $CurrentAddress,
|
'ContactNumber' => $ContactNumber,
|
||||||
'PermanentAddress' => $permanentaddress, 'EmergencyContactName' => $emergencycontactname,
|
'EmailId' => $EmailId,
|
||||||
'EmergencyContactNumber' => $emergencycontactnumber, 'Edu_Qualification' => $eduqualifaction,
|
'BloodGroup' => $BloodGroup,
|
||||||
'Additional_Qualification' => $addqualification, 'AadharNo' => $aadharno, 'PANNo' => $panno,
|
'MartialStatus' => $MartialStatus,
|
||||||
'BankAccountNo' => $accountno, 'IFSCCode' => $ifsccode, 'BankBranchName' => $bankbranchname,
|
'DateofJoining' => $DOJ,
|
||||||
'BankAddress' => $bankaddress, 'PassportNo' => $passportno, 'Passport_Valid_till' => $Valid,
|
'PreviousYearsOfExp' => $Previousexperience,
|
||||||
'IsActive' => $IsActive, 'ProfilePic' => $Picture, 'Reference_Name' => $referredby,
|
'Designation' => $desigination,
|
||||||
'Reference_ContactNumber' => $referrercontno, 'Remarks' => $addinfo, 'CreatedBy' => $createdby,
|
'Departmentcode' => $departmentCode,
|
||||||
'personalEmailId' => $comEmailId, 'DriverLicense' => $driverlicense,
|
'PresentAddress' => $CurrentAddress,
|
||||||
'LicenseValidtill' => $License_ExpiryDate, 'VoterID' => $VoterID, 'PFNO' => $PFno, 'ESI' => $ESIno,
|
'PermanentAddress' => $permanentaddress,
|
||||||
'NomineeDetails' => $Nominee , 'is_management_team' => $is_management_team , 'esi_applicable'=>$esi_applicable,
|
'EmergencyContactName' => $emergencycontactname,
|
||||||
'pf_applicable'=>$pf_applicable,'work_location'=>$work_location
|
'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' => $License_ExpiryDate,
|
||||||
|
'VoterID' => $VoterID,
|
||||||
|
'PFNO' => $PFno,
|
||||||
|
'ESI' => $ESIno,
|
||||||
|
'NomineeDetails' => $Nominee,
|
||||||
|
'is_management_team' => $is_management_team,
|
||||||
|
'esi_applicable' => $esi_applicable,
|
||||||
|
'pf_applicable' => $pf_applicable,
|
||||||
|
'work_location' => $work_location
|
||||||
);
|
);
|
||||||
|
|
||||||
//print_r($Employee);die();
|
//print_r($Employee);die();
|
||||||
@ -316,14 +346,13 @@ class Employeedetails extends BaseController
|
|||||||
// Get the uploaded files
|
// Get the uploaded files
|
||||||
$files = $this->request->getFiles();
|
$files = $this->request->getFiles();
|
||||||
$fileNames = $this->request->getPost('file_name'); // Get user-entered file names
|
$fileNames = $this->request->getPost('file_name'); // Get user-entered file names
|
||||||
if(isset($files['emp_file']))
|
if (isset($files['emp_file'])) {
|
||||||
{
|
|
||||||
foreach ($files['emp_file'] as $index => $file) {
|
foreach ($files['emp_file'] as $index => $file) {
|
||||||
if ($file->isValid() && !$file->hasMoved()) {
|
if ($file->isValid() && !$file->hasMoved()) {
|
||||||
// Move the file to the desired directory
|
// Move the file to the desired directory
|
||||||
$newName = $file->getRandomName();
|
$newName = $file->getRandomName();
|
||||||
$file->move(ROOTPATH . 'public/uploads/images/emp_files', $newName);
|
$file->move(ROOTPATH . 'public/uploads/images/emp_files', $newName);
|
||||||
$path = ROOTPATH . 'public/uploads/images/emp_files/'.$newName;
|
$path = ROOTPATH . 'public/uploads/images/emp_files/' . $newName;
|
||||||
// Store the file information in the database
|
// Store the file information in the database
|
||||||
$this->empFiles->save([
|
$this->empFiles->save([
|
||||||
'file_name' => $fileNames[$index], // User-entered file name
|
'file_name' => $fileNames[$index], // User-entered file name
|
||||||
@ -353,25 +382,28 @@ class Employeedetails extends BaseController
|
|||||||
|
|
||||||
// $this->session->set_flashdata('Success', 'New Employee created successfully!');
|
// $this->session->set_flashdata('Success', 'New Employee created successfully!');
|
||||||
$this->session->setFlashdata('success', 'New Employee created successfully!');
|
$this->session->setFlashdata('success', 'New Employee created successfully!');
|
||||||
|
return json_encode('true');
|
||||||
// echo "<script>alert('New Employee Created successfully!');</script>";
|
// echo "<script>alert('New Employee Created successfully!');</script>";
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// $this->session->set_flashdata('Error', 'New Employee details not saved');
|
// $this->session->set_flashdata('Error', 'New Employee details not saved');
|
||||||
$this->session->setFlashdata('error', 'Record Not Saved!');
|
$this->session->setFlashdata('error', 'Record Not Saved!');
|
||||||
|
return json_encode('false');
|
||||||
// echo "<script>alert('Record Not Saved!');</script>";
|
// echo "<script>alert('Record Not Saved!');</script>";
|
||||||
// redirect('employeeListing', 'refresh');
|
// redirect('employeeListing', 'refresh');
|
||||||
}
|
}
|
||||||
return redirect()->route('employeeListing');
|
// return redirect()->route('employeeListing');
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function deleteEmployeeFile(){
|
function deleteEmployeeFile()
|
||||||
|
{
|
||||||
$id = $this->request->getPost('id');
|
$id = $this->request->getPost('id');
|
||||||
$update = $this->empFiles->set(['is_active' => 0])->where('id',$id)->update();
|
$update = $this->empFiles->set(['is_active' => 0])->where('id', $id)->update();
|
||||||
if($update){
|
if ($update) {
|
||||||
return true;
|
return true;
|
||||||
}else{
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -379,8 +411,6 @@ class Employeedetails extends BaseController
|
|||||||
* This function is used to load the add new Employee form with dropdown values */
|
* This function is used to load the add new Employee form with dropdown values */
|
||||||
function addemployee()
|
function addemployee()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$GenderConfigID = 'C013';
|
$GenderConfigID = 'C013';
|
||||||
$MartialConfigID = 'C012';
|
$MartialConfigID = 'C012';
|
||||||
$QualificationConfigID = 'C014';
|
$QualificationConfigID = 'C014';
|
||||||
@ -396,16 +426,17 @@ class Employeedetails extends BaseController
|
|||||||
$data['BloodGroup'] = $this->employeedetails_model->getConfigValue($BloodGroupConfigID);
|
$data['BloodGroup'] = $this->employeedetails_model->getConfigValue($BloodGroupConfigID);
|
||||||
$data['Location'] = $this->employeedetails_model->getConfigValue($LocationConfigID);
|
$data['Location'] = $this->employeedetails_model->getConfigValue($LocationConfigID);
|
||||||
$data['Department'] = $this->employeedetails_model->getDepartment();
|
$data['Department'] = $this->employeedetails_model->getDepartment();
|
||||||
$data['hra_rate'] = $this->appConfig->where('config_key',1)->get()->getRow()->config_value;
|
$data['hra_rate'] = $this->appConfig->where('config_key', 1)->get()->getRow()->config_value;
|
||||||
$data['pf_rate'] = $this->appConfig->where('config_key',2)->get()->getRow()->config_value;
|
$data['pf_rate'] = $this->appConfig->where('config_key', 2)->get()->getRow()->config_value;
|
||||||
$data['esi_rate'] = $this->appConfig->where('config_key',3)->get()->getRow()->config_value;
|
$data['esi_rate'] = $this->appConfig->where('config_key', 3)->get()->getRow()->config_value;
|
||||||
$this->global['pageTitle'] = 'Add New Employee';
|
$this->global['pageTitle'] = 'Add New Employee';
|
||||||
|
|
||||||
// if($this->role == ROLE_ADMIN || $this->DEPCode == HR)
|
// if($this->role == ROLE_ADMIN || $this->DEPCode == HR)
|
||||||
// {
|
// {
|
||||||
|
|
||||||
|
|
||||||
$this->loadViews("addEmployee", $this->global, $data, NULL);
|
// $this->loadViews("addEmployee", $this->global, $data, NULL);
|
||||||
|
$this->loadViews("addEmployeenew", $this->global, $data, NULL);
|
||||||
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
@ -449,7 +480,6 @@ class Employeedetails extends BaseController
|
|||||||
$query = $this->employeedetails_model->checkAadharExists($id);
|
$query = $this->employeedetails_model->checkAadharExists($id);
|
||||||
$response = ($query !== null && !empty($query)) ? $query[0]['AadharNo'] : null;
|
$response = ($query !== null && !empty($query)) ? $query[0]['AadharNo'] : null;
|
||||||
return $this->response->setJSON($response);
|
return $this->response->setJSON($response);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -503,7 +533,9 @@ class Employeedetails extends BaseController
|
|||||||
if (in_array($photo->getExtension(), $allowedTypes)) {
|
if (in_array($photo->getExtension(), $allowedTypes)) {
|
||||||
// Generate unique file name
|
// Generate unique file name
|
||||||
$newName = $photo->getRandomName();
|
$newName = $photo->getRandomName();
|
||||||
if(!is_dir($uploadDir)) { mkdir($uploadDir, 0777, true); }
|
if (!is_dir($uploadDir)) {
|
||||||
|
mkdir($uploadDir, 0777, true);
|
||||||
|
}
|
||||||
// Move the uploaded file to the upload directory
|
// Move the uploaded file to the upload directory
|
||||||
$photo->move($uploadDir, $newName);
|
$photo->move($uploadDir, $newName);
|
||||||
|
|
||||||
@ -544,12 +576,12 @@ class Employeedetails extends BaseController
|
|||||||
$data['Location'] = $this->employeedetails_model->getConfigValue($LocationConfigID);
|
$data['Location'] = $this->employeedetails_model->getConfigValue($LocationConfigID);
|
||||||
$data['DepartmentList'] = $this->employeedetails_model->getDepartment();
|
$data['DepartmentList'] = $this->employeedetails_model->getDepartment();
|
||||||
$data['EmpDetails'] = $this->employeedetails_model->viewemployee($EmpID);
|
$data['EmpDetails'] = $this->employeedetails_model->viewemployee($EmpID);
|
||||||
$data['emp_data'] = $this->empFiles->where('emp_id',$EmpID)->where('is_active',1)->findAll();
|
$data['emp_data'] = $this->empFiles->where('emp_id', $EmpID)->where('is_active', 1)->findAll();
|
||||||
$data['empPay'] = $this->emppaydate_model->getEmpPayData($EmpID);
|
$data['empPay'] = $this->emppaydate_model->getEmpPayData($EmpID);
|
||||||
|
|
||||||
$this->global['pageTitle'] = 'View Employee';
|
$this->global['pageTitle'] = 'View Employee';
|
||||||
|
|
||||||
$this->loadViews("editEmployee", $this->global, $data, NULL);
|
$this->loadViews("editEmployeenew", $this->global, $data, NULL);
|
||||||
}
|
}
|
||||||
/* To Check the email exists in the database or not for the employee*/
|
/* To Check the email exists in the database or not for the employee*/
|
||||||
function checkMailEmp()
|
function checkMailEmp()
|
||||||
@ -571,7 +603,8 @@ class Employeedetails extends BaseController
|
|||||||
/* To Update the employee details*/
|
/* To Update the employee details*/
|
||||||
function UpdateEmployee()
|
function UpdateEmployee()
|
||||||
{
|
{
|
||||||
|
// echo "<pre>";
|
||||||
|
// print_r($this->request->getPost());die;
|
||||||
$EmpId = $this->request->getPost('employeeid');
|
$EmpId = $this->request->getPost('employeeid');
|
||||||
|
|
||||||
//$mail = $this->this->.post('emailid');
|
//$mail = $this->this->.post('emailid');
|
||||||
@ -619,7 +652,9 @@ class Employeedetails extends BaseController
|
|||||||
$allowedTypes = ['jpg', 'jpeg', 'png', 'gif'];
|
$allowedTypes = ['jpg', 'jpeg', 'png', 'gif'];
|
||||||
if (in_array($photo->getExtension(), $allowedTypes)) {
|
if (in_array($photo->getExtension(), $allowedTypes)) {
|
||||||
$newName = $photo->getRandomName();
|
$newName = $photo->getRandomName();
|
||||||
if(!is_dir($uploadDir)) { mkdir($uploadDir, 0777, true); }
|
if (!is_dir($uploadDir)) {
|
||||||
|
mkdir($uploadDir, 0777, true);
|
||||||
|
}
|
||||||
$photo->move($uploadDir, $newName);
|
$photo->move($uploadDir, $newName);
|
||||||
$Picture = $newName;
|
$Picture = $newName;
|
||||||
}
|
}
|
||||||
@ -628,17 +663,21 @@ class Employeedetails extends BaseController
|
|||||||
} else {
|
} else {
|
||||||
//echo 'Not Exists';
|
//echo 'Not Exists';
|
||||||
$photo = $this->request->getFile('photo');
|
$photo = $this->request->getFile('photo');
|
||||||
|
if(isset($photo)){
|
||||||
if ($photo->isValid() && !$photo->hasMoved()) {
|
if ($photo->isValid() && !$photo->hasMoved()) {
|
||||||
$uploadDir = ROOTPATH . 'public/uploads/images/';
|
$uploadDir = ROOTPATH . 'public/uploads/images/';
|
||||||
$allowedTypes = ['jpg', 'jpeg', 'png', 'gif'];
|
$allowedTypes = ['jpg', 'jpeg', 'png', 'gif'];
|
||||||
if (in_array($photo->getExtension(), $allowedTypes)) {
|
if (in_array($photo->getExtension(), $allowedTypes)) {
|
||||||
$newName = $photo->getRandomName();
|
$newName = $photo->getRandomName();
|
||||||
if(!is_dir($uploadDir)) { mkdir($uploadDir, 0777, true); }
|
if (!is_dir($uploadDir)) {
|
||||||
|
mkdir($uploadDir, 0777, true);
|
||||||
|
}
|
||||||
$photo->move($uploadDir, $newName);
|
$photo->move($uploadDir, $newName);
|
||||||
$Picture = $newName;
|
$Picture = $newName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//echo $Picture;
|
//echo $Picture;
|
||||||
|
|
||||||
$FirstName = $this->request->getPost('FirstName');
|
$FirstName = $this->request->getPost('FirstName');
|
||||||
@ -720,23 +759,52 @@ class Employeedetails extends BaseController
|
|||||||
$License_ExpiryDate = null;
|
$License_ExpiryDate = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//echo $DOB;
|
// echo $DOB;die;
|
||||||
$Employee = array(
|
$Employee = array(
|
||||||
'FirstName' => $FirstName, 'LastName' => $LastName, 'FatherName' => $FatherName, 'Gender' => $Gender,
|
'FirstName' => $FirstName,
|
||||||
'DateofBirth' => $DOB, 'ContactNumber' => $ContactNumber, 'EmailId' => $EmailId,
|
'LastName' => $LastName,
|
||||||
'BloodGroup' => $BloodGroup, 'MartialStatus' => $MartialStatus, 'DateofJoining' => $DOJ,
|
'FatherName' => $FatherName,
|
||||||
'PreviousYearsOfExp' => $Previousexperience, 'Designation' => $desigination,
|
'Gender' => $Gender,
|
||||||
'Departmentcode' => $departmentCode, 'PresentAddress' => $CurrentAddress,
|
'DateofBirth' => $DOB,
|
||||||
'PermanentAddress' => $permanentaddress, 'EmergencyContactName' => $emergencycontactname,
|
'ContactNumber' => $ContactNumber,
|
||||||
'EmergencyContactNumber' => $emergencycontactnumber, 'Edu_Qualification' => $eduqualifaction,
|
'EmailId' => $EmailId,
|
||||||
'Additional_Qualification' => $addqualification, 'AadharNo' => $aadharno, 'PANNo' => $panno,
|
'BloodGroup' => $BloodGroup,
|
||||||
'BankAccountNo' => $accountno, 'IFSCCode' => $ifsccode, 'BankBranchName' => $bankbranchname,
|
'MartialStatus' => $MartialStatus,
|
||||||
'BankAddress' => $bankaddress, 'PassportNo' => $passportno, 'Passport_Valid_till' => $Valid,
|
'DateofJoining' => $DOJ,
|
||||||
'IsActive' => $IsActive, 'ProfilePic' => $Picture, 'Reference_Name' => $referredby,
|
'PreviousYearsOfExp' => $Previousexperience,
|
||||||
'Reference_ContactNumber' => $referrercontno, 'Remarks' => $addinfo, 'UpdatedBY' => $UpdatedBY,
|
'Designation' => $desigination,
|
||||||
'personalEmailId' => $comEmailId, 'DriverLicense' => $driverlicense, 'LicenseValidtill' => $License_ExpiryDate,
|
'Departmentcode' => $departmentCode,
|
||||||
'VoterID' => $VoterID, 'PFNO' => $pfno, 'ESI' => $esino, 'NomineeDetails' => $Nominee,'is_management_team' => $is_management_team ,
|
'PresentAddress' => $CurrentAddress,
|
||||||
'esi_applicable'=>$esi_applicable,'pf_applicable'=>$pf_applicable,'work_location'=>$work_location
|
'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' => $License_ExpiryDate,
|
||||||
|
'VoterID' => $VoterID,
|
||||||
|
'PFNO' => $pfno,
|
||||||
|
'ESI' => $esino,
|
||||||
|
'NomineeDetails' => $Nominee,
|
||||||
|
'is_management_team' => $is_management_team,
|
||||||
|
'esi_applicable' => $esi_applicable,
|
||||||
|
'pf_applicable' => $pf_applicable,
|
||||||
|
'work_location' => $work_location
|
||||||
);
|
);
|
||||||
//print_r($Employee);die();
|
//print_r($Employee);die();
|
||||||
$result = $this->employeedetails_model->UpdateEmployee($Employee, $EmpId);
|
$result = $this->employeedetails_model->UpdateEmployee($Employee, $EmpId);
|
||||||
@ -744,14 +812,13 @@ class Employeedetails extends BaseController
|
|||||||
// Get the uploaded files
|
// Get the uploaded files
|
||||||
$files = $this->request->getFiles();
|
$files = $this->request->getFiles();
|
||||||
$fileNames = $this->request->getPost('file_name'); // Get user-entered file names
|
$fileNames = $this->request->getPost('file_name'); // Get user-entered file names
|
||||||
if(isset($files['emp_file']))
|
if (isset($files['emp_file'])) {
|
||||||
{
|
|
||||||
foreach ($files['emp_file'] as $index => $file) {
|
foreach ($files['emp_file'] as $index => $file) {
|
||||||
if ($file->isValid() && !$file->hasMoved()) {
|
if ($file->isValid() && !$file->hasMoved()) {
|
||||||
// Move the file to the desired directory
|
// Move the file to the desired directory
|
||||||
$newName = $file->getRandomName();
|
$newName = $file->getRandomName();
|
||||||
$file->move(ROOTPATH . 'public/uploads/images/emp_files', $newName);
|
$file->move(ROOTPATH . 'public/uploads/images/emp_files', $newName);
|
||||||
$path = ROOTPATH . 'public/uploads/images/emp_files/'.$newName;
|
$path = ROOTPATH . 'public/uploads/images/emp_files/' . $newName;
|
||||||
// Store the file information in the database
|
// Store the file information in the database
|
||||||
$this->empFiles->save([
|
$this->empFiles->save([
|
||||||
'file_name' => $fileNames[$index], // User-entered file name
|
'file_name' => $fileNames[$index], // User-entered file name
|
||||||
@ -780,19 +847,19 @@ class Employeedetails extends BaseController
|
|||||||
|
|
||||||
if ($result + $empPayUpdate > 0) {
|
if ($result + $empPayUpdate > 0) {
|
||||||
$this->session->setFlashdata('success', 'You Have Successfully updated the Employee Record!');
|
$this->session->setFlashdata('success', 'You Have Successfully updated the Employee Record!');
|
||||||
|
return json_encode(true);
|
||||||
} else {
|
} else {
|
||||||
$this->session->setFlashdata('error', 'Record Not Updated!');
|
$this->session->setFlashdata('error', 'Record Not Updated!');
|
||||||
|
return json_encode(false);
|
||||||
}
|
}
|
||||||
return redirect()->route('employeeListing');
|
// return redirect()->route('employeeListing');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportemployee()
|
function exportemployee()
|
||||||
{
|
{
|
||||||
|
|
||||||
$exportData = $this->employeedetails_model->export_excel();
|
$exportData = $this->employeedetails_model->export_excel();
|
||||||
|
|
||||||
$file_name = 'Employee_Details' .' '. '.xls'; //save our workbook as this file name
|
$file_name = 'Employee_Details' . ' ' . '.xls'; //save our workbook as this file name
|
||||||
$spreadsheet = new Spreadsheet();
|
$spreadsheet = new Spreadsheet();
|
||||||
$sheet = $spreadsheet->getActiveSheet();
|
$sheet = $spreadsheet->getActiveSheet();
|
||||||
$sheet->mergeCells('L3:S3');
|
$sheet->mergeCells('L3:S3');
|
||||||
@ -800,46 +867,46 @@ class Employeedetails extends BaseController
|
|||||||
$sheet->setTitle('Employee details');
|
$sheet->setTitle('Employee details');
|
||||||
|
|
||||||
$headers = [
|
$headers = [
|
||||||
'L3'=>'RESICO Employee Details',
|
'L3' => 'RESICO Employee Details',
|
||||||
'A5'=>'EmpID',
|
'A5' => 'EmpID',
|
||||||
'B5'=>'FirstName-LastName',
|
'B5' => 'FirstName-LastName',
|
||||||
'C5'=>'FatherName',
|
'C5' => 'FatherName',
|
||||||
'D5'=>'Gender',
|
'D5' => 'Gender',
|
||||||
'E5'=>'Date of Birth',
|
'E5' => 'Date of Birth',
|
||||||
'F5'=>'ContactNumber',
|
'F5' => 'ContactNumber',
|
||||||
'G5'=>'EmailId',
|
'G5' => 'EmailId',
|
||||||
'H5'=>'BloodGroup',
|
'H5' => 'BloodGroup',
|
||||||
'I5'=>'MartialStatus',
|
'I5' => 'MartialStatus',
|
||||||
'J5'=>'DateofJoining',
|
'J5' => 'DateofJoining',
|
||||||
'K5'=>'PreviousYearsOfExp',
|
'K5' => 'PreviousYearsOfExp',
|
||||||
'L5'=>'Designation',
|
'L5' => 'Designation',
|
||||||
'M5'=>'DepartmentName',
|
'M5' => 'DepartmentName',
|
||||||
'N5'=>'PresentAddress',
|
'N5' => 'PresentAddress',
|
||||||
'O5'=>'PermanentAddress',
|
'O5' => 'PermanentAddress',
|
||||||
'P5'=>'EmergencyContactName',
|
'P5' => 'EmergencyContactName',
|
||||||
'Q5'=>'EmergencyContactNumber',
|
'Q5' => 'EmergencyContactNumber',
|
||||||
'R5'=>'Edu_Qualification',
|
'R5' => 'Edu_Qualification',
|
||||||
'S5'=>'Additional_Qualification',
|
'S5' => 'Additional_Qualification',
|
||||||
'T5'=>'Reference_Name',
|
'T5' => 'Reference_Name',
|
||||||
'U5'=>'Reference_ContactNumber',
|
'U5' => 'Reference_ContactNumber',
|
||||||
'V5'=>'BankStatemant',
|
'V5' => 'BankStatemant',
|
||||||
'W5'=>'AadharNo',
|
'W5' => 'AadharNo',
|
||||||
'X5'=>'PANNo',
|
'X5' => 'PANNo',
|
||||||
'Y5'=>'PassportNo',
|
'Y5' => 'PassportNo',
|
||||||
'Z5'=>'Passport_Valid_till',
|
'Z5' => 'Passport_Valid_till',
|
||||||
'AA5'=>'Voter ID',
|
'AA5' => 'Voter ID',
|
||||||
'AB5'=>'Driving License',
|
'AB5' => 'Driving License',
|
||||||
'AC5'=>'Driving License Expiry Date',
|
'AC5' => 'Driving License Expiry Date',
|
||||||
'AD5'=>'Official Email ID',
|
'AD5' => 'Official Email ID',
|
||||||
'AE5'=>'IsActive',
|
'AE5' => 'IsActive',
|
||||||
'AF5'=>'PFNO',
|
'AF5' => 'PFNO',
|
||||||
'AG5'=>'ESI',
|
'AG5' => 'ESI',
|
||||||
'AH5'=>'Nominee Details',
|
'AH5' => 'Nominee Details',
|
||||||
// 'AI5'=>'PF_Balance',
|
// 'AI5'=>'PF_Balance',
|
||||||
// 'AJ5'=>'PF_Bal_On',
|
// 'AJ5'=>'PF_Bal_On',
|
||||||
'AI5'=>'Remarks',
|
'AI5' => 'Remarks',
|
||||||
'AJ5'=>'CreatedBy',
|
'AJ5' => 'CreatedBy',
|
||||||
'AK5'=>'UpdatedBY'
|
'AK5' => 'UpdatedBY'
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($headers as $cell => $value) {
|
foreach ($headers as $cell => $value) {
|
||||||
@ -848,49 +915,51 @@ class Employeedetails extends BaseController
|
|||||||
$sheet->getStyle($cell)->getFont()->setBold(true);
|
$sheet->getStyle($cell)->getFont()->setBold(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($exportData){
|
if ($exportData) {
|
||||||
$i = 6;$s = 1;
|
$i = 6;
|
||||||
|
$s = 1;
|
||||||
foreach ($exportData as $data) {
|
foreach ($exportData as $data) {
|
||||||
$rowData = [
|
$rowData = [
|
||||||
'A'. $i,$data['EmpID'],
|
'A' . $i,
|
||||||
'B'. $i=>$data['FirstName'].'-'.$data['LastName'],
|
$data['EmpID'],
|
||||||
'C'. $i=>$data['FatherName'],
|
'B' . $i => $data['FirstName'] . '-' . $data['LastName'],
|
||||||
'D'. $i=>$data['Gender'],
|
'C' . $i => $data['FatherName'],
|
||||||
'E'. $i=>$data['DateofBirth'],
|
'D' . $i => $data['Gender'],
|
||||||
'F'. $i=>$data['ContactNumber'],
|
'E' . $i => $data['DateofBirth'],
|
||||||
'G'. $i=>$data['EmailId'],
|
'F' . $i => $data['ContactNumber'],
|
||||||
'H'. $i=>$data['BloodGroup'],
|
'G' . $i => $data['EmailId'],
|
||||||
'I'. $i=>$data['MartialStatus'],
|
'H' . $i => $data['BloodGroup'],
|
||||||
'J'. $i=>$data['DateofJoining'],
|
'I' . $i => $data['MartialStatus'],
|
||||||
'K'. $i=>$data['PreviousYearsOfExp'],
|
'J' . $i => $data['DateofJoining'],
|
||||||
'L'. $i=>$data['Designation'],
|
'K' . $i => $data['PreviousYearsOfExp'],
|
||||||
'M'. $i=>$data['DepartmentName'],
|
'L' . $i => $data['Designation'],
|
||||||
'N'. $i=>$data['PresentAddress'],
|
'M' . $i => $data['DepartmentName'],
|
||||||
'O'. $i=>$data['PermanentAddress'],
|
'N' . $i => $data['PresentAddress'],
|
||||||
'P'. $i=>$data['EmergencyContactName'],
|
'O' . $i => $data['PermanentAddress'],
|
||||||
'Q'. $i=>$data['EmergencyContactNumber'],
|
'P' . $i => $data['EmergencyContactName'],
|
||||||
'R'. $i=>$data['Edu_Qualification'],
|
'Q' . $i => $data['EmergencyContactNumber'],
|
||||||
'S'. $i=>$data['Additional_Qualification'],
|
'R' . $i => $data['Edu_Qualification'],
|
||||||
'T'. $i=>$data['Reference_Name'],
|
'S' . $i => $data['Additional_Qualification'],
|
||||||
'U'. $i=>$data['Reference_ContactNumber'],
|
'T' . $i => $data['Reference_Name'],
|
||||||
'V'. $i=>$data['BankAccountNo'].'-'.$data['IFSCCode'].'-'.$data['BankBranchName'].$data['BankAddress'],
|
'U' . $i => $data['Reference_ContactNumber'],
|
||||||
'W'. $i=>$data['AadharNo'],
|
'V' . $i => $data['BankAccountNo'] . '-' . $data['IFSCCode'] . '-' . $data['BankBranchName'] . $data['BankAddress'],
|
||||||
'X'. $i=>$data['PANNo'],
|
'W' . $i => $data['AadharNo'],
|
||||||
'Y'. $i=>$data['PassportNo'],
|
'X' . $i => $data['PANNo'],
|
||||||
'Z'. $i=>$data['Passport_Valid_till'],
|
'Y' . $i => $data['PassportNo'],
|
||||||
'AA'. $i=>$data['VoterID'],
|
'Z' . $i => $data['Passport_Valid_till'],
|
||||||
'AB'. $i=>$data['DriverLicense'],
|
'AA' . $i => $data['VoterID'],
|
||||||
'AC'. $i=>$data['LicenseValidtill'],
|
'AB' . $i => $data['DriverLicense'],
|
||||||
'AD'. $i=>$data['personalEmailId'],
|
'AC' . $i => $data['LicenseValidtill'],
|
||||||
'AE'. $i=>$data['IsActive'],
|
'AD' . $i => $data['personalEmailId'],
|
||||||
'AF'. $i=>$data['PFNO'],
|
'AE' . $i => $data['IsActive'],
|
||||||
'AG'. $i=>$data['ESI'],
|
'AF' . $i => $data['PFNO'],
|
||||||
'AH'. $i=>$data['NomineeDetails'],
|
'AG' . $i => $data['ESI'],
|
||||||
|
'AH' . $i => $data['NomineeDetails'],
|
||||||
// 'AI'. $i=>$data['PF_Balance'],
|
// 'AI'. $i=>$data['PF_Balance'],
|
||||||
// 'AJ'. $i=>$data['PF_Bal_On'],
|
// 'AJ'. $i=>$data['PF_Bal_On'],
|
||||||
'AI'. $i=>$data['Remarks'],
|
'AI' . $i => $data['Remarks'],
|
||||||
'AJ'. $i=>$data['CreatedByName'],
|
'AJ' . $i => $data['CreatedByName'],
|
||||||
'AK'. $i=>$data['UpdatedByName'],
|
'AK' . $i => $data['UpdatedByName'],
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($rowData as $cell => $value) {
|
foreach ($rowData as $cell => $value) {
|
||||||
@ -900,7 +969,6 @@ class Employeedetails extends BaseController
|
|||||||
$i++;
|
$i++;
|
||||||
$s++;
|
$s++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// $writer = new Xlsx($spreadsheet);
|
// $writer = new Xlsx($spreadsheet);
|
||||||
// $writer->save($file_name);
|
// $writer->save($file_name);
|
||||||
@ -920,7 +988,7 @@ class Employeedetails extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||||
header('Content-Disposition: attachment;filename="'. $file_name .'"');
|
header('Content-Disposition: attachment;filename="' . $file_name . '"');
|
||||||
header('Cache-Control: max-age=0');
|
header('Cache-Control: max-age=0');
|
||||||
header('Expires: 0');
|
header('Expires: 0');
|
||||||
header('Pragma: public');
|
header('Pragma: public');
|
||||||
@ -928,6 +996,4 @@ class Employeedetails extends BaseController
|
|||||||
$writer->save('php://output');
|
$writer->save('php://output');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
1420
app/Views/addEmployeenew.php
Normal file
1420
app/Views/addEmployeenew.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -814,12 +814,14 @@ legend {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="col-md-6 pad"><span>Personal Email ID</span>
|
<div class="col-md-6 pad">
|
||||||
|
<span>Personal Email ID</span>
|
||||||
<input type="mail" name="emailid"
|
<input type="mail" name="emailid"
|
||||||
value="<?php echo $EmailId ; ?>" id="email"
|
value="<?php echo $EmailId ; ?>" id="email"
|
||||||
placeholder="Email ID" maxlength="100" class="form-control">
|
placeholder="Email ID" maxlength="100" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 pad"> <span>Official Email ID</span>
|
<div class="col-md-6 pad">
|
||||||
|
<span>Official Email ID</span>
|
||||||
<input type="email" name="comemailid" id="mail"
|
<input type="email" name="comemailid" id="mail"
|
||||||
placeholder="Official Email ID"
|
placeholder="Official Email ID"
|
||||||
value="<?php echo $personalEmailId;?>" maxlength="100"
|
value="<?php echo $personalEmailId;?>" maxlength="100"
|
||||||
@ -887,7 +889,8 @@ legend {
|
|||||||
<!-- Text input-->
|
<!-- Text input-->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-md-12 pad">
|
<div class="col-md-12 pad">
|
||||||
<div class="col-md-12"><span>Current Address</span><span
|
<div class="col-md-12">
|
||||||
|
<span>Current Address</span><span
|
||||||
class="badge">*</span>
|
class="badge">*</span>
|
||||||
<input type="text" id="currentaddress" pattern=".{1,500}"
|
<input type="text" id="currentaddress" pattern=".{1,500}"
|
||||||
required name="currentaddress" maxlength="500"
|
required name="currentaddress" maxlength="500"
|
||||||
@ -908,7 +911,8 @@ legend {
|
|||||||
<!-- Text input-->
|
<!-- Text input-->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-md-12 pad">
|
<div class="col-md-12 pad">
|
||||||
<div class="col-md-12"><span>Permanent Address</span><span
|
<div class="col-md-12">
|
||||||
|
<span>Permanent Address</span><span
|
||||||
class="badge">*</span>
|
class="badge">*</span>
|
||||||
<input type="text" id="permanentaddress" required
|
<input type="text" id="permanentaddress" required
|
||||||
name="permanentaddress" pattern=".{0,500}"
|
name="permanentaddress" pattern=".{0,500}"
|
||||||
@ -927,13 +931,15 @@ legend {
|
|||||||
<!-- Text input-->
|
<!-- Text input-->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-md-12 pad">
|
<div class="col-md-12 pad">
|
||||||
<div class="col-md-6"><span>Emergency Contact Name</span>
|
<div class="col-md-6">
|
||||||
|
<span>Emergency Contact Name</span>
|
||||||
<input type="text" id="emergencycontactname" maxlength="100"
|
<input type="text" id="emergencycontactname" maxlength="100"
|
||||||
name="emergencycontactname"
|
name="emergencycontactname"
|
||||||
value="<?php echo $EmergencyContactName ; ?>"
|
value="<?php echo $EmergencyContactName ; ?>"
|
||||||
placeholder="Emergency Contact Name" class="form-control">
|
placeholder="Emergency Contact Name" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6"><span>Emergency Contact Number</span>
|
<div class="col-md-6">
|
||||||
|
<span>Emergency Contact Number</span>
|
||||||
<input type="text" id="emergencycontactnumber"
|
<input type="text" id="emergencycontactnumber"
|
||||||
name="emergencycontactnumber"
|
name="emergencycontactnumber"
|
||||||
onchange="getValidEmergencyNumber();" maxlength="10"
|
onchange="getValidEmergencyNumber();" maxlength="10"
|
||||||
@ -953,7 +959,8 @@ legend {
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-md-12 pad">
|
<div class="col-md-12 pad">
|
||||||
<div class="col-md-3"><span>Designation</span><span
|
<div class="col-md-3">
|
||||||
|
<span>Designation</span><span
|
||||||
class="badge">*</span>
|
class="badge">*</span>
|
||||||
<select type="text" id="desigination" name="desigination"
|
<select type="text" id="desigination" name="desigination"
|
||||||
required class="form-control select2">
|
required class="form-control select2">
|
||||||
@ -975,7 +982,8 @@ legend {
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3"><span>Department</span><span
|
<div class="col-md-3">
|
||||||
|
<span>Department</span><span
|
||||||
class="badge">*</span>
|
class="badge">*</span>
|
||||||
<select type="text" id="departmentname" name="departmentname"
|
<select type="text" id="departmentname" name="departmentname"
|
||||||
required class="form-control select2">
|
required class="form-control select2">
|
||||||
@ -999,7 +1007,8 @@ legend {
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3"><span>Date Of Joining</span><span
|
<div class="col-md-3">
|
||||||
|
<span>Date Of Joining</span><span
|
||||||
class="badge">*</span>
|
class="badge">*</span>
|
||||||
<input id="dateofjoining" name="dateofjoining"
|
<input id="dateofjoining" name="dateofjoining"
|
||||||
value="<?php echo $DOJ; ?>" maxlength="10" required
|
value="<?php echo $DOJ; ?>" maxlength="10" required
|
||||||
@ -1051,7 +1060,8 @@ legend {
|
|||||||
placeholder="Referred By" maxlength="100"
|
placeholder="Referred By" maxlength="100"
|
||||||
class="form-control">
|
class="form-control">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3" style="display:none"><span>Referrer Contact Number</span>
|
<div class="col-md-3" style="display:none">
|
||||||
|
<span>Referrer Contact Number</span>
|
||||||
<input type="text" id="referrercontno" name="referrercontno"
|
<input type="text" id="referrercontno" name="referrercontno"
|
||||||
value="<?php echo $Reference_ContactNumber ; ?>"
|
value="<?php echo $Reference_ContactNumber ; ?>"
|
||||||
onchange="getValidReferNumber();" maxlength="10"
|
onchange="getValidReferNumber();" maxlength="10"
|
||||||
@ -1384,16 +1394,6 @@ legend {
|
|||||||
|
|
||||||
<div class="files">
|
<div class="files">
|
||||||
|
|
||||||
<div class="col-md-12 ">
|
|
||||||
<div class="col-md-10"></div>
|
|
||||||
<div class="col-md-2">
|
|
||||||
<button type="button" class="btn btn-primary btn-sm a1"
|
|
||||||
onclick="appendFilesFileds()" id="day">
|
|
||||||
Add New File
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php foreach ($emp_data as $key => $value) { ?>
|
<?php foreach ($emp_data as $key => $value) { ?>
|
||||||
|
|
||||||
<div class="col-md-12 pad ">
|
<div class="col-md-12 pad ">
|
||||||
@ -1414,6 +1414,7 @@ legend {
|
|||||||
id="<?= $value['id']; ?>"
|
id="<?= $value['id']; ?>"
|
||||||
onclick="removeContact(this)">Delete</button>
|
onclick="removeContact(this)">Delete</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@ -1526,8 +1527,8 @@ function appendFilesFileds(data) {
|
|||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
$('#filesContainer').append(newRowHtml);
|
$('#filesContainer').append(newRowHtml);
|
||||||
$('.a1').hide();
|
// $('.a1').hide();
|
||||||
$('#filesContainer .pad:last .a1').show();
|
// $('#filesContainer .pad:last .a1').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeContact(button) {
|
function removeContact(button) {
|
||||||
|
|||||||
1693
app/Views/editEmployeenew.php
Normal file
1693
app/Views/editEmployeenew.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -135,6 +135,13 @@
|
|||||||
<script src="<?php echo base_url(); ?>public/new_assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
|
<script src="<?php echo base_url(); ?>public/new_assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- -->
|
||||||
|
<!-- Plugins js-->
|
||||||
|
<script src="<?php echo base_url(); ?>public/new_assets/libs/twitter-bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>
|
||||||
|
|
||||||
|
<!-- Init js-->
|
||||||
|
<script src="<?php echo base_url(); ?>public/new_assets/js/pages/form-wizard.init.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user