(function(){
	var ReportUploader = function() {

    return {

    	init: function() {
				var dt = $('#datatable-reports').on('xhr.dt', function ( e, settings, json ) {
		        //$('#searchBtn').prop('disabled', false);
		    	} ).DataTable( {
						ajax: {
							url: ajax_reports_dt,
							type: 'POST',
							data: function(d) {

							}
						},
						lengthMenu: [ 25, 50, 75, 100 ],
						pageLength: 25,
						serverSide: true,
						retrieve: true,
						paging: true,
						searching: false,
						"columns": [
              { "title": "ID", "sortable": true, "data": "id" },
              { "title": "File #1", "data": "file_1", "sortable": false },
              { "title": "File #2", "data": "file_2", "sortable": false },
              { "title": "Date", "data": "date", "sortable": true },
              { "title": "Week", "data": "week", "sortable": false }
				    ],
				    "columnDefs": [
              {
                  "targets": [0],
                  "render": function ( data, type, full, meta ) {
                      return '#' + full.id;
                  }
              },
              {
                  "targets": [1],
                  "render": function ( data, type, full, meta ) {
                      return '<a href="' + reportFile_url + '/' + full.file_1 + '/1" class="btn btn-success"><i class="fa fa-eye"> View</a>';
                  }
              },
              {
                  "targets": [2],
                  "render": function ( data, type, full, meta ) {
                      return '<a href="' + reportFile_url + '/' + full.file_2 + '/1" class="btn btn-success"><i class="fa fa-eye"> View</a>';
                  }
              }
            ]
					});

        }
    };
  }();

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

})();
