Subversion Repositories SmartDukaan

Rev

Rev 30973 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
30973 amit.gupta 1
<div class="col-lg-12">
2
    <table class="table table-border table-condensed table-bordered" id="commitment-table" style="width:100%">
30185 tejbeer 3
 
30973 amit.gupta 4
        <thead class="row htable" style="background:#F5F5F5;">
30185 tejbeer 5
 
30973 amit.gupta 6
        <tr style="color:black;">
7
            <th rowspan="2">Committed By</th>
8
            <th rowspan="2">Partner Name</th>
30975 amit.gupta 9
            <th colspan="2">Collection Tgt (<span id="coltgt"> </span>)</th>
10
            <th colspan="2">Total Sale Tgt (<span id="saletgt"> </span>)</th>
30973 amit.gupta 11
            <th colspan="2">Samsung</th>
12
            <th colspan="2">Oppo</th>
13
            <th colspan="2">Vivo</th>
14
            <th colspan="2">Itel</th>
15
            <th colspan="2">Almost New</th>
16
            <th colspan="2">Others</th>
17
        </tr>
18
        <tr>
30975 amit.gupta 19
            <th>Target</th>
30973 amit.gupta 20
            <th>Ach (<span id="colach"> </span>)</th>
21
            <th>Tgt</th>
30975 amit.gupta 22
            <th>Ach (<span id="saleach"> </span>)</th>
30973 amit.gupta 23
            <th>Tgt</th>
24
            <th>Ach</th>
25
            <th>Tgt</th>
26
            <th>Ach</th>
27
            <th>Tgt</th>
28
            <th>Ach</th>
29
            <th>Tgt</th>
30
            <th>Ach</th>
31
            <th>Tgt</th>
32
            <th>Ach</th>
33
            <th>Tgt</th>
34
            <th>Ach</th>
35
        </tr>
36
        </thead>
37
        <tbody>
38
            #foreach($commitment in $commitments )
39
 
40
            <tr>
41
                #parse("team-commitment-index.vm")
42
 
30185 tejbeer 43
            </tr>
44
 
30973 amit.gupta 45
            #end
30185 tejbeer 46
 
30973 amit.gupta 47
        </tbody>
30185 tejbeer 48
 
30973 amit.gupta 49
    </table>
50
</div>
30185 tejbeer 51
 
30973 amit.gupta 52
<script type="text/javascript">
53
    $(document).ready(function () {
54
        var table = $('#commitment-table').DataTable({
55
            "scrollX": true,
56
            "bPaginate": true,
57
            "bLengthChange": true,
58
            "bFilter": true,
59
            "bInfo": false,
60
            "bAutoWidth": false,
61
            "pageLength": 100,
62
 
63
 
64
        });
65
 
66
        datatableSum();
67
        table.on('search.dt', function () {
30185 tejbeer 68
            console.log('Currently applied global search: ' + table.search());
69
            datatableSum();
70
 
30973 amit.gupta 71
 
30185 tejbeer 72
        });
30973 amit.gupta 73
    });
30185 tejbeer 74
 
30973 amit.gupta 75
 
76
    function datatableSum() {
77
 
30975 amit.gupta 78
        let col_tgt_sum = $('#commitment-table').DataTable().column(2, {page: 'current'}).data().sum();
79
        $('#coltgt').html(numberToComma(col_tgt_sum));
30973 amit.gupta 80
 
81
 
30975 amit.gupta 82
        let col_ach_sum = $('#commitment-table').DataTable().column(3, {page: 'current'}).data().sum();
83
        console.log(col_ach_sum)
84
        $('#colach').html(numberToComma(col_ach_sum));
30973 amit.gupta 85
 
30975 amit.gupta 86
        let sale_tgt_sum = $('#commitment-table').DataTable().column(4, {page: 'current'}).data().sum();
87
        let sale_ach_sum = $('#commitment-table').DataTable().column(5, {page: 'current'}).data().sum();
88
        $('#saletgt').html(numberToComma(sale_tgt_sum));
89
        $('#saleach').html(numberToComma(sale_ach_sum));
90
 
30973 amit.gupta 91
    }
92
 
93
 
30185 tejbeer 94
</script>