Subversion Repositories SmartDukaan

Rev

Rev 36664 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

$(document).on('click', ".beat-report", function () {
    doGetAjaxRequestHandler(context + "/beat-report",
        function (response) {
            $('#main-content').html(response);
        });
});

$(document).on('click', '.beat-report-fetch', function () {
    var selectedDate = $("#beat-report-date").val();
    if (!selectedDate) {
        alert("Please select a date!");
        return;
    }
    doGetAjaxRequestHandler(context + "/beat-report/data?date=" + selectedDate,
        function (response) {
            $('.beat-report-container').html(response);
        });
});

$(document).on('click', '.user-detail-refresh', function () {
    var userId = $(this).data('userid');
    var selectedDate = $("#user-detail-date").val();
    if (!selectedDate) {
        alert("Please select a date!");
        return;
    }
    doGetAjaxRequestHandler(context + "/beat-report/user-detail?userId=" + userId + "&date=" + selectedDate,
        function (response) {
            $('#main-content').html(response);
        });
});

$(document).on('click', '.beat-user-detail-link', function () {
    var userId = $(this).data('userid');
    var selectedDate = $("#beat-report-date").val();
    if (!selectedDate) {
        selectedDate = new Date().toISOString().split('T')[0];
    }
    doGetAjaxRequestHandler(context + "/beat-report/user-detail?userId=" + userId + "&date=" + selectedDate,
        function (response) {
            $('#main-content').html(response);
        });
});