diff --git a/app/Controllers/Employeedetails.php b/app/Controllers/Employeedetails.php index 4a150801..1c020e38 100755 --- a/app/Controllers/Employeedetails.php +++ b/app/Controllers/Employeedetails.php @@ -198,6 +198,40 @@ class Employeedetails extends BaseController /** * This function is used to save the new Employee form in the database */ + /** + * This function is used to save the new Employee form in the database + */ + /** + * This function is used to save the new Employee form in the database + */ + /** + * This function is used to save the new Employee form in the database + */ + /** + * This function is used to save the new Employee form in the database + */ + /** + * This function is used to save the new Employee form in the database + */ + /** + * This function is used to save the new Employee form in the database + */ + /** + * This function is used to save the new Employee form in the database + */ + /** + * This function is used to save the new Employee form in the database + */ + /** + * This function is used to save the new Employee form in the database + */ + /** + * This function is used to save the new Employee form in the database + */ + /** + * This function is used to save the new Employee form in the database + */ + function AddNewEmployee() { @@ -338,11 +372,25 @@ class Employeedetails extends BaseController 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'])) { - foreach ($files['emp_file'] as $index => $file) { - if ($file->isValid() && !$file->hasMoved()) { + $files1 = $this->request->getFile('emp_file1'); + $files2 = $this->request->getFile('emp_file2'); + $files3 = $this->request->getFile('emp_file3'); + $files4 = $this->request->getFile('emp_file4'); + $files5 = $this->request->getFile('emp_file5'); + + $files=[$files1,$files2,$files3,$files4,$files5]; + + $fileName1 = $this->request->getPost('file_name1'); + $fileName2 = $this->request->getPost('file_name2'); + $fileName3 = $this->request->getPost('file_name3'); + $fileName4 = $this->request->getPost('file_name4'); + $fileName5 = $this->request->getPost('file_name5'); + + $fileNames=[$fileName1,$fileName2,$fileName3,$fileName4,$fileName5]; + + if (!empty($files)) { + foreach ($files as $index => $file) { + if ($file && $file->isValid() && !$file->hasMoved()) { // Move the file to the desired directory $newName = $file->getRandomName(); $file->move(ROOTPATH . 'public/uploads/images/emp_files', $newName); @@ -351,16 +399,15 @@ class Employeedetails extends BaseController $this->empFiles->save([ 'file_name' => $fileNames[$index], // User-entered file name 'emp_file' => $newName, // New file name - 'emp_id' => $result, + 'emp_id' => $result['EmpID'], 'path' => $path - ]); } } } - $EmpID = $result; + $EmpID = $result['EmpID']; $Total_Salary = $this->request->getPost('Total_salary'); $Basic_Pay = $this->request->getPost('Basic_Pay'); $HRA_Rate = $this->request->getPost('HRA_Rate'); @@ -613,19 +660,46 @@ class Employeedetails extends BaseController } } + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + /* To Update the employee details*/ + + function UpdateEmployee() { - $EmpId = $this->request->getPost('employeeid'); + $EmpId = $this->request->getGet('empId'); - - - - - - - $EmpId = $this->request->getPost('employeeid'); $PictureName = $this->request->getPost('Image'); $ModifyPictureName = $this->request->getPost('ModifyImage'); $Picture = ""; @@ -816,27 +890,41 @@ class Employeedetails extends BaseController //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 - ]); - } - } - } + // Get the uploaded files + $files1 = $this->request->getFile('emp_file1'); + $files2 = $this->request->getFile('emp_file2'); + $files3 = $this->request->getFile('emp_file3'); + $files4 = $this->request->getFile('emp_file4'); + $files5 = $this->request->getFile('emp_file5'); + + $files=[$files1,$files2,$files3,$files4,$files5]; + + $fileName1 = $this->request->getPost('file_name1'); + $fileName2 = $this->request->getPost('file_name2'); + $fileName3 = $this->request->getPost('file_name3'); + $fileName4 = $this->request->getPost('file_name4'); + $fileName5 = $this->request->getPost('file_name5'); + + $fileNames=[$fileName1,$fileName2,$fileName3,$fileName4,$fileName5]; + + if (!empty($files)) { + foreach ($files as $index => $file) { + if ($file && $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 + ]); + } + } + } diff --git a/app/Models/EmpFilesModel.php b/app/Models/EmpFilesModel.php index 7fb6f630..78ee5d28 100755 --- a/app/Models/EmpFilesModel.php +++ b/app/Models/EmpFilesModel.php @@ -21,4 +21,3 @@ class EmpFilesModel extends Model ]; } -?> \ No newline at end of file diff --git a/app/Models/Employeedetails_model.php b/app/Models/Employeedetails_model.php index 07678ecb..7b1a7333 100755 --- a/app/Models/Employeedetails_model.php +++ b/app/Models/Employeedetails_model.php @@ -86,7 +86,7 @@ class Employeedetails_model extends Model $query = $builder->get(); $result = $query->getRowArray(); - return $result['EmpID']; + return $result; } else { return 0; diff --git a/app/Views/addEmployeenew.php b/app/Views/addEmployeenew.php index 846ee606..690ced32 100755 --- a/app/Views/addEmployeenew.php +++ b/app/Views/addEmployeenew.php @@ -423,13 +423,7 @@ Proof - +
@@ -1003,19 +997,37 @@
-
+
-
*
-
+ +
+ + +
+
+ + +
+ + + + +
+ +
+ +
-
+ +
+ + +
+
+ + +
+
+ + +
+ +
- - +
+ + +
+
+ + +
+ +
+
+
+ + +
+
+ + +
+
+ +
+
+
+ + +
+
+ + +
+
+
@@ -1042,48 +1103,11 @@ -
- -
- -
-
-
-
-
- -
- - -
-
- - -
-
- -
-
- -
-
-
- - -
+
@@ -1122,28 +1146,6 @@ } } - function appendFilesFileds(data) { - var newRowHtml = ` -
-
- File name - -
-
- File - -
-
- - -
-
`; - - $('#filesContainer').append(newRowHtml); - $('.a1').hide(); - $('#filesContainer .pad:last .a1').show(); - } - function removeContact(button) { $(button).closest('.pad').remove(); $('#filesContainer .a1').hide(); @@ -1457,7 +1459,7 @@ var combinedFormData = new FormData(); // Use FormData to handle files // List of form IDs you want to combine - var formIds = ['#accountForm', '#profileForm', '#bankForm', '#proofForm', '#fileForm']; // Add all your form IDs here + var formIds = ['#accountForm', '#profileForm', '#bankForm', '#proofForm',]; // Add all your form IDs here formIds.forEach(function(formId) { var $form = $(formId); diff --git a/app/Views/editEmployeenew.php b/app/Views/editEmployeenew.php index edf6deb2..e51b9720 100755 --- a/app/Views/editEmployeenew.php +++ b/app/Views/editEmployeenew.php @@ -58,8 +58,8 @@ $uano = ''; $is_management_team = 0; $esi_applicable = 0; $pf_applicable = 0; -$TDS_Rate=''; -$tds_apllicable=0; +$TDS_Rate = ''; +$tds_apllicable = 0; if (!empty($EmpDetails)) { foreach ($EmpDetails as $Emp) { @@ -96,8 +96,8 @@ if (!empty($EmpDetails)) { $IFSCCode = $Emp->IFSCCode; $BankBranchName = $Emp->BankBranchName; $BankAddress = $Emp->BankAddress; - $TDS_Rate=$Emp->TDS_Rate; - $tds_applicable =$Emp->tds_applicable; + $TDS_Rate = $Emp->TDS_Rate; + $tds_applicable = $Emp->tds_applicable; $PassportNo = $Emp->PassportNo; $Passport_Valid_till = $Emp->Passport_Valid_till; if ($Passport_Valid_till != '' && $Passport_Valid_till != '0000-00-00 00:00:00') { @@ -145,6 +145,7 @@ if (!empty($EmpDetails)) { } ?> +
@@ -191,13 +192,7 @@ if (!empty($EmpDetails)) { Proof - +
@@ -213,27 +208,29 @@ if (!empty($EmpDetails)) {
your image - + src="" + alt="your image" style="width: 139px;" /> +
-
+
-
@@ -311,7 +311,8 @@ if (!empty($EmpDetails)) {
* +
@@ -387,7 +389,7 @@ if (!empty($EmpDetails)) {
-
@@ -403,7 +405,7 @@ if (!empty($EmpDetails)) {
- +
@@ -501,8 +503,9 @@ if (!empty($EmpDetails)) {
* - @@ -552,8 +555,9 @@ if (!empty($EmpDetails)) {
* - @@ -575,7 +579,8 @@ if (!empty($EmpDetails)) {
@@ -625,7 +631,7 @@ if (!empty($EmpDetails)) {
- +