(function(){
	var Packages = function() {
    	return {

	    	init: function() {
					var dt = $('#datatable-packages').DataTable( {
							ajax: {
								url: ajax_packages_dt,
								type: 'POST'
							},
							lengthMenu: [ 25, 50, 75, 100 ],
							pageLength: 25,
							serverSide: true,
							retrieve: true,
							paging: true,
							searching: false,
							"columns": [
								{ "title": "ID", "sortable": true, "data": "id" },
					            { "title": "Type", "sortable": true, "data": "packageName" },
					            { "title": "Amount", "data": "invested_amount", "sortable": true },
					            { "title": "Status", "data": "statusName", "sortable": true },
					            { "title": "Purchase date", "data": "created_at", "sortable": true }
					    ]
						});

	      }
    };
  }();

	$(document).ready(function() {
		Packages.init();
	});

})();