Files
dbois/public/js/lib/dataservices/employeehoursDataService.js
T
2018-03-21 11:07:32 +01:00

45 lines
1.4 KiB
JavaScript

/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 31/01/2018
* Time: 20:41
*/
dbo.employeehoursDataService = {
getEmployeehours: function ( $month, $year, employeeID, callback ) {
$.getJSON( 'index.php/projects/employeeHoursController/getEmployeehours/' + $month + '/' + $year + '/' + employeeID )
.done( function ( data ) {
callback( data );
} );
},
getMonthlyEmployeehours : function(month, $year, callback){
$.getJSON( 'index.php/reports/reportsController/getMonthlyEmployeehours/' + month + '/' + $year )
.done( function ( data ) {
callback( data );
} );
},
getHourtypes: function ( callback ) {
$.getJSON( 'index.php/projects/employeeHoursController/getHourtypes' )
.done( function ( data ) {
callback( data );
} );
},
saveEmployeehour: function ( submitDATA, callback ) {
$.post( 'index.php/projects/employeeHoursController/saveEmployeehour', submitDATA, 'json' )
.done( function ( data ) {
callback( data );
} );
},
removeEmployeehour: function ( employeehourID, callback ) {
$.getJSON( 'index.php/projects/employeeHoursController/removeEmployeehour/' + employeehourID )
.done( function ( data ) {
callback( data );
} )
}
};