Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (var x = 0; x < employees.length; x++) {
- var match = true;
- var searchString;
- if (firstName !== '') {
- searchString = firstName.toLowerCase();
- if (employees[x].firstName.toLowerCase().indexOf(searchString) == -1) {
- match = false;
- }
- }
- if (lastName !== '') {
- searchString = lastName.toLowerCase();
- if (employees[x].lastName.toLowerCase().indexOf(searchString) == -1) {
- match = false;
- }
- }
- if (pointwestUsername !== '') {
- searchString = pointwestUsername.toLowerCase();
- if (employees[x].pointwestUsername.toLowerCase().indexOf(searchString) == -1) {
- match = false;
- }
- }
- if (employeeId !== '') {
- searchString = employeeId.toLowerCase();
- if (employees[x].employeeId.toLowerCase().indexOf(searchString) == -1) {
- match = false;
- }
- }
- if (match) {
- $("#resultsTable").append("<tr><td>" + employees[x].lastName + "</td><td>" + employees[x].firstName + "</td><td>" + employees[x].seatCode + "</td><td>" + employees[x].localNumber + "</td><td>" + employees[x].availabilityStatus + "</td></tr>");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement