angular.module('leadsourcesService',[]).factory('Leadsources',function($http){
	return {
		getPaging:function(filter){
			return $http({method:'POST',url:url_server + 'leadsourcespaging',data:filter});
		},
		getSelect:function(){
			
			return $http({method:'POST',
						  headers:headers,
						  url:url_server+'leadsources/getall',
						  withCredentials: true});
			//return $http({method:'POST',url:url_server + 'leadsources/getall'});
		},
		getSelect2:function(filter){
			return $http({method:'POST',url:url_server + 'leadsources/search',data:filter});
		},
		show:function(id){
			return $http.get(url_server+ 'leadsources/'+id);
		},
		save:function(leadsourcesData){
			return $http({method:'POST',
							url:url_server+'leadsources',
							data:leadsourcesData});
		},
		update:function(id, leadsourcesData){
			return $http.put(url_server+'leadsources/'+id,leadsourcesData);
		},
		destroy:function(id){
			return $http.delete(url_server + 'leadsources/'+id);
		}
	};
});
