// (function($) {
// 	$.fn.getUnconfirmedCredits = function() {
// 		var Obj = $(this);
// 		var defaultContent = $(Obj).find("tbody").html();
// 		$.ajax({
// 		    type: 'POST',
// 		    url: 'contents/plugins/payment_module/ajax.php',
// 		    data: {action: 'get_unconfirmed_credits'},
// 		}).done(function(data){
// 			try {
// 				data = JSON.parse(data);
// 				var i = 1;
// 				var table = $(Obj).DataTable();
// 				table.clear();
// 				table.destroy();
// 				for(var key in data.data) {
// 					var tr = $("<tr></tr>");
// 					var html = '<ul style="padding: 0px">';
// 					for(var url in data.data[key].documents.files) {
// 						html += '<li><a target="_blank" href="'+url+'">'+data.data[key].documents.files[url].title+'</a></li>';
// 					}
// 					html += "</ul>";
// 					$(tr).addElement({
// 						element: "td",
// 						content: i
// 					}).addElement({
// 						element: "td",
// 						content: data.data[key].date_of_payment
// 					}).addElement({
// 						element: "td",
// 						content: data.data[key].paid_in_by
// 					}).addElement({
// 						element: "td",
// 						content: data.data[key].feemeta.desc
// 					}).addElement({
// 						element: "td",
// 						content: data.data[key].feemeta.amount
// 					}).addElement({
// 						element: "td",
// 						content: data.data[key].amount
// 					}).addElement({
// 						element: "td",
// 						content: html
// 					}).addElement({
// 						element: "td",
// 						content: '<a href="javascript:void(0)" class="ajax-action" data-content="You are about to confirm that this payment evidence provided is okay and by so doing, the system will automatically give value. </br></br>If you are not sure of this, please click on the `cancel` button. To continue with the confirmation, click on `continue` button" data-callbackid="#bootstrap-data-table-export" data-callback="getUnconfirmedCredits" data-error="'+data.data[key].error_method+'" data-success="'+data.data[key].success_method+'" data-action-callback="pm_confirm_payment" data-id="'+data.data[key].id+'">Confirm</a><br><a href="javascript:void(0)" class="ajax-action" data-content="You are about to reject this payment evidence provided and by so doing, the system will not give value and the payment record will be deleted. </br></br>If you are not sure of this, please click on the `cancel` button. To continue with the rejection, click on `continue` button" data-callbackid="#bootstrap-data-table-export" data-callback="getUnconfirmedCredits" data-error="'+data.data[key].error_method+'" data-success="'+data.data[key].success_method+'" data-action-callback="pm_reject_payment" data-id="'+data.data[key].id+'">Reject</a>'
// 					});
// 					i++;
// 					$(Obj).find("tbody").append(tr)
// 				}
// 				$(Obj).DataTable({
// 			        lengthMenu: [[-1, 50, 75, 100], ["All", 50, 75, 100]],
// 			        dom: 'lBfrtip',
// 					buttons: [
// 							    {
// 							        extend: 'csv',
// 							        text: 'CSV',
// 							        className: 'btn btn-default',
// 							        exportOptions: {
// 							            columns: ':not(.notexport)'
// 							        }
// 							    },
// 							    {
// 							        extend: 'excel',
// 							        text: 'Excel',
// 							        className: 'btn btn-default',
// 							        exportOptions: {
// 							            columns: ':not(.notexport)'
// 							        }
// 							    },
// 							    {
// 							        extend: 'pdf',
// 							        text: 'PDF',
// 							        className: 'btn btn-default',
// 							        exportOptions: {
// 							            columns: ':not(.notexport)'
// 							        }
// 							    }
// 					        ]
// 			    })
// 			}
// 			catch (err) {
// 				console.log(err);
// 			}
// 			finally {
// 			}
// 		});
// 	}

// })(jQuery)


// $("#confirm-payment-table").getUnconfirmedCredits();