(function($){
	$.fn.getRegFeeData = function(options) {
		var session = $(this).data("session");
		var id = $(this).data("id");
		var tr = $(this);
		$.ajax({
		    type: 'POST',
		    url: "contents/plugins/admission/ajax.php",
		    data: {id: id, session: session, action: "get_fee_data"},
		    success: function(data) {
		    	data = JSON.parse(data);
		    	if(data.error == 1) {

		    	} else if(data.error == 0) {
		    		$(tr).find(".std-inv a").html(data.affected_students.length);
		    		$(tr).find(".std-pd a").html(data.paid.students_that_paid.length);
		    		$(tr).find(".std-ow a").html(data.paid.students_oweing.length);
		    	}
		    },
		    error: function(xhr, status, error) {

		    }
		});
	}
})(jQuery);

jQuery(document).ready(function($){
	// $(".res-row").getFeeData();
	$(".res-row").each(function(){
		$(this).getRegFeeData();
	})
})