Subversion Repositories SmartDukaan

Rev

Rev 30877 | Rev 33047 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30877 Rev 33045
Line 1... Line 1...
1
$(function() {
1
$(function () {
2
 
2
 
3
	$(document).on('click', ".partner-credit-detail", function() {
3
    $(document).on('click', ".partner-credit-detail", function () {
4
 
4
 
5
		loadCreditDetail("main-content");
5
        loadCreditDetail("main-content");
6
	});
6
    });
7
 
7
 
8
 
8
 
9
 
-
 
10
 
-
 
11
	$(document).on('click', '.activate-partner-kred', function() {
9
    $(document).on('click', '.activate-partner-kred', function () {
12
		var row = $(this).closest("tr");
10
        var row = $(this).closest("tr");
13
		var id = $(this).data('id');
11
        var id = $(this).data('id');
-
 
12
        let gateway = $(row).find('select').val();
14
		console.log(id)
13
        console.log(id)
15
		if (confirm('Are you sure you want to activate?')) {
14
        if (confirm(`Are you sure you want to activate ${gateway}?`)) {
16
			doPostAjaxRequestHandler(context + "/activateKred?id=" + id,
15
            doPostAjaxRequestHandler(`${context}/activateKred?id=${id}&gateway=${gateway}`,
17
				function(response) {
16
                function (response) {
18
					row.html(response);
17
                    row.html(response);
19
					alert("successfully activate");
18
                    alert(`${gateway} successfully activated`);
20
 
19
 
21
 
-
 
22
 
20
 
23
				});
21
                });
24
		}
22
        }
25
	});
23
    });
26
 
24
 
27
	$(document).on('click', '.deactivate-partner-kred', function() {
25
    $(document).on('click', '.deactivate-partner-kred', function () {
28
		var row = $(this).closest("tr");
26
        var row = $(this).closest("tr");
29
		var id = $(this).data('id');
27
        var id = $(this).data('id');
30
		console.log(id)
28
        console.log(id)
31
 
29
 
32
		if (confirm('Are you sure you want to deactivate?')) {
30
        if (confirm('Are you sure you want to deactivate?')) {
33
			doPostAjaxRequestHandler(context + "/deactivateKred?id=" + id,
31
            doPostAjaxRequestHandler(context + "/deactivateKred?id=" + id,
34
				function(response) {
32
                function (response) {
35
					row.html(response);
33
                    row.html(response);
36
					alert("successfully deactivate");
34
                    alert(`${gateway} successfully deactivated`);
37
 
-
 
38
				});
35
                });
39
		}
36
        }
40
	});
37
    });
41
 
38
 
42
});
39
});
43
 
40
 
44
function loadCreditDetail(domId) {
41
function loadCreditDetail(domId) {
45
	doGetAjaxRequestHandler(context + "/getCreditDetail",
42
    doGetAjaxRequestHandler(context + "/getCreditDetail",
46
		function(response) {
43
        function (response) {
47
			$('#' + domId).html(response);
44
            $('#' + domId).html(response);
48
		});
45
        });
49
 
46
 
50
 
47
 
51
}
48
}
52
49