/** * Created by Pensare Software. * Offer: Theo Weijmer * Date: 25/12/2017 * Time: 09:50 */ dbo.offerDataService = { getAllOffers: function ( projectID, archive = 'F', callback ) { $.getJSON( 'index.php/projects/offersController/getAllOffers/' + projectID + '/' + archive ) .done( function ( data ) { callback( data ); } ); }, getOffersWithoutProject: function ( callback ) { $.getJSON( 'index.php/projects/offersController/getOffersWithoutProject' ) .done( function ( data ) { callback(data); } ); }, getOffer: function ( userID, callback ) { $.getJSON( 'index.php/projects/offersController/getOffer/' + userID ) .done( function ( data ) { callback( data ); } ); }, saveOffer: function ( submitDATA, callback ) { $.post( 'index.php/projects/offersController/saveOffer', submitDATA, function () { }, 'json' ) .done( function ( data ) { callback( data ); } ); }, archiveOffer: function ( offerID, status, callback ) { $.get( 'index.php/projects/offersController/archiveOffer/' + offerID + '/' + status ) .done( function () { callback(); } ); }, removeOffer: function ( offerID, callback ) { $.getJSON( 'index.php/projects/offersController/removeOffer/' + offerID ) .done( function ( data ) { callback( data ); } ); } }