diff --git a/api-payroll/public/html/editEmployee.php b/api-payroll/public/html/editEmployee.php index 5f9c3df..a8a311b 100644 --- a/api-payroll/public/html/editEmployee.php +++ b/api-payroll/public/html/editEmployee.php @@ -1,13 +1,22 @@ - +
-

New employee

+

Edit employee

+
+
+ +
+ +
+
+
+
diff --git a/api-payroll/public/html/landing.php b/api-payroll/public/html/landing.php index 3acffa6..c74b868 100644 --- a/api-payroll/public/html/landing.php +++ b/api-payroll/public/html/landing.php @@ -226,6 +226,7 @@ if(!isset($_SESSION['userName'])){ + diff --git a/api-payroll/public/js/editEmployee.js b/api-payroll/public/js/editEmployee.js index e69de29..c639a3d 100644 --- a/api-payroll/public/js/editEmployee.js +++ b/api-payroll/public/js/editEmployee.js @@ -0,0 +1,42 @@ +/** + * Bootstrapping the starting actions for the module + */ +$(document).ready(function(){ + let baseUrl = getbaseUrl(); + + let productos = new Bloodhound({ + datumTokenizer: Bloodhound.tokenizers.obj.whitespace("name"), + queryTokenizer: Bloodhound.tokenizers.whitespace, + remote: { + 'cache': false, + url: baseUrl + '/api/employee/find', + + replace: function(url, uriEncodedQuery) { + + return url + '/' + uriEncodedQuery + + }, + wildcard: '%QUERY', + filter: function (data) { + return data; + } + } + }); + + // Initialize the Bloodhound suggestion engine + productos.initialize(); + + $("#editEmploySearch").typeahead({ + hint: true, + highlight: true, + minLength: 1 + }, + { + name: "result", + displayKey: "fullName", + source: productos.ttAdapter() + }).bind("typeahead:selected", function(obj, datum, name) { + $(this).data("id", datum.code); + console.log(datum.code); + }); +}); \ No newline at end of file diff --git a/api-payroll/src/application/EmployeeApplication.php b/api-payroll/src/application/EmployeeApplication.php index 3909eee..efa2a1b 100644 --- a/api-payroll/src/application/EmployeeApplication.php +++ b/api-payroll/src/application/EmployeeApplication.php @@ -536,7 +536,7 @@ class EmployeeApplication{ /** * Takes an array of all active employees and filters them by a string, returning * all sub arrays that contain such string - * + * * @param $partialName string * @return array */