Subversion Repositories SmartDukaan

Rev

Rev 34295 | Rev 34305 | Go to most recent revision | Details | Compare with Previous | 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">
34295 ranu 19
                    <table class="table table-bordered table-condensed pendingRequestedAllocationList"
34198 ranu 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>
34304 ranu 36
                                <td> $userMap.get($model.getFofoId()).getName()
37
                                    - $fofoStoreMap.get($model.getFofoId()).getCode() </td>
34198 ranu 38
                                <td> $model.getCatalogId() </td>
39
                                <td> $model.getModelNumber() </td>
40
                                <td> $model.getBrand() </td>
34295 ranu 41
                                <td><input type="text" value="$model.getRequested_allocation()"
42
                                           class="reuested_allocation" disabled> <a role="button"> <i
43
                                        class="fa fa-edit edit-allocation"></i></a></td>
34198 ranu 44
                                <td>
45
                                    <button class="btn btn-sm btn-success allocation-request-approve-reject"
46
                                            data-id="$model.getId()" data-status="true">Approve
47
                                    </button>
48
                                    /
49
                                    <button class="btn btn-sm btn-danger allocation-request-approve-reject"
50
                                            data-id="$model.getId()" data-status="false">Reject
51
                                    </button>
34295 ranu 52
                                    /
53
                                    <button class="btn btn-sm btn-info allocation-request-edit"
54
                                            data-id="$model.getId()">Edit
55
                                    </button>
34198 ranu 56
                                </td>
57
                            </tr>
58
                            #end
59
                        </tbody>
60
                    </table>
61
                </div>
62
                <div id="approved" class="tab-pane fade">
34295 ranu 63
                    <table class="table table-bordered table-condensed approvedRequestedAllocationList"
34198 ranu 64
                           style="width:100%">
65
                        <thead class="row htable" style="background:#F5F5F5;">
66
                        <tr style="color:black;">
67
                            <th>Fofo Id</th>
68
                            <th>Partner Name</th>
69
                            <th>Catalog Id</th>
70
                            <th>Model Number</th>
71
                            <th>Brand</th>
72
                            <th>Requested Allocation</th>
73
                            <th>Action</th>
74
                        </tr>
75
                        </thead>
76
                        <tbody>
77
                            #foreach($model in $approvedRequestedHidAllocations)
78
                            <tr>
79
                                <td> $model.getFofoId() </td>
80
                                <td> $userMap.get($model.getFofoId()).getName() </td>
81
                                <td> $model.getCatalogId() </td>
82
                                <td> $model.getModelNumber() </td>
83
                                <td> $model.getBrand() </td>
34295 ranu 84
                                <td><input type="text" value="$model.getRequested_allocation()"
85
                                           class="reuested_allocation" disabled> <a role="button"> <i
86
                                        class="fa fa-edit edit-allocation"></i></a></td>
34198 ranu 87
                                <td>
88
                                    <button class="btn btn-sm btn-danger allocation-request-approve-reject"
89
                                            data-id="$model.getId()" data-status="false">Reject
90
                                    </button>
34295 ranu 91
                                    <button class="btn btn-sm btn-info allocation-request-edit"
92
                                            data-id="$model.getId()">Edit
93
                                    </button>
34198 ranu 94
                                </td>
95
                            </tr>
96
                            #end
97
                        </tbody>
98
                    </table>
99
                </div>
100
 
101
            </div>
102
        </div>
103
 
104
    </div>
105
 
106
</section>
107
 
108
<script>
109
 
110
    $(document).ready(function () {
111
        // Initialize first table
34295 ranu 112
        var sanctionTable = $('.pendingRequestedAllocationList').DataTable({
34198 ranu 113
            "scrollX": true,
114
            scrollCollapse: true,
115
            "fixedHeader": true,
116
            "order": [[0, "desc"]],
117
            dom: '<"top"lf>rt<"bottom"ip><"clear">' // Proper dom setup
118
        });
119
 
120
        // Initialize second table
34295 ranu 121
        var sanctionTableApproved = $('.approvedRequestedAllocationList').DataTable({
34198 ranu 122
            "scrollX": true,
123
            scrollCollapse: true,
124
            "fixedHeader": true,
125
            "order": [[0, "desc"]],
126
            dom: '<"top"lf>rt<"bottom"ip><"clear">' // Proper dom setup
127
        });
128
 
129
        // Adjust columns when tab changes
130
        $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
131
            // Wait for tab switch and then adjust columns
132
            setTimeout(function () {
133
                sanctionTable.columns.adjust().draw();
134
                sanctionTableApproved.columns.adjust().draw();
135
            }, 100); // Delay adjustment slightly to ensure tab switch is complete
136
        });
137
    });
138
 
139
</script>