Subversion Repositories SmartDukaan

Rev

Rev 31431 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31431 Rev 35971
Line 6... Line 6...
6
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
6
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
7
                <li><i class="icon_document_alt"></i>Partner Onboarding Reject</li>
7
                <li><i class="icon_document_alt"></i>Partner Onboarding Reject</li>
8
            </ol>
8
            </ol>
9
        </div>
9
        </div>
10
    </div>
10
    </div>
11
    
11
 
-
 
12
        ## Search Box
-
 
13
        <div class="col-lg-12" style="margin-bottom: 15px;">
-
 
14
            <div class="row">
-
 
15
                <div class="col-lg-8">
-
 
16
                    <label style="margin-right: 10px;"><strong>Search:</strong></label>
-
 
17
                    <input type="text" id="rejectSearch" class="form-control"
-
 
18
                           style="width: 250px; display: inline-block;"
-
 
19
                           placeholder="Outlet, Phone, Code, City..." value="$!search">
-
 
20
                    <button type="button" class="btn btn-primary" id="rejectSearchBtn" style="margin-left: 5px;">
-
 
21
                        <i class="fa fa-search"></i> Search
-
 
22
                    </button>
-
 
23
                    #if($search && $search != "")
-
 
24
                        <button type="button" class="btn btn-default" id="clearRejectSearchBtn"
-
 
25
                                style="margin-left: 5px;">
-
 
26
                            Clear
-
 
27
                        </button>
-
 
28
                    #end
-
 
29
                </div>
-
 
30
            </div>
12
    
31
        </div>
-
 
32
 
13
    <div class="col-lg-12">
33
        <div class="col-lg-12">
14
        <table class="table table-border table-condensed table-bordered" id="oboardingreject" style="width:100%">
34
        <table class="table table-border table-condensed table-bordered" id="oboardingreject" style="width:100%">
15
 
35
 
16
            <thead class="row htable">
36
            <thead class="row htable">
17
 
37
 
18
            <tr style="color:black;">
38
            <tr style="color:black;">
Line 433... Line 453...
433
 
453
 
434
            </tbody>
454
            </tbody>
435
        </table>
455
        </table>
436
    </div>
456
    </div>
437
 
457
 
-
 
458
        ## Pagination Controls (Bottom)
-
 
459
        <div class="col-lg-12" style="margin-top: 15px;">
438
    </section>
460
            <div class="row">
-
 
461
                <div class="col-lg-12 text-center">
-
 
462
                    #if($totalRecords > 0)
-
 
463
                        <span class="pagination-info">Showing $startRecord - $endRecord of $totalRecords</span>
-
 
464
                        <ul class="pagination pagination-sm" style="margin: 0 15px; display: inline-flex;">
-
 
465
                            #if($currentPage > 0)
-
 
466
                                <li><a href="javascript:void(0)" class="reject-page-link" data-page="0">First</a></li>
-
 
467
                                <li><a href="javascript:void(0)" class="reject-page-link" data-page="$prevPage">Prev</a>
-
 
468
                                </li>
-
 
469
                            #else
-
 
470
                                <li class="disabled"><span>First</span></li>
-
 
471
                                <li class="disabled"><span>Prev</span></li>
-
 
472
                            #end
-
 
473
 
-
 
474
                            <li class="active"><span>Page $currentPageDisplay of $totalPages</span></li>
439
    
475
 
-
 
476
                            #if($currentPage < $lastPage)
-
 
477
                                <li><a href="javascript:void(0)" class="reject-page-link" data-page="$nextPage">Next</a>
-
 
478
                                </li>
-
 
479
                                <li><a href="javascript:void(0)" class="reject-page-link" data-page="$lastPage">Last</a>
-
 
480
                                </li>
-
 
481
                            #else
-
 
482
                                <li class="disabled"><span>Next</span></li>
-
 
483
                                <li class="disabled"><span>Last</span></li>
-
 
484
                            #end
-
 
485
                        </ul>
-
 
486
                        <select class="form-control reject-page-size" style="width: 120px; display: inline-block;">
-
 
487
                            <option value="10" #if($pageSize==10)selected#end>10 per page</option>
-
 
488
                            <option value="25" #if($pageSize==25)selected#end>25 per page</option>
-
 
489
                            <option value="50" #if($pageSize==50)selected#end>50 per page</option>
-
 
490
                            <option value="100" #if($pageSize==100)selected#end>100 per page</option>
-
 
491
                        </select>
-
 
492
                    #end
-
 
493
                </div>
-
 
494
            </div>
440
    <script>
495
        </div>
441
 
496
 
442
        var dtable = $('#oboardingreject').DataTable(
-
 
443
                {
497
    </section>
444
 
498
 
-
 
499
    <script>
-
 
500
        $(document).ready(function () {
-
 
501
            // Search button click handler
-
 
502
            $('#rejectSearchBtn').on('click', function () {
-
 
503
                refreshRejectList(0);
-
 
504
            });
-
 
505
 
-
 
506
            // Search on Enter key
-
 
507
            $('#rejectSearch').on('keypress', function (e) {
445
                    "bPaginate": true,
508
                if (e.which === 13) {
446
                    "bLengthChange": true,
509
                    refreshRejectList(0);
-
 
510
                }
-
 
511
            });
-
 
512
 
-
 
513
            // Clear search button
-
 
514
            $('#clearRejectSearchBtn').on('click', function () {
-
 
515
                $('#rejectSearch').val('');
-
 
516
                refreshRejectList(0);
-
 
517
            });
-
 
518
 
-
 
519
            // Pagination link click handler
-
 
520
            $(document).on('click', '.reject-page-link', function (e) {
447
                    "bFilter": true,
521
                e.preventDefault();
-
 
522
                refreshRejectList($(this).data('page'));
-
 
523
            });
-
 
524
 
-
 
525
            // Page size change handler
-
 
526
            $(document).on('change', '.reject-page-size', function () {
-
 
527
                refreshRejectList(0);
-
 
528
            });
-
 
529
 
-
 
530
            // Destroy existing DataTable if it exists (prevents reinitialization error)
-
 
531
            if ($.fn.DataTable.isDataTable('#oboardingreject')) {
-
 
532
                $('#oboardingreject').DataTable().destroy();
-
 
533
            }
-
 
534
 
-
 
535
            var dtable = $('#oboardingreject').DataTable({
-
 
536
                "paging": false,  // Disable client-side pagination (server-side)
448
                    "bInfo": false,
537
                "info": false,
-
 
538
                "bFilter": false,  // Disable DataTables filter (we use server-side search)
449
                    "bAutoWidth": false,
539
                "bAutoWidth": false,
450
                    "scrollX": true,
540
                "scrollX": true,
451
                  fixedColumns:   {
541
                fixedColumns: {
452
            leftColumns: 2
542
                    leftColumns: 2
453
        },
543
                },
454
        
544
        
455
        "columnDefs": [
545
        "columnDefs": [
456
                   { "targets": 1, "orderDataType":  "date-dd-mmm-yyyy", "type":"string" },
546
                   { "targets": 1, "orderDataType":  "date-dd-mmm-yyyy", "type":"string" },
457
                   { "targets": 2, "orderDataType":  "date-dd-mmm-yyyy", "type":"string" },
547
                   { "targets": 2, "orderDataType":  "date-dd-mmm-yyyy", "type":"string" },
458
                  
548
                  
Line 483... Line 573...
483
                { "targets": 28, "orderDataType": "date-dd-mmm-yyyy", "type": "string" }, 
573
                { "targets": 28, "orderDataType": "date-dd-mmm-yyyy", "type": "string" }, 
484
                
574
                
485
                 { "targets": 29, "orderDataType": "date-dd-mmm-yyyy", "type": "string" },
575
                 { "targets": 29, "orderDataType": "date-dd-mmm-yyyy", "type": "string" },
486
                 { "targets": 30, "orderDataType": "date-dd-mmm-yyyy", "type": "string" },
576
                 { "targets": 30, "orderDataType": "date-dd-mmm-yyyy", "type": "string" },
487
                { "targets": 32, "orderDataType": "dom-text", "type": "string" }
577
                { "targets": 32, "orderDataType": "dom-text", "type": "string" }
488
                                
-
 
489
                        ],
578
                        ],
490
                   
-
 
491
                });
579
                });
492
   
-
 
493
   
-
 
494
    
-
 
495
    </script>
-
 
496
580
        });
-
 
581
 
-
 
582
        // Function to refresh reject list via AJAX
-
 
583
        function refreshRejectList(page) {
-
 
584
            var pageSize = $('.reject-page-size').val() || '25';
-
 
585
            var search = $('#rejectSearch').val() || '';
-
 
586
            var url = context + '/partnerOnBoardingRejectShow?page=' + (page || 0)
-
 
587
                    + '&pageSize=' + pageSize
-
 
588
                    + '&search=' + encodeURIComponent(search);
-
 
589
            $.ajax({
-
 
590
                url: url,
-
 
591
                type: 'GET',
-
 
592
                success: function (response) {
-
 
593
                    $('#main-content').html(response);
-
 
594
                }
-
 
595
            });
-
 
596
        }
-
 
597
    </script>
-
 
598
 
-
 
599
    <style>
-
 
600
        .pagination-info {
-
 
601
            margin-right: 15px;
-
 
602
            font-weight: bold;
-
 
603
        }
-
 
604
 
-
 
605
        .pagination {
-
 
606
            margin: 0;
-
 
607
        }
-
 
608
 
-
 
609
        .pagination li {
-
 
610
            display: inline-block;
-
 
611
            margin: 0 2px;
-
 
612
        }
-
 
613
 
-
 
614
        .pagination li a, .pagination li span {
-
 
615
            padding: 5px 10px;
-
 
616
            border: 1px solid #ddd;
-
 
617
            text-decoration: none;
-
 
618
            color: #333;
-
 
619
        }
-
 
620
 
-
 
621
        .pagination li.active span {
-
 
622
            background-color: #337ab7;
-
 
623
            color: white;
-
 
624
            border-color: #337ab7;
-
 
625
        }
-
 
626
 
-
 
627
        .pagination li.disabled span {
-
 
628
            color: #999;
-
 
629
            cursor: not-allowed;
-
 
630
        }
-
 
631
    </style>
-
 
632
497
633