Subversion Repositories SmartDukaan

Rev

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

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