Subversion Repositories SmartDukaan

Rev

Rev 34295 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
34198 ranu 1
<section class="wrapper">
2
    <div class="row">
3
        <div class="col-lg-12">
4
            <h3 class="page-header"><i class="icon_document_alt"></i>Requested Allocations</h3>
5
            <ol class="breadcrumb">
6
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
7
                <li><i class="icon_document_alt"></i>Requested Allocations</li>
8
            </ol>
9
        </div>
10
    </div>
11
    <div class="row">
12
        <div class="col-lg-12">
13
            <ul class="nav nav-tabs">
14
                <li class="active"><a data-toggle="tab" href="#pending">Pending</a></li>
15
                <li><a data-toggle="tab" href="#approved">Approved</a></li>
16
            </ul>
17
            <div class="tab-content">
18
                <div id="pending" class="tab-pane fade in active">
19
                    <table class="table table-bordered table-condensed" id="pendingRequestedAllocationList"
20
                           style="width:100%">
21
                        <thead class="row htable" style="background:#F5F5F5;">
22
                        <tr style="color:black;">
23
                            <th>Fofo Id</th>
24
                            <th>Partner Name</th>
25
                            <th>Catalog Id</th>
26
                            <th>Model Number</th>
27
                            <th>Brand</th>
28
                            <th>Requested Allocation</th>
29
                            <th>Action</th>
30
                        </tr>
31
                        </thead>
32
                        <tbody>
33
                            #foreach($model in $pendingRequestedHidAllocations)
34
                            <tr>
35
                                <td> $model.getFofoId() </td>
36
                                <td> $userMap.get($model.getFofoId()).getName() </td>
37
                                <td> $model.getCatalogId() </td>
38
                                <td> $model.getModelNumber() </td>
39
                                <td> $model.getBrand() </td>
40
                                <td> $model.getRequested_allocation() </td>
41
                                <td>
42
                                    <button class="btn btn-sm btn-success allocation-request-approve-reject"
43
                                            data-id="$model.getId()" data-status="true">Approve
44
                                    </button>
45
                                    /
46
                                    <button class="btn btn-sm btn-danger allocation-request-approve-reject"
47
                                            data-id="$model.getId()" data-status="false">Reject
48
                                    </button>
49
                                </td>
50
                            </tr>
51
                            #end
52
                        </tbody>
53
                    </table>
54
                </div>
55
                <div id="approved" class="tab-pane fade">
56
                    <table class="table table-bordered table-condensed" id="approvedRequestedAllocationList"
57
                           style="width:100%">
58
                        <thead class="row htable" style="background:#F5F5F5;">
59
                        <tr style="color:black;">
60
                            <th>Fofo Id</th>
61
                            <th>Partner Name</th>
62
                            <th>Catalog Id</th>
63
                            <th>Model Number</th>
64
                            <th>Brand</th>
65
                            <th>Requested Allocation</th>
66
                            <th>Action</th>
67
                        </tr>
68
                        </thead>
69
                        <tbody>
70
                            #foreach($model in $approvedRequestedHidAllocations)
71
                            <tr>
72
                                <td> $model.getFofoId() </td>
73
                                <td> $userMap.get($model.getFofoId()).getName() </td>
74
                                <td> $model.getCatalogId() </td>
75
                                <td> $model.getModelNumber() </td>
76
                                <td> $model.getBrand() </td>
77
                                <td> $model.getRequested_allocation() </td>
78
                                <td>
79
                                    <button class="btn btn-sm btn-danger allocation-request-approve-reject"
80
                                            data-id="$model.getId()" data-status="false">Reject
81
                                    </button>
82
                                </td>
83
                            </tr>
84
                            #end
85
                        </tbody>
86
                    </table>
87
                </div>
88
 
89
            </div>
90
        </div>
91
 
92
    </div>
93
 
94
</section>
95
 
96
<script>
97
 
98
    $(document).ready(function () {
99
        // Initialize first table
100
        var sanctionTable = $('#pendingRequestedAllocationList').DataTable({
101
            "scrollX": true,
102
            scrollCollapse: true,
103
            "fixedHeader": true,
104
            "order": [[0, "desc"]],
105
            dom: '<"top"lf>rt<"bottom"ip><"clear">' // Proper dom setup
106
        });
107
 
108
        // Initialize second table
109
        var sanctionTableApproved = $('#approvedRequestedAllocationList').DataTable({
110
            "scrollX": true,
111
            scrollCollapse: true,
112
            "fixedHeader": true,
113
            "order": [[0, "desc"]],
114
            dom: '<"top"lf>rt<"bottom"ip><"clear">' // Proper dom setup
115
        });
116
 
117
        // Adjust columns when tab changes
118
        $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
119
            // Wait for tab switch and then adjust columns
120
            setTimeout(function () {
121
                sanctionTable.columns.adjust().draw();
122
                sanctionTableApproved.columns.adjust().draw();
123
            }, 100); // Delay adjustment slightly to ensure tab switch is complete
124
        });
125
    });
126
 
127
</script>