diff --git a/app/Controllers/Employeedetails.php b/app/Controllers/Employeedetails.php index 33c68cc4..0ab265e6 100644 --- a/app/Controllers/Employeedetails.php +++ b/app/Controllers/Employeedetails.php @@ -35,8 +35,8 @@ class Employeedetails extends BaseController protected $appConfig; protected $emppaydate_model; protected $session; - - + + /** * This is default constructor of the class */ @@ -51,7 +51,6 @@ class Employeedetails extends BaseController $this->session = session(); helper('form'); //$this->load->library('form_validation'); $this->isLoggedIn(); - } /** * This function is used to load the Employee details @@ -202,176 +201,209 @@ class Employeedetails extends BaseController function AddNewEmployee() { + // print_r($this->request->getPost());die; - - $photo = $this->request->getFile('photo'); - $Picture = ""; + $photo = $this->request->getFile('photo'); + $Picture = ""; + if(isset($photoan)){ if ($photo->isValid() && !$photo->hasMoved()) { - $uploadDir = ROOTPATH . 'public/uploads/images/'; - $allowedTypes = ['jpg', 'jpeg', 'png', 'gif']; - if (in_array($photo->getExtension(), $allowedTypes)) { - $newName = $photo->getRandomName(); - if(!is_dir($uploadDir)) { mkdir($uploadDir, 0777, true); } - $photo->move($uploadDir, $newName); - $Picture = $newName; - } + $uploadDir = ROOTPATH . 'public/uploads/images/'; + $allowedTypes = ['jpg', 'jpeg', 'png', 'gif']; + if (in_array($photo->getExtension(), $allowedTypes)) { + $newName = $photo->getRandomName(); + if (!is_dir($uploadDir)) { + mkdir($uploadDir, 0777, true); + } + $photo->move($uploadDir, $newName); + $Picture = $newName; + } } - // $Profile = $this->request->getPost('photo'); - $FirstName = $this->request->getPost('FirstName'); - $FatherName = $this->request->getPost('FatherName'); - $DateofBirth = $this->request->getPost('DateofBirth'); - $ContactNumber = $this->request->getPost('ContactNumber'); - $EmailId = $this->request->getPost('emailid'); - $comEmailId = $this->request->getPost('comemailid'); - $Gender = $this->request->getPost('gender'); - $MartialStatus = $this->request->getPost('MartialStatus'); - $BloodGroup = $this->request->getPost('bloodgroup'); - $CurrentAddress = $this->request->getPost('currentaddress'); - $permanentaddress = $this->request->getPost('permanentaddress'); - $emergencycontactname = $this->request->getPost('emergencycontactname'); - $emergencycontactnumber = $this->request->getPost('emergencycontactnumber'); - $desigination = $this->request->getPost('desigination'); - $departmentCode = $this->request->getPost('departmentname'); - $dateofjoining = $this->request->getPost('dateofjoining'); - $pre_experience = $this->request->getPost('Previousexperience'); + } + // $Profile = $this->request->getPost('photo'); + $FirstName = $this->request->getPost('FirstName'); + $FatherName = $this->request->getPost('FatherName'); + $DateofBirth = $this->request->getPost('DateofBirth'); + $ContactNumber = $this->request->getPost('ContactNumber'); + $EmailId = $this->request->getPost('emailid'); + $comEmailId = $this->request->getPost('comemailid'); + $Gender = $this->request->getPost('gender'); + $MartialStatus = $this->request->getPost('MartialStatus'); + $BloodGroup = $this->request->getPost('bloodgroup'); + $CurrentAddress = $this->request->getPost('currentaddress'); + $permanentaddress = $this->request->getPost('permanentaddress'); + $emergencycontactname = $this->request->getPost('emergencycontactname'); + $emergencycontactnumber = $this->request->getPost('emergencycontactnumber'); + $desigination = $this->request->getPost('desigination'); + $departmentCode = $this->request->getPost('departmentname'); + $dateofjoining = $this->request->getPost('dateofjoining'); + $pre_experience = $this->request->getPost('Previousexperience'); - if ($pre_experience == '') { - $Previousexperience = null; - } else { - $Previousexperience = $pre_experience; - } + if ($pre_experience == '') { + $Previousexperience = null; + } else { + $Previousexperience = $pre_experience; + } - $eduqualifaction = $this->request->getPost('eduqualifaction'); - $addqualification = $this->request->getPost('addqualification'); - $referredby = $this->request->getPost('referredby'); - $referrercontno = $this->request->getPost('referrercontno'); - $accountno = $this->request->getPost('accountno'); - $ifsccode = $this->request->getPost('ifsccode'); - $bankbranchname = $this->request->getPost('bankbranchname'); - $bankaddress = $this->request->getPost('bankaddress'); - $aadharno = $this->request->getPost('aadharno'); - $panno = $this->request->getPost('panno'); - $panno = $panno !== null && is_string($panno) ? strtoupper($panno) : null; - $passportno = $this->request->getPost('passportno'); - $passportno = $passportno !== null && is_string($passportno) ? strtoupper($passportno) : null; - $ValidTill = $this->request->getPost('ValidTill'); - $addinfo = $this->request->getPost('addinfo'); - $IsActive = '1'; - $driverlicense = $this->request->getPost('driverlicense'); - $driverlicense = $driverlicense !== null && is_string($driverlicense) ? strtoupper($driverlicense) : null; - $licenseExpiryDate = $this->request->getPost('licenseExpiryDate'); - $VoterID = $this->request->getPost('voterID'); - $VoterID = $VoterID !== null && is_string($VoterID) ? strtoupper($VoterID) : null; - $PFno = $this->request->getPost('pfno'); - $ESIno = $this->request->getPost('esino'); - $Nominee = $this->request->getPost('nomineename'); - $createdby = $this->session->get('userId'); - $is_management_team = $this->request->getPost('is_management_team'); - $esi_applicable = $this->request->getPost('esi_applicable'); - $pf_applicable = $this->request->getPost('pf_applicable'); - $work_location = $this->request->getPost('work_location'); + $eduqualifaction = $this->request->getPost('eduqualifaction'); + $addqualification = $this->request->getPost('addqualification'); + $referredby = $this->request->getPost('referredby'); + $referrercontno = $this->request->getPost('referrercontno'); + $accountno = $this->request->getPost('accountno'); + $ifsccode = $this->request->getPost('ifsccode'); + $bankbranchname = $this->request->getPost('bankbranchname'); + $bankaddress = $this->request->getPost('bankaddress'); + $aadharno = $this->request->getPost('aadharno'); + $panno = $this->request->getPost('panno'); + $panno = $panno !== null && is_string($panno) ? strtoupper($panno) : null; + $passportno = $this->request->getPost('passportno'); + $passportno = $passportno !== null && is_string($passportno) ? strtoupper($passportno) : null; + $ValidTill = $this->request->getPost('ValidTill'); + $addinfo = $this->request->getPost('addinfo'); + $IsActive = '1'; + $driverlicense = $this->request->getPost('driverlicense'); + $driverlicense = $driverlicense !== null && is_string($driverlicense) ? strtoupper($driverlicense) : null; + $licenseExpiryDate = $this->request->getPost('licenseExpiryDate'); + $VoterID = $this->request->getPost('voterID'); + $VoterID = $VoterID !== null && is_string($VoterID) ? strtoupper($VoterID) : null; + $PFno = $this->request->getPost('pfno'); + $ESIno = $this->request->getPost('esino'); + $Nominee = $this->request->getPost('nomineename'); + $createdby = $this->session->get('userId'); + $is_management_team = $this->request->getPost('is_management_team'); + $esi_applicable = $this->request->getPost('esi_applicable'); + $pf_applicable = $this->request->getPost('pf_applicable'); + $work_location = $this->request->getPost('work_location'); - if ($licenseExpiryDate != '') { - //$License_ExpiryDate = get_date_format($licenseExpiryDate); - $License_ExpiryDate = get_date_time_format($licenseExpiryDate); - } else { - $License_ExpiryDate = null; - } + if ($licenseExpiryDate != '') { + //$License_ExpiryDate = get_date_format($licenseExpiryDate); + $License_ExpiryDate = get_date_time_format($licenseExpiryDate); + } else { + $License_ExpiryDate = null; + } - $DOB = get_date_time_format($DateofBirth); - $DOJ = get_date_time_format($dateofjoining); + $DOB = get_date_time_format($DateofBirth); + $DOJ = get_date_time_format($dateofjoining); - if ($ValidTill != '') { + if ($ValidTill != '') { - $Valid = get_date_time_format($ValidTill); - } else { - $Valid = null; - } + $Valid = get_date_time_format($ValidTill); + } else { + $Valid = null; + } - //echo $DOB; - $Employee = array( - 'FirstName' => $FirstName, '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' => $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 - ); + //echo $DOB; + $Employee = array( + 'FirstName' => $FirstName, + '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' => $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(); - $result = $this->employeedetails_model->addNewemployee($Employee); + //print_r($Employee);die(); + $result = $this->employeedetails_model->addNewemployee($Employee); - if ($result) { + if ($result) { - // Get the uploaded files - $files = $this->request->getFiles(); - $fileNames = $this->request->getPost('file_name'); // Get user-entered file names - if(isset($files['emp_file'])) - { + // Get the uploaded files + $files = $this->request->getFiles(); + $fileNames = $this->request->getPost('file_name'); // Get user-entered file names + if (isset($files['emp_file'])) { foreach ($files['emp_file'] as $index => $file) { - if ($file->isValid() && !$file->hasMoved()) { - // Move the file to the desired directory - $newName = $file->getRandomName(); - $file->move(ROOTPATH . 'public/uploads/images/emp_files', $newName); - $path = ROOTPATH . 'public/uploads/images/emp_files/'.$newName; - // Store the file information in the database - $this->empFiles->save([ - 'file_name' => $fileNames[$index], // User-entered file name - 'emp_file' => $newName, // New file name - 'emp_id' => $result, - 'path' => $path - - ]); - } + if ($file->isValid() && !$file->hasMoved()) { + // Move the file to the desired directory + $newName = $file->getRandomName(); + $file->move(ROOTPATH . 'public/uploads/images/emp_files', $newName); + $path = ROOTPATH . 'public/uploads/images/emp_files/' . $newName; + // Store the file information in the database + $this->empFiles->save([ + 'file_name' => $fileNames[$index], // User-entered file name + 'emp_file' => $newName, // New file name + 'emp_id' => $result, + 'path' => $path + + ]); + } } } - $EmpID = $result; - $Total_Salary = $this->request->getPost('Total_salary'); - $Basic_Pay = $this->request->getPost('Basic_Pay'); - $HRA_Rate = $this->request->getPost('HRA_Rate'); - $HRA_Amount = $this->request->getPost('HRA_Amount'); - $PF_Rate = $this->request->getPost('PF_Rate'); - $ESI_Rate = $this->request->getPost('ESI_Rate'); - $CreateBy = $this->session->get('userId'); + $EmpID = $result; + $Total_Salary = $this->request->getPost('Total_salary'); + $Basic_Pay = $this->request->getPost('Basic_Pay'); + $HRA_Rate = $this->request->getPost('HRA_Rate'); + $HRA_Amount = $this->request->getPost('HRA_Amount'); + $PF_Rate = $this->request->getPost('PF_Rate'); + $ESI_Rate = $this->request->getPost('ESI_Rate'); + $CreateBy = $this->session->get('userId'); - $emppay = array('EmpID' => $EmpID, 'TotalSalary' => $Total_Salary, 'Basic_Pay' => $Basic_Pay, 'HRA_Rate' => $HRA_Rate, 'HRA_Amount' => $HRA_Amount, 'PF_Rate' => $PF_Rate, 'ESI_Rate' => $ESI_Rate, 'Created_By' => $CreateBy); - + $emppay = array('EmpID' => $EmpID, 'TotalSalary' => $Total_Salary, 'Basic_Pay' => $Basic_Pay, 'HRA_Rate' => $HRA_Rate, 'HRA_Amount' => $HRA_Amount, 'PF_Rate' => $PF_Rate, 'ESI_Rate' => $ESI_Rate, 'Created_By' => $CreateBy); - $this->emppaydate_model->addNewemppay($emppay); - // $this->session->set_flashdata('Success', 'New Employee created successfully!'); - $this->session->setFlashdata('success', 'New Employee created successfully!'); - // echo ""; - } else { + $this->emppaydate_model->addNewemppay($emppay); - // $this->session->set_flashdata('Error', 'New Employee details not saved'); - $this->session->setFlashdata('error', 'Record Not Saved!'); - // echo ""; - // redirect('employeeListing', 'refresh'); - } - return redirect()->route('employeeListing'); + // $this->session->set_flashdata('Success', 'New Employee created successfully!'); + $this->session->setFlashdata('success', 'New Employee created successfully!'); + return json_encode('true'); + // echo ""; + } else { + + // $this->session->set_flashdata('Error', 'New Employee details not saved'); + $this->session->setFlashdata('error', 'Record Not Saved!'); + return json_encode('false'); + // echo ""; + // redirect('employeeListing', 'refresh'); + } + // return redirect()->route('employeeListing'); // } } - function deleteEmployeeFile(){ + function deleteEmployeeFile() + { $id = $this->request->getPost('id'); - $update = $this->empFiles->set(['is_active' => 0])->where('id',$id)->update(); - if($update){ + $update = $this->empFiles->set(['is_active' => 0])->where('id', $id)->update(); + if ($update) { return true; - }else{ + } else { return false; } } @@ -379,8 +411,6 @@ class Employeedetails extends BaseController * This function is used to load the add new Employee form with dropdown values */ function addemployee() { - - $GenderConfigID = 'C013'; $MartialConfigID = 'C012'; $QualificationConfigID = 'C014'; @@ -396,16 +426,17 @@ class Employeedetails extends BaseController $data['BloodGroup'] = $this->employeedetails_model->getConfigValue($BloodGroupConfigID); $data['Location'] = $this->employeedetails_model->getConfigValue($LocationConfigID); $data['Department'] = $this->employeedetails_model->getDepartment(); - $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['esi_rate'] = $this->appConfig->where('config_key',3)->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['esi_rate'] = $this->appConfig->where('config_key', 3)->get()->getRow()->config_value; $this->global['pageTitle'] = 'Add New Employee'; // 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); // } @@ -422,7 +453,7 @@ class Employeedetails extends BaseController { $id = $this->request->getPost('id'); //print_r($id); - + $query = $this->employeedetails_model->checkMailExists($id); $response = ($query !== null && !empty($query)) ? $query[0]['EmailId'] : null; return $this->response->setJSON($response); @@ -433,7 +464,7 @@ class Employeedetails extends BaseController $id = $this->request->getPost('id'); //print_r($id); - + $query = $this->employeedetails_model->checkPANExists($id); $response = ($query !== null && !empty($query)) ? $query[0]['PANNo'] : null; return $this->response->setJSON($response); @@ -445,11 +476,10 @@ class Employeedetails extends BaseController $id = $this->request->getPost('id'); //print_r($id); - + $query = $this->employeedetails_model->checkAadharExists($id); $response = ($query !== null && !empty($query)) ? $query[0]['AadharNo'] : null; return $this->response->setJSON($response); - } @@ -460,7 +490,7 @@ class Employeedetails extends BaseController $Empid = $this->request->getPost('employeeid'); $PanNo = $this->request->getPost('panno'); - + $query = $this->employeedetails_model->checkPANExists($PanNo, $Empid); if (count($query) > 0) { // $this->validator->setMessage('Pan_validate_emp', 'The Entered PAN Number is already exists in the Database.'); @@ -476,7 +506,7 @@ class Employeedetails extends BaseController { $Empid = $this->request->getPost('employeeid'); $AadharNo = $this->request->getPost('aadharno'); - + $query = $this->employeedetails_model->checkAadharExists($AadharNo, $Empid); if (count($query) > 0) { // $this->validator->setMessage('Aadhar_validate_emp', 'The Entered Aadhar Number is exists in the Database.'); @@ -487,36 +517,38 @@ class Employeedetails extends BaseController } } - + public function add($photo) - { - $picture = ''; + { + $picture = ''; - - if ($photo->isValid() && !$photo->hasMoved()) { - // Define upload directory and allowed file types - $uploadDir = ROOTPATH . 'public/uploads/images/'; - $allowedTypes = ['jpg', 'jpeg', 'png', 'gif']; - // Validate file type - if (in_array($photo->getExtension(), $allowedTypes)) { - // Generate unique file name - $newName = $photo->getRandomName(); - if(!is_dir($uploadDir)) { mkdir($uploadDir, 0777, true); } - // Move the uploaded file to the upload directory - $photo->move($uploadDir, $newName); + if ($photo->isValid() && !$photo->hasMoved()) { + // Define upload directory and allowed file types + $uploadDir = ROOTPATH . 'public/uploads/images/'; + $allowedTypes = ['jpg', 'jpeg', 'png', 'gif']; - $picture = $newName; - } else { - // Handle invalid file type - $picture = ''; - } + // Validate file type + if (in_array($photo->getExtension(), $allowedTypes)) { + // Generate unique file name + $newName = $photo->getRandomName(); + if (!is_dir($uploadDir)) { + mkdir($uploadDir, 0777, true); } + // Move the uploaded file to the upload directory + $photo->move($uploadDir, $newName); - return $picture; + $picture = $newName; + } else { + // Handle invalid file type + $picture = ''; + } } + return $picture; + } + function ViewEmployee($EmpNO = '') { @@ -533,7 +565,7 @@ class Employeedetails extends BaseController $DesignationConfigID = 'C010'; $BloodGroupConfigID = 'C011'; $LocationConfigID = 'C031'; - + //print_r('hai'); $data['GenderList'] = $this->employeedetails_model->getConfigValue($GenderConfigID); $data['MartialList'] = $this->employeedetails_model->getConfigValue($MartialConfigID); @@ -544,12 +576,12 @@ class Employeedetails extends BaseController $data['Location'] = $this->employeedetails_model->getConfigValue($LocationConfigID); $data['DepartmentList'] = $this->employeedetails_model->getDepartment(); $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); $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*/ function checkMailEmp() @@ -571,9 +603,10 @@ class Employeedetails extends BaseController /* To Update the employee details*/ function UpdateEmployee() { - + // echo "
";
+    // print_r($this->request->getPost());die;
     $EmpId =  $this->request->getPost('employeeid');
-    
+
     //$mail = $this->this->.post('emailid');
     // $this->validator->setRules([
     //   'ContactNumber'=> 'trim|required|min_length[10]|max_length[10]',
@@ -598,174 +631,208 @@ class Employeedetails extends BaseController
     //   $this->ViewEmployee($EmpId);
     // } else {
 
-      
-      $EmpId =  $this->request->getPost('employeeid');
-      $PictureName = $this->request->getPost('Image');
-      $ModifyPictureName = $this->request->getPost('ModifyImage');
-      $Picture = "";
-      if ($PictureName != '') {
-        //echo  'Exists';
-        //$Picture = $PictureName; 
-        if (strlen((string)$ModifyPictureName) == 0) {
-          //echo  'Exists But Not replace';
-          $Picture = $PictureName;
-        } else {
-          //echo  'Exists But Replace';
-          //$Picture = $ModifyPictureName;
-          //$Picture = $this->editimage($ModifyPictureName);  
-          $photo = $this->request->getFile('ModifyImage');
-          if ($photo->isValid() && !$photo->hasMoved()) {
-            $uploadDir = ROOTPATH . 'public/uploads/images/';
-            $allowedTypes = ['jpg', 'jpeg', 'png', 'gif'];
-            if (in_array($photo->getExtension(), $allowedTypes)) {
-                $newName = $photo->getRandomName();
-                if(!is_dir($uploadDir)) { mkdir($uploadDir, 0777, true); }
-                $photo->move($uploadDir, $newName);
-                $Picture = $newName;
-            } 
-          }
-        }
+
+    $EmpId =  $this->request->getPost('employeeid');
+    $PictureName = $this->request->getPost('Image');
+    $ModifyPictureName = $this->request->getPost('ModifyImage');
+    $Picture = "";
+    if ($PictureName != '') {
+      //echo  'Exists';
+      //$Picture = $PictureName; 
+      if (strlen((string)$ModifyPictureName) == 0) {
+        //echo  'Exists But Not replace';
+        $Picture = $PictureName;
       } else {
-        //echo  'Not Exists';
-        $photo = $this->request->getFile('photo');
+        //echo  'Exists But Replace';
+        //$Picture = $ModifyPictureName;
+        //$Picture = $this->editimage($ModifyPictureName);  
+        $photo = $this->request->getFile('ModifyImage');
         if ($photo->isValid() && !$photo->hasMoved()) {
           $uploadDir = ROOTPATH . 'public/uploads/images/';
           $allowedTypes = ['jpg', 'jpeg', 'png', 'gif'];
           if (in_array($photo->getExtension(), $allowedTypes)) {
-              $newName = $photo->getRandomName();
-              if(!is_dir($uploadDir)) { mkdir($uploadDir, 0777, true); }
-              $photo->move($uploadDir, $newName);
-              $Picture = $newName;
-          } 
+            $newName = $photo->getRandomName();
+            if (!is_dir($uploadDir)) {
+              mkdir($uploadDir, 0777, true);
+            }
+            $photo->move($uploadDir, $newName);
+            $Picture = $newName;
+          }
         }
       }
-      //echo  $Picture;         
-
-      $FirstName = $this->request->getPost('FirstName');
-      $LastName = $this->request->getPost('LastName');
-      $FatherName = $this->request->getPost('FatherName');
-      $DateofBirth = $this->request->getPost('DateofBirth');
-      $ContactNumber = $this->request->getPost('ContactNumber');
-      $EmailId = $this->request->getPost('emailid');
-      $comEmailId = $this->request->getPost('comemailid');
-      $Gender =  $this->request->getPost('gender');
-      $MartialStatus =  $this->request->getPost('MartialStatus');
-      $BloodGroup =  $this->request->getPost('bloodgroup');
-      $CurrentAddress =  $this->request->getPost('currentaddress');
-      $permanentaddress =  $this->request->getPost('permanentaddress');
-      $emergencycontactname =  $this->request->getPost('emergencycontactname');
-      $emergencycontactnumber =  $this->request->getPost('emergencycontactnumber');
-      $desigination =  $this->request->getPost('desigination');
-      $departmentCode =  $this->request->getPost('departmentname');
-      $dateofjoining =  $this->request->getPost('dateofjoining');
-      //$Previousexperience =  $this->request->getPost('Previousexperience');
-      $pre_experience =  $this->request->getPost('Previousexperience');
-
-      if ($pre_experience == '') {
-        $Previousexperience = null;
-      } else {
-        $Previousexperience = $pre_experience;
-      }
-      $eduqualifaction =  $this->request->getPost('eduqualifaction');
-      $addqualification = $this->request->getPost('addqualification');
-      $referredby = $this->request->getPost('referredby');
-      $referrercontno = $this->request->getPost('referrercontno');
-      $accountno = $this->request->getPost('accountno');
-      $ifsccode = $this->request->getPost('ifsccode');
-      $bankbranchname = $this->request->getPost('bankbranchname');
-      $bankaddress = $this->request->getPost('bankaddress');
-      $aadharno = $this->request->getPost('aadharno');
-      $panno = $this->request->getPost('panno');
-      $panno = $panno !== null && is_string($panno) ? strtoupper($panno) : null;
-      $passportno = $this->request->getPost('passportno');
-      $passportno = $passportno !== null && is_string($passportno) ? strtoupper($passportno) : null;
-      $ValidTill = $this->request->getPost('ValidTill');
-      $addinfo = $this->request->getPost('addinfo');
-      $driverlicense = $this->request->getPost('driverlicense');
-      $driverlicense = $driverlicense !== null && is_string($driverlicense) ? strtoupper($driverlicense) : null;
-      $licenseExpiryDate = $this->request->getPost('LicenseExpiryDate');
-      $VoterID = $this->request->getPost('voterID');
-      $VoterID = $VoterID !== null && is_string($VoterID) ? strtoupper($VoterID) : null;
-      $pfno = $this->request->getPost('pfno');
-      $pfno = $pfno !== null && is_string($pfno) ? strtoupper($pfno) : null;
-      //$uano = $this->request->getPost('uano'); 
-      $esino = $this->request->getPost('esino');
-      $Nominee = $this->request->getPost('nomineename');
-      $chked =  $this->request->getPost('isactive');
-      $is_management_team = $this->request->getPost('is_management_team');
-      $esi_applicable = $this->request->getPost('esi_applicable');
-      $pf_applicable = $this->request->getPost('pf_applicable');
-      $work_location = $this->request->getPost('work_location');
-      // echo 'chkvalue'.  $chked ;
-      if ($chked != '') {
-        $IsActive = '1';
-      } else {
-        $IsActive = '0';
-      }
-      // echo 'chkvalue'. $IsActive ;
-      $UpdatedBY = $this->session->get('userId');
-
-      //$licenseExpiryDate =  get_date_time_format($licenseExpiryDate);
-      $DOB = get_date_format($DateofBirth);
-      $DOJ =  get_date_format($dateofjoining);
-      if ($ValidTill != '') {
-        $Valid =  get_date_format($ValidTill);
-      } else {
-        $Valid = null;
-      }
-
-      if ($licenseExpiryDate != '') {
-        $License_ExpiryDate =  get_date_format($licenseExpiryDate);
-      } else {
-        $License_ExpiryDate = null;
-      }
-
-      //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,
-        '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();
-      $result = $this->employeedetails_model->UpdateEmployee($Employee, $EmpId);
-
-      // Get the uploaded files
-      $files = $this->request->getFiles();
-      $fileNames = $this->request->getPost('file_name'); // Get user-entered file names
-      if(isset($files['emp_file']))
-      {
-      foreach ($files['emp_file'] as $index => $file) {
-          if ($file->isValid() && !$file->hasMoved()) {
-              // Move the file to the desired directory
-              $newName = $file->getRandomName();
-              $file->move(ROOTPATH . 'public/uploads/images/emp_files', $newName);
-              $path = ROOTPATH . 'public/uploads/images/emp_files/'.$newName;
-              // Store the file information in the database
-              $this->empFiles->save([
-                  'file_name' => $fileNames[$index], // User-entered file name
-                  'emp_file' => $newName, // New file name
-                  'emp_id' => $EmpId,
-                  'path' => $path
-                  
-              ]);
+    } else {
+      //echo  'Not Exists';
+      $photo = $this->request->getFile('photo');
+      if(isset($photo)){
+        if ($photo->isValid() && !$photo->hasMoved()) {
+          $uploadDir = ROOTPATH . 'public/uploads/images/';
+          $allowedTypes = ['jpg', 'jpeg', 'png', 'gif'];
+          if (in_array($photo->getExtension(), $allowedTypes)) {
+            $newName = $photo->getRandomName();
+            if (!is_dir($uploadDir)) {
+              mkdir($uploadDir, 0777, true);
+            }
+            $photo->move($uploadDir, $newName);
+            $Picture = $newName;
           }
+        }
+      }
+    }
+    //echo  $Picture;         
+
+    $FirstName = $this->request->getPost('FirstName');
+    $LastName = $this->request->getPost('LastName');
+    $FatherName = $this->request->getPost('FatherName');
+    $DateofBirth = $this->request->getPost('DateofBirth');
+    $ContactNumber = $this->request->getPost('ContactNumber');
+    $EmailId = $this->request->getPost('emailid');
+    $comEmailId = $this->request->getPost('comemailid');
+    $Gender =  $this->request->getPost('gender');
+    $MartialStatus =  $this->request->getPost('MartialStatus');
+    $BloodGroup =  $this->request->getPost('bloodgroup');
+    $CurrentAddress =  $this->request->getPost('currentaddress');
+    $permanentaddress =  $this->request->getPost('permanentaddress');
+    $emergencycontactname =  $this->request->getPost('emergencycontactname');
+    $emergencycontactnumber =  $this->request->getPost('emergencycontactnumber');
+    $desigination =  $this->request->getPost('desigination');
+    $departmentCode =  $this->request->getPost('departmentname');
+    $dateofjoining =  $this->request->getPost('dateofjoining');
+    //$Previousexperience =  $this->request->getPost('Previousexperience');
+    $pre_experience =  $this->request->getPost('Previousexperience');
+
+    if ($pre_experience == '') {
+      $Previousexperience = null;
+    } else {
+      $Previousexperience = $pre_experience;
+    }
+    $eduqualifaction =  $this->request->getPost('eduqualifaction');
+    $addqualification = $this->request->getPost('addqualification');
+    $referredby = $this->request->getPost('referredby');
+    $referrercontno = $this->request->getPost('referrercontno');
+    $accountno = $this->request->getPost('accountno');
+    $ifsccode = $this->request->getPost('ifsccode');
+    $bankbranchname = $this->request->getPost('bankbranchname');
+    $bankaddress = $this->request->getPost('bankaddress');
+    $aadharno = $this->request->getPost('aadharno');
+    $panno = $this->request->getPost('panno');
+    $panno = $panno !== null && is_string($panno) ? strtoupper($panno) : null;
+    $passportno = $this->request->getPost('passportno');
+    $passportno = $passportno !== null && is_string($passportno) ? strtoupper($passportno) : null;
+    $ValidTill = $this->request->getPost('ValidTill');
+    $addinfo = $this->request->getPost('addinfo');
+    $driverlicense = $this->request->getPost('driverlicense');
+    $driverlicense = $driverlicense !== null && is_string($driverlicense) ? strtoupper($driverlicense) : null;
+    $licenseExpiryDate = $this->request->getPost('LicenseExpiryDate');
+    $VoterID = $this->request->getPost('voterID');
+    $VoterID = $VoterID !== null && is_string($VoterID) ? strtoupper($VoterID) : null;
+    $pfno = $this->request->getPost('pfno');
+    $pfno = $pfno !== null && is_string($pfno) ? strtoupper($pfno) : null;
+    //$uano = $this->request->getPost('uano'); 
+    $esino = $this->request->getPost('esino');
+    $Nominee = $this->request->getPost('nomineename');
+    $chked =  $this->request->getPost('isactive');
+    $is_management_team = $this->request->getPost('is_management_team');
+    $esi_applicable = $this->request->getPost('esi_applicable');
+    $pf_applicable = $this->request->getPost('pf_applicable');
+    $work_location = $this->request->getPost('work_location');
+    // echo 'chkvalue'.  $chked ;
+    if ($chked != '') {
+      $IsActive = '1';
+    } else {
+      $IsActive = '0';
+    }
+    // echo 'chkvalue'. $IsActive ;
+    $UpdatedBY = $this->session->get('userId');
+
+    //$licenseExpiryDate =  get_date_time_format($licenseExpiryDate);
+    $DOB = get_date_format($DateofBirth);
+    $DOJ =  get_date_format($dateofjoining);
+    if ($ValidTill != '') {
+      $Valid =  get_date_format($ValidTill);
+    } else {
+      $Valid = null;
+    }
+
+    if ($licenseExpiryDate != '') {
+      $License_ExpiryDate =  get_date_format($licenseExpiryDate);
+    } else {
+      $License_ExpiryDate = null;
+    }
+
+    // echo $DOB;die;
+    $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' => $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();
+    $result = $this->employeedetails_model->UpdateEmployee($Employee, $EmpId);
+
+    // Get the uploaded files
+    $files = $this->request->getFiles();
+    $fileNames = $this->request->getPost('file_name'); // Get user-entered file names
+    if (isset($files['emp_file'])) {
+      foreach ($files['emp_file'] as $index => $file) {
+        if ($file->isValid() && !$file->hasMoved()) {
+          // Move the file to the desired directory
+          $newName = $file->getRandomName();
+          $file->move(ROOTPATH . 'public/uploads/images/emp_files', $newName);
+          $path = ROOTPATH . 'public/uploads/images/emp_files/' . $newName;
+          // Store the file information in the database
+          $this->empFiles->save([
+            'file_name' => $fileNames[$index], // User-entered file name
+            'emp_file' => $newName, // New file name
+            'emp_id' => $EmpId,
+            'path' => $path
+
+          ]);
+        }
       }
     }
 
 
-   
+
     $Total_Salary = $this->request->getPost('Total_salary');
     $Basic_Pay = $this->request->getPost('Basic_Pay');
     $HRA_Rate = $this->request->getPost('HRA_Rate');
@@ -774,160 +841,159 @@ class Employeedetails extends BaseController
     $ESI_Rate = $this->request->getPost('ESI_Rate');
     $CreateBy =   $this->session->get('userId');
     $emppay = array('EmpID' => $EmpId, 'TotalSalary' => $Total_Salary, 'Basic_Pay' => $Basic_Pay, 'HRA_Rate' => $HRA_Rate, 'HRA_Amount' => $HRA_Amount,  'PF_Rate' => $PF_Rate, 'ESI_Rate' => $ESI_Rate, 'Created_By' => $CreateBy);
-  
+
 
     $empPayUpdate = $this->emppaydate_model->editemppay($emppay);
 
-      if ($result + $empPayUpdate > 0) {
-        $this->session->setFlashdata('success', 'You Have Successfully updated the Employee Record!');
-      } else {
-        $this->session->setFlashdata('error', 'Record Not Updated!');
-      }
-      return redirect()->route('employeeListing');
-
+    if ($result + $empPayUpdate > 0) {
+      $this->session->setFlashdata('success', 'You Have Successfully updated the Employee Record!');
+      return json_encode(true);
+    } else {
+      $this->session->setFlashdata('error', 'Record Not Updated!');
+      return json_encode(false);
+    }
+    // return redirect()->route('employeeListing');
   }
 
   function exportemployee()
-	{
-		
+  {
     $exportData = $this->employeedetails_model->export_excel();
 
-    $file_name = 'Employee_Details' .' '.  '.xls'; //save our workbook as this file name
-		$spreadsheet = new Spreadsheet();
-		$sheet = $spreadsheet->getActiveSheet();
-        $sheet->mergeCells('L3:S3');
-        $sheet->getStyle('L3')->getAlignment()->setHorizontal('center');    
-        $sheet->setTitle('Employee details');
+    $file_name = 'Employee_Details' . ' ' .  '.xls'; //save our workbook as this file name
+    $spreadsheet = new Spreadsheet();
+    $sheet = $spreadsheet->getActiveSheet();
+    $sheet->mergeCells('L3:S3');
+    $sheet->getStyle('L3')->getAlignment()->setHorizontal('center');
+    $sheet->setTitle('Employee details');
 
-        $headers = [
-          'L3'=>'RESICO Employee Details',
-          'A5'=>'EmpID',
-          'B5'=>'FirstName-LastName',
-          'C5'=>'FatherName',
-          'D5'=>'Gender',
-          'E5'=>'Date of Birth',
-          'F5'=>'ContactNumber',
-          'G5'=>'EmailId',
-          'H5'=>'BloodGroup',
-          'I5'=>'MartialStatus',
-          'J5'=>'DateofJoining',
-          'K5'=>'PreviousYearsOfExp',
-          'L5'=>'Designation',
-          'M5'=>'DepartmentName',
-          'N5'=>'PresentAddress',
-          'O5'=>'PermanentAddress',
-          'P5'=>'EmergencyContactName',
-          'Q5'=>'EmergencyContactNumber',
-          'R5'=>'Edu_Qualification',
-          'S5'=>'Additional_Qualification',
-          'T5'=>'Reference_Name',
-          'U5'=>'Reference_ContactNumber',
-          'V5'=>'BankStatemant',
-          'W5'=>'AadharNo',
-          'X5'=>'PANNo',
-          'Y5'=>'PassportNo',
-          'Z5'=>'Passport_Valid_till',
-          'AA5'=>'Voter ID',
-          'AB5'=>'Driving License',
-          'AC5'=>'Driving License Expiry Date',
-          'AD5'=>'Official Email ID',
-          'AE5'=>'IsActive',
-          'AF5'=>'PFNO',
-          'AG5'=>'ESI',
-          'AH5'=>'Nominee Details',
-          // 'AI5'=>'PF_Balance',
-          // 'AJ5'=>'PF_Bal_On',
-          'AI5'=>'Remarks',
-          'AJ5'=>'CreatedBy',
-          'AK5'=>'UpdatedBY'
+    $headers = [
+      'L3' => 'RESICO Employee Details',
+      'A5' => 'EmpID',
+      'B5' => 'FirstName-LastName',
+      'C5' => 'FatherName',
+      'D5' => 'Gender',
+      'E5' => 'Date of Birth',
+      'F5' => 'ContactNumber',
+      'G5' => 'EmailId',
+      'H5' => 'BloodGroup',
+      'I5' => 'MartialStatus',
+      'J5' => 'DateofJoining',
+      'K5' => 'PreviousYearsOfExp',
+      'L5' => 'Designation',
+      'M5' => 'DepartmentName',
+      'N5' => 'PresentAddress',
+      'O5' => 'PermanentAddress',
+      'P5' => 'EmergencyContactName',
+      'Q5' => 'EmergencyContactNumber',
+      'R5' => 'Edu_Qualification',
+      'S5' => 'Additional_Qualification',
+      'T5' => 'Reference_Name',
+      'U5' => 'Reference_ContactNumber',
+      'V5' => 'BankStatemant',
+      'W5' => 'AadharNo',
+      'X5' => 'PANNo',
+      'Y5' => 'PassportNo',
+      'Z5' => 'Passport_Valid_till',
+      'AA5' => 'Voter ID',
+      'AB5' => 'Driving License',
+      'AC5' => 'Driving License Expiry Date',
+      'AD5' => 'Official Email ID',
+      'AE5' => 'IsActive',
+      'AF5' => 'PFNO',
+      'AG5' => 'ESI',
+      'AH5' => 'Nominee Details',
+      // 'AI5'=>'PF_Balance',
+      // 'AJ5'=>'PF_Bal_On',
+      'AI5' => 'Remarks',
+      'AJ5' => 'CreatedBy',
+      'AK5' => 'UpdatedBY'
+    ];
+
+    foreach ($headers as $cell => $value) {
+      $sheet->setCellValue($cell, $value);
+      $sheet->getStyle($cell)->getFont()->setSize($cell == 'L3' ? 14 : 12);
+      $sheet->getStyle($cell)->getFont()->setBold(true);
+    }
+
+    if ($exportData) {
+      $i = 6;
+      $s = 1;
+      foreach ($exportData as $data) {
+        $rowData = [
+          'A' . $i,
+          $data['EmpID'],
+          'B' . $i => $data['FirstName'] . '-' . $data['LastName'],
+          'C' . $i => $data['FatherName'],
+          'D' . $i => $data['Gender'],
+          'E' . $i => $data['DateofBirth'],
+          'F' . $i => $data['ContactNumber'],
+          'G' . $i => $data['EmailId'],
+          'H' . $i => $data['BloodGroup'],
+          'I' . $i => $data['MartialStatus'],
+          'J' . $i => $data['DateofJoining'],
+          'K' . $i => $data['PreviousYearsOfExp'],
+          'L' . $i => $data['Designation'],
+          'M' . $i => $data['DepartmentName'],
+          'N' . $i => $data['PresentAddress'],
+          'O' . $i => $data['PermanentAddress'],
+          'P' . $i => $data['EmergencyContactName'],
+          'Q' . $i => $data['EmergencyContactNumber'],
+          'R' . $i => $data['Edu_Qualification'],
+          'S' . $i => $data['Additional_Qualification'],
+          'T' . $i => $data['Reference_Name'],
+          'U' . $i => $data['Reference_ContactNumber'],
+          'V' . $i => $data['BankAccountNo'] . '-' . $data['IFSCCode'] . '-' . $data['BankBranchName'] . $data['BankAddress'],
+          'W' . $i => $data['AadharNo'],
+          'X' . $i => $data['PANNo'],
+          'Y' . $i => $data['PassportNo'],
+          'Z' . $i => $data['Passport_Valid_till'],
+          'AA' . $i => $data['VoterID'],
+          'AB' . $i => $data['DriverLicense'],
+          'AC' . $i => $data['LicenseValidtill'],
+          'AD' . $i => $data['personalEmailId'],
+          'AE' . $i => $data['IsActive'],
+          'AF' . $i => $data['PFNO'],
+          'AG' . $i => $data['ESI'],
+          'AH' . $i => $data['NomineeDetails'],
+          // 'AI'. $i=>$data['PF_Balance'],
+          // 'AJ'. $i=>$data['PF_Bal_On'],
+          'AI' . $i => $data['Remarks'],
+          'AJ' . $i => $data['CreatedByName'],
+          'AK' . $i => $data['UpdatedByName'],
         ];
-        
-        foreach ($headers as $cell => $value) {
-            $sheet->setCellValue($cell, $value);
-            $sheet->getStyle($cell)->getFont()->setSize($cell == 'L3' ? 14 : 12);
-            $sheet->getStyle($cell)->getFont()->setBold(true);
+
+        foreach ($rowData as $cell => $value) {
+          $sheet->setCellValue($cell, $value);
         }
 
-        if($exportData){
-            $i = 6;$s = 1;
-            foreach ($exportData as $data) {
-                $rowData = [
-                  'A'. $i,$data['EmpID'],
-                  'B'. $i=>$data['FirstName'].'-'.$data['LastName'],
-                  'C'. $i=>$data['FatherName'],
-                  'D'. $i=>$data['Gender'],
-                  'E'. $i=>$data['DateofBirth'],
-                  'F'. $i=>$data['ContactNumber'],
-                  'G'. $i=>$data['EmailId'],
-                  'H'. $i=>$data['BloodGroup'],
-                  'I'. $i=>$data['MartialStatus'],
-                  'J'. $i=>$data['DateofJoining'],
-                  'K'. $i=>$data['PreviousYearsOfExp'],
-                  'L'. $i=>$data['Designation'],
-                  'M'. $i=>$data['DepartmentName'],
-                  'N'. $i=>$data['PresentAddress'],
-                  'O'. $i=>$data['PermanentAddress'],
-                  'P'. $i=>$data['EmergencyContactName'],
-                  'Q'. $i=>$data['EmergencyContactNumber'],
-                  'R'. $i=>$data['Edu_Qualification'],
-                  'S'. $i=>$data['Additional_Qualification'],
-                  'T'. $i=>$data['Reference_Name'],
-                  'U'. $i=>$data['Reference_ContactNumber'],
-                  'V'. $i=>$data['BankAccountNo'].'-'.$data['IFSCCode'].'-'.$data['BankBranchName'].$data['BankAddress'],
-                  'W'. $i=>$data['AadharNo'],
-                  'X'. $i=>$data['PANNo'],
-                  'Y'. $i=>$data['PassportNo'],
-                  'Z'. $i=>$data['Passport_Valid_till'],
-                  'AA'. $i=>$data['VoterID'],
-                  'AB'. $i=>$data['DriverLicense'],
-                  'AC'. $i=>$data['LicenseValidtill'],
-                  'AD'. $i=>$data['personalEmailId'],
-                  'AE'. $i=>$data['IsActive'],
-                  'AF'. $i=>$data['PFNO'],
-                  'AG'. $i=>$data['ESI'],
-                  'AH'. $i=>$data['NomineeDetails'],
-                  // 'AI'. $i=>$data['PF_Balance'],
-                  // 'AJ'. $i=>$data['PF_Bal_On'],
-                  'AI'. $i=>$data['Remarks'],
-                  'AJ'. $i=>$data['CreatedByName'],
-                  'AK'. $i=>$data['UpdatedByName'],
-                ];
-
-                foreach ($rowData as $cell => $value) {
-                    $sheet->setCellValue($cell, $value);
-                }
-
-                $i++;
-                $s++;
-            }
-
-        }
-		// $writer = new Xlsx($spreadsheet);
-		// $writer->save($file_name);
-		// header("Content-Type: application/vnd.ms-excel");
-		// header('Content-Disposition: attachment; filename="' . basename($file_name) . '"');
-		// header('Expires: 0');
-		// header('Cache-Control: must-revalidate');
-		// header('Pragma: public');
-		// header('Content-Length:' . filesize($file_name));
-		// flush();
-		// readfile($file_name);
-		// exit;
+        $i++;
+        $s++;
+      }
+    }
+    // $writer = new Xlsx($spreadsheet);
+    // $writer->save($file_name);
+    // header("Content-Type: application/vnd.ms-excel");
+    // header('Content-Disposition: attachment; filename="' . basename($file_name) . '"');
+    // header('Expires: 0');
+    // header('Cache-Control: must-revalidate');
+    // header('Pragma: public');
+    // header('Content-Length:' . filesize($file_name));
+    // flush();
+    // readfile($file_name);
+    // exit;
     // Clear the output buffer to prevent any other output
     ob_clean();
 
     $writer = new Xlsx($spreadsheet);
-    
+
 
     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('Expires: 0');
     header('Pragma: public');
 
     $writer->save('php://output');
     exit;
-	}
-
-
   }
+}
diff --git a/app/Views/addEmployeenew.php b/app/Views/addEmployeenew.php
new file mode 100644
index 00000000..a48c2f4c
--- /dev/null
+++ b/app/Views/addEmployeenew.php
@@ -0,0 +1,1420 @@
+
+
+
+
+
+
+
+
+
+
+
+

Add Employee

+
+
+
+ Back +
+
+
+ + +
+ +
+ +
+
+ +
+
+ your image
+ + +
+
+
+
+
+ Full Name* + +
+ +
Father / Husband Name* + +
+ +
Contact Number* + +
+ +
Gender* + +
+
Date Of Birth* + +
+
+
+
Age + +
+
Personal Email ID + +
+
Official Email ID + +
+
+ + Blood group* + +
+ +
+ Marital Status* + +
+
+
+
+ Current Address* + +
+
+ Current address same as permanent address +
+
+ Permanent Address* + +
+
+
+
+ Emergency Contact Name + +
+ +
+ Emergency Contact Number + +
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+
Designation* + + +
+
Department* + + +
+
Date Of Joining* + +
+
Previous Years of Experience + +
+
+
+ +
Qualification* + + +
+ + + +
+
+ +
Work Location* + + +
+
+
+ Management + Team + +
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+
Bank Name* + +
+
Account Number* + +
+
IFSC Code* + +
+
Bank Address + +
+
+
+ + +
+
+
+
+
+
+
+
+ Total Salary + * + + + +
+
+
+
+ Basic Pay + * + + +
+
+
+
+ HRA Rate(%) + * + + +
+
+
+
+ HRA Amount + * + + +
+
+
+
+ ESI + Applicable + +
+
+
+
ESI Number + +
+
+
+
+ ESI Rate(%) + * + + +
+
+
+
+
+ PF + Applicable + +
+
+
+
UAN + +
+
+ +
+
+ PF Rate(%) + * + + +
+
+
+
+ +
+ +
+ +
+ +
+
+
+
+
+
+
+
Aadhar Number * + +
+
PAN Number + +
+
Passport Number + +
+
Passport Expiry Date + +
+ +
Voter ID + +
+
Driving License + +
+ +
Driving License Expiry Date + +
+ +
+
+
+
+
+
+
+
+
Nominee reference + +
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ File Name + +
+
+ File + +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/app/Views/editEmployee.php b/app/Views/editEmployee.php index 4826c3d1..f4b6b9b3 100644 --- a/app/Views/editEmployee.php +++ b/app/Views/editEmployee.php @@ -814,12 +814,14 @@ legend {
-
Personal Email ID +
+ Personal Email ID
-
Official Email ID +
+ Official Email ID
-
Current Address + Current Address*
-
Permanent Address + Permanent Address*
-
Emergency Contact Name +
+ Emergency Contact Name
-
Emergency Contact Number +
+ Emergency Contact Number
-
Designation + Designation*
-
Department + Department*
-
Date Of Joining + Date Of Joining*
- `; $('#filesContainer').append(newRowHtml); - $('.a1').hide(); - $('#filesContainer .pad:last .a1').show(); + // $('.a1').hide(); + // $('#filesContainer .pad:last .a1').show(); } function removeContact(button) { diff --git a/app/Views/editEmployeenew.php b/app/Views/editEmployeenew.php new file mode 100644 index 00000000..46dc8e0c --- /dev/null +++ b/app/Views/editEmployeenew.php @@ -0,0 +1,1693 @@ + +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; + $BloodGroup = $Emp->BloodGroup; + $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; + $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; + if (!empty($Emp->ProfilePic)) { + $ProfilePic = 'public/uploads/images/' . $Emp->ProfilePic; + } else { + $ProfilePic = '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; + } +} +?> + +
+
+
+
+
+
+
+
+
+

Edit Employee

+
+
+
+ Back +
+
+
+ + +
+ +
+ +
+
+ +
+
+ your image
+ + + + + + + + + name="isactive" value="1"> IS ACTIVE + +
+
+
+
+
+ Full Name* + +
+ +
+ Father / Husband Name* + +
+ +
+ Date Of Birth* + +
+ +
+ Age* + +
+
+ Contact Number* + +
+
+
+
+ Gender* + +
+
+ Personal Email ID + +
+
+ Official Email ID + +
+
+ + Blood group* + +
+ +
+ Marital Status* + +
+
+
+
+ Current Address* + +
+
+ Current address same as permanent + address +
+
+ Permanent Address* + +
+
+
+
+ Emergency Contact Name + +
+ +
+ Emergency Contact Number + +
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+
+ Designation* + + + +
+
+ Department* + + +
+
+ Date Of Joining* + +
+
+ Previous Years of Experience + +
+
+
+ +
+ Qualification* + +
+ + + +
+
+ +
+ Work Location* + + +
+
+
+ Management + Team + +
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+
+ Bank Name + + +
+
+ Account Number + +
+
+ IFSC Code + +
+
+ Bank Address + +
+
+
+ + +
+
+
+
+
+
+
+
+ + Total Salary + * + + + +
+
+
+
+ Basic Pay + * + + +
+
+
+
+ HRA Rate(%) + * + + + +
+
+
+
+ HRA Amount + * + + + +
+
+
+
+ ESI + Applicable + +
+
+
+
+ ESI Number + +
+
+
+
+ ESI Rate(%) + * + + + +
+
+
+
+
+ PF + Applicable + +
+
+
+
+ UAN + +
+
+ +
+
+ PF Rate(%) + * + + +
+
+
+
+ +
+ +
+ +
+ +
+
+
+
+
+
+
+
+ Aadhar Number * + +
+
+ PAN Number + +
+
+ Passport Number + +
+
+ Passport Expiry Date + +
+ +
+ Voter ID + +
+
+ Driving License + + +
+ +
+ Driving License Expiry Date + +
+ +
+
+
+
+
+
+
+
+
+ Nominee reference + +
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+
+ + + 0) { + foreach ($emp_data as $key => $value) { ?> + +
+
+ File Name + +
+
+ + + +
+
+ +
+
+ + +
+ File Name + +
+
+ File + +
+
+ +
+ + +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/app/Views/includes/new_footer.php b/app/Views/includes/new_footer.php index 31ec9b10..7a90c9d0 100644 --- a/app/Views/includes/new_footer.php +++ b/app/Views/includes/new_footer.php @@ -13,46 +13,46 @@
@@ -135,6 +135,13 @@ + + + + + + +