$(".dt-initiate").each(function(index) {
	var table = $(this)
	var columns = [];
	$.each(table.find("th"), function(i) {
		var th = $(this) 
		var name = th.attr("data-column")
		var order = true
		if(th.is("data-order")) {
			order = th.attr("data-order")
		}
		var search = true
		if (th.is("data-search")) {
			search = th.attr("data-search")
		}
		columns.push({ data: name, name: name, orderable: order, searchable: search })
	});
	console.log(columns)
	$(this).DataTable({
		processing: true,
		serverSide: true,
		ajax: table.attr("data-url"),
		columns: columns
	})
})