Subversion Repositories SmartDukaan

Rev

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

Rev 33909 Rev 34085
Line 199... Line 199...
199
 
199
 
200
$(document).on('click', ".save_agree_brand_fee", function () {
200
$(document).on('click', ".save_agree_brand_fee", function () {
201
    let loiId = $(this).val();
201
    let loiId = $(this).val();
202
    var $tr = $(this).closest('tr');
202
    var $tr = $(this).closest('tr');
203
    var agreedBrandFee = $tr.find('input[name="brandFee"]').val();
203
    var agreedBrandFee = $tr.find('input[name="brandFee"]').val();
-
 
204
    var brandType = $tr.find('select[name="brandType"]').val();
-
 
205
    console.log('brandType ', brandType);
204
    if (confirm("Are you sure to change Agreed brand fee")) {
206
    if (confirm("Are you sure to change Agreed brand fee")) {
205
        doPutAjaxRequestHandler(`${context}/updateAgreedBrandFee?loiId=${loiId}&brandFee=${agreedBrandFee}`, function (response) {
207
        doPutAjaxRequestHandler(`${context}/updateAgreedBrandFee?loiId=${loiId}&brandFee=${agreedBrandFee}&storeType=${brandType}`, function (response) {
206
            pendingLoiForm("main-content");
208
            pendingLoiForm("main-content");
207
        });
209
        });
208
    } else {
210
    } else {
209
        pendingLoiForm("main-content");
211
        pendingLoiForm("main-content");
210
    }
212
    }
211
});
213
});
212
 
214
 
213
$(document).on('click', ".updateLoiFormDataButton", function () {
215
$(document).on('click', ".updateLoiFormDataButton", function () {
214
    console.log("updateLoiFormDataButton clicked..");
216
    console.log("updateLoiFormDataButton clicked..");
215
    let loiId = $(this).data('loiid');
217
    let loiId = $(this).data('loiid');
216
 
-
 
217
    const firstName = $('input[name="firstName"]').val();
218
    const firstName = $('input[name="firstName"]').val();
218
    const lastName = $('input[name="lastName"]').val();
219
    const lastName = $('input[name="lastName"]').val();
219
    const mobile = $('input[name="mobile"]').val();
220
    const mobile = $('input[name="mobile"]').val();
220
    const email = $('input[name="email"]').val();
221
    const email = $('input[name="email"]').val();
221
    const landline = $('input[name="landline"]').val();
222
    const landline = $('input[name="landline"]').val();
Line 293... Line 294...
293
        function (response) {
294
        function (response) {
294
            $('#' + 'main-content').html(response);
295
            $('#' + 'main-content').html(response);
295
        });
296
        });
296
});
297
});
297
 
298
 
-
 
299
// $(document).on('change', 'select[name="pageSize"]', function () {
-
 
300
//     let pageSize = $(this).val();
-
 
301
//     console.log("pageSize - ", pageSize);
-
 
302
//     doGetAjaxRequestHandler(`${context}/pendingLoiForm?pageSize=${pageSize}&pageNumber=${1}`,
-
 
303
//         function (response) {
-
 
304
//             $('#' + 'main-content').html(response);
-
 
305
//         });
-
 
306
// });
-
 
307
 
298
$(document).on('click', ".mk-approve-loi", function () {
308
$(document).on('click', ".mk-approve-loi", function () {
299
    let loiId = $(this).val();
309
    let loiId = $(this).val();
300
    let companyName = $(this).data('company');
310
    let companyName = $(this).data('company');
301
    let flag = $(this).data('flag');
311
    let flag = $(this).data('flag');
302
    console.log("form id - ", loiId);
312
    console.log("form id - ", loiId);
Line 613... Line 623...
613
        if (response) {
623
        if (response) {
614
            alert("LOI has been signed successfully and sent to the registered email. Please check your email.");
624
            alert("LOI has been signed successfully and sent to the registered email. Please check your email.");
615
            pendingLoiForm("main-content");
625
            pendingLoiForm("main-content");
616
        } else {
626
        } else {
617
            alert("Something went wrong , Please try again to generate Loi and Validate otp");
627
            alert("Something went wrong , Please try again to generate Loi and Validate otp");
618
 
-
 
619
        }
628
        }
620
    });
629
    });
621
}
630
}
622
 
631
 
623
 
632
 
Line 625... Line 634...
625
    doGetAjaxRequestHandler(`${context}/pendingLoiForm`,
634
    doGetAjaxRequestHandler(`${context}/pendingLoiForm`,
626
        function (response) {
635
        function (response) {
627
            $('#' + domId).html(response);
636
            $('#' + domId).html(response);
628
        });
637
        });
629
}
638
}
-
 
639
 
-
 
640
/*
-
 
641
function createPagination(containerId, totalPages, currentPage = 1, onPageChange = null) {
-
 
642
    const $container = $('#' + containerId);
-
 
643
    $container.empty(); // Clear the container
-
 
644
 
-
 
645
    // Helper Function to Render Pagination
-
 
646
    function renderPagination(currentPage) {
-
 
647
        $container.empty();
-
 
648
 
-
 
649
        // Previous Button
-
 
650
        const $prevButton = $('<button>')
-
 
651
            .text('Previous')
-
 
652
            .click(() => handlePageChange(currentPage > 1 ? currentPage - 1 : totalPages)); // Loop to last page if on the first page
-
 
653
        $container.append($prevButton);
-
 
654
 
-
 
655
        // First Page
-
 
656
        const $firstPageButton = $('<button>')
-
 
657
            .text('1')
-
 
658
            .addClass(currentPage === 1 ? 'active' : '')
-
 
659
            .click(() => handlePageChange(1));
-
 
660
        $container.append($firstPageButton);
-
 
661
 
-
 
662
        // Ellipsis Before Current Pages
-
 
663
        if (currentPage > 3) {
-
 
664
            $container.append($('<span>').text('...'));
-
 
665
        }
-
 
666
 
-
 
667
        // Dynamic Pages Around Current Page
-
 
668
        for (let i = Math.max(2, currentPage - 1); i <= Math.min(totalPages - 1, currentPage + 1); i++) {
-
 
669
            const $pageButton = $('<button>')
-
 
670
                .text(i)
-
 
671
                .addClass(currentPage === i ? 'active' : '')
-
 
672
                .click(() => handlePageChange(i));
-
 
673
            $container.append($pageButton);
-
 
674
        }
-
 
675
 
-
 
676
        // Ellipsis Before Last Page
-
 
677
        if (currentPage < totalPages - 2) {
-
 
678
            $container.append($('<span>').text('...'));
-
 
679
        }
-
 
680
 
-
 
681
        // Last Page
-
 
682
        if (totalPages > 1) {
-
 
683
            const $lastPageButton = $('<button>')
-
 
684
                .text(totalPages)
-
 
685
                .addClass(currentPage === totalPages ? 'active' : '')
-
 
686
                .click(() => handlePageChange(totalPages));
-
 
687
            $container.append($lastPageButton);
-
 
688
        }
-
 
689
 
-
 
690
        // Next Button
-
 
691
        const $nextButton = $('<button>')
-
 
692
            .text('Next')
-
 
693
            .click(() => handlePageChange(currentPage < totalPages ? currentPage + 1 : 1)); // Loop to first page if on the last page
-
 
694
        $container.append($nextButton);
-
 
695
    }
-
 
696
 
-
 
697
    // Handle Page Change
-
 
698
    function handlePageChange(selectedPage) {
-
 
699
        if (onPageChange) {
-
 
700
            onPageChange(selectedPage); // Trigger the callback with the selected page
-
 
701
        }
-
 
702
        renderPagination(selectedPage); // Re-render pagination
-
 
703
    }
-
 
704
 
-
 
705
    // Initial Render
-
 
706
    renderPagination(currentPage);
-
 
707
}*/