Subversion Repositories SmartDukaan

Rev

Rev 33045 | Rev 33190 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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