[add] New employee form layout
This commit is contained in:
@@ -1,3 +1,45 @@
|
||||
/**
|
||||
* Bootstrapping the starting actions for the module
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
loadEmployeeTypes();
|
||||
});
|
||||
|
||||
/**
|
||||
* Loads the the enmployee types into their select option
|
||||
*/
|
||||
function loadEmployeeTypes(){
|
||||
let baseUrl = getbaseUrl();
|
||||
|
||||
$.ajax({
|
||||
url: baseUrl + '/api/employee/types',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success:function(data){
|
||||
$(data).each(function(i,v){
|
||||
$('#employeeType').append(
|
||||
'<option value="' + v.id + '">'+ v.name + '</option>'
|
||||
);
|
||||
});
|
||||
},
|
||||
error:function(x,e) {
|
||||
if (x.status==0) {
|
||||
$('#modal_error_internet').modal('show');
|
||||
} else if(x.status==404) {
|
||||
$('#modal_error_404').modal('show');
|
||||
} else if(x.status==500) {
|
||||
$('#modal_error_500').modal('show');
|
||||
} else if(e=='parsererror') {
|
||||
$('#modal_error_parsererror').modal('show');
|
||||
} else if(e=='timeout'){
|
||||
$('#modal_error_timeout').modal('show');
|
||||
} else {
|
||||
$('#modal_error_otro').modal('show');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function saveNewEmployee(){
|
||||
console.log('saving...');
|
||||
}
|
||||
@@ -16,9 +16,9 @@ $(document).keypress(function(e) {
|
||||
* display errors to the user
|
||||
*/
|
||||
function processLogin() {
|
||||
var baseUrl = getbaseUrl();
|
||||
let baseUrl = getbaseUrl();
|
||||
|
||||
var parameters = {
|
||||
let parameters = {
|
||||
"userName":$('#userName').val(),
|
||||
"password":$('#password').val()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user