Subversion Repositories SmartDukaan

Rev

Rev 33443 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
33443 ranu 1
$(function () {
2
    $(document).on('click', ".print-resource", function () {
3
        loadPrintResource("main-content");
4
    });
5
 
6
    $(document).on('click', ".print-resource-button-mk", function (event) {
7
        event.preventDefault();
8
 
9
        if (confirm("Are you sure?")) {
10
 
11
            let title = $("#title").val();
12
            let startDate = $("#startDate").val();
13
            let endDate = $("#endDate").val();
14
            let imgurl = $("#imgurl").val();
33501 ranu 15
            let thumbnailurl = $("#thumbnailurl").val();
33443 ranu 16
            let region = $("#region").val();
17
 
18
            let param = {
19
                title: title,
20
                startDate: startDate,
21
                endDate: endDate,
22
                imgUrl: imgurl,
33501 ranu 23
                thumbnailUrl: thumbnailurl,
33443 ranu 24
                region: region
25
            }
26
 
27
            console.log('param', param);
28
 
29
            doPostAjaxRequestWithJsonHandler(context + "/postPrintResource", JSON.stringify(param), function (response) {
30
                if (response == 'true') {
31
                    bootbox.alert("Print Resource Submit Successfully");
32
                    loadPrintResource("main-content");
33
                }
34
 
35
            });
36
        }
37
    });
38
 
39
    let dateChangePrintId = 0;
40
    $(document).on('click', ".change-end-date-btn", function () {
41
        dateChangePrintId = $(this).data('printid');
42
    });
43
 
44
    $(document).on('click', ".change-end-date-submit-mk", function () {
45
        let date = $('.change-date-input-mk').val();
46
        doPostAjaxRequestHandler(context + "/changeEndDate?date=" + date + "&resourceId=" + dateChangePrintId, function (response) {
47
            if (response == 'true') {
48
                alert("Date Change Successfully");
49
                loadAllPrintResource("main-content");
50
            }
51
        });
52
    });
53
 
54
    $(document).on('click', ".partner_print_resources", function () {
55
 
56
        loadPartnerPrintResource("main-content");
57
    });
58
 
59
    $(document).on('click', ".all-print-resource", function () {
60
 
61
        loadAllPrintResource("main-content");
62
    });
63
 
64
});
65
 
66
function loadPrintResource(domId) {
67
    doGetAjaxRequestHandler(context + "/printResources", function (response) {
68
        $('#' + domId).html(response);
69
    });
70
}
71
 
72
function loadAllPrintResource(domId) {
73
    doGetAjaxRequestHandler(context + "/allPrintResources", function (response) {
74
        $('#' + domId).html(response);
75
    });
76
}
77
 
78
 
79
function loadPartnerPrintResource(domId) {
80
    doGetAjaxRequestHandler(context + "/partnerPrintResources", function (response) {
81
        $('#' + domId).html(response);
82
 
83
    });
84
}