Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
29966 amit.gupta 1
<html lang="en">
2
<head>
29983 amit.gupta 3
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
29976 amit.gupta 4
    <meta http-equiv="refresh" content="120">
29988 amit.gupta 5
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
6
          integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
29966 amit.gupta 7
    <style>
8
        html, body {
29983 amit.gupta 9
            margin-top: 10px;
29966 amit.gupta 10
            padding: 0;
11
        }
12
 
13
 
14
        td, th {
29981 amit.gupta 15
            font-size: 20px;
29966 amit.gupta 16
        }
17
 
29988 amit.gupta 18
 
19
        .table td, .table th {
20
            padding: 0.25rem;
21
        }
22
 
30771 amit.gupta 23
        /*tr:first-child td {
29981 amit.gupta 24
            font-weight: bold;
29982 amit.gupta 25
            background-color: #00d6b2;
30771 amit.gupta 26
        }*/
29982 amit.gupta 27
 
28
        td {
29983 amit.gupta 29
            font-size: 24px;
29982 amit.gupta 30
        }
29966 amit.gupta 31
    </style>
32
    <link href="../resources/css/brand-logo.css" rel="stylesheet"/>
33
</head>
34
<body>
29994 amit.gupta 35
<div class="container-fluid">
30771 amit.gupta 36
    <table class="table table-bordered table-striped">
37
        <thead>
38
        <tr>
39
            <th rowspan="2">RBM</th>
40
            <th rowspan="2">Count</th>
41
            <th colspan="2">Collection</th>
42
            <th colspan="2">Secondary</th>
43
            <th rowspan="2" style="width: 60%">Partner Status</th>
44
        </tr>
45
        <tr>
46
            <th>Target</th>
30774 amit.gupta 47
            <th>Achieved</th>
30771 amit.gupta 48
            <th>Target</th>
30774 amit.gupta 49
            <th>Achieved</th>
30771 amit.gupta 50
        </tr>
51
        </thead>
52
        <tbody>
53
            #foreach($summaryModel in $summaryModels)
29966 amit.gupta 54
            <tr>
30771 amit.gupta 55
                <td>$summaryModel.getAuthName()</td>
56
                <td>$summaryModel.getPartnersCommunicated()</td>
57
                <td class="currency">$summaryModel.getCollectionTarget()</td>
58
                <td class="currency">$summaryModel.getCollection()</td>
59
                <td class="currency">$summaryModel.getSecondaryTarget()</td>
60
                <td class="currency">$summaryModel.getSecondary()</td>
61
                <td>
62
                    #set($datasets = $summaryModel.getChartLeadModel().getData().getDatasets().get(0))
63
                    #set($dataPoints=$datasets.getData())
64
                    #set($bgColors=$datasets.getBackgroundColor())
65
                    #set($labels = $summaryModel.getChartLeadModel().getData().getLabels())
30778 amit.gupta 66
                    #set($total=0)
30771 amit.gupta 67
                    #foreach($dataPoint in $dataPoints)
30778 amit.gupta 68
                        #if(!$dataPoint)
69
                            #set($dataPoint=0)
70
                        #end
71
                        #set($total=$total+$dataPoint)
72
                    #end
73
                    #foreach($dataPoint in $dataPoints)
74
                        #set($percentage=($dataPoint/$total)*100)
30771 amit.gupta 75
                        #set($count = $velocityCount - 1)
30778 amit.gupta 76
                        <span style="background-color: $bgColors.get($count);width:$percentage%;margin:0;padding:0 ">$labels.get($count)
30771 amit.gupta 77
                            - #if($dataPoint) $dataPoint #else 0#end</span>
78
                    #end
79
                </td>
29966 amit.gupta 80
            </tr>
30771 amit.gupta 81
            #end
82
        </tbody>
83
    </table>
29988 amit.gupta 84
</div>
29983 amit.gupta 85
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
86
        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
87
        crossorigin="anonymous"></script>
88
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
89
        integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
90
        crossorigin="anonymous"></script>
91
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
92
        integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
93
        crossorigin="anonymous"></script>
30036 amit.gupta 94
<script type="text/javascript">
95
    function numberToComma(x) {
29966 amit.gupta 96
 
30036 amit.gupta 97
        x = x.toString();
98
        x = x.split('.');
99
        var x1 = x[0];
100
        var x2 = x.length > 1 && x[1] != '0' ? '.' + x[1] : '';
101
        var lastThree = x1.substring(x1.length - 3);
102
        var otherNumbers = x1.substring(0, x1.length - 3);
103
        if (x1.charAt(x1.length - 4) == ',' || x1.charAt(x1.length - 4) == '-') {
104
            console.log(lastThree)
105
        } else {
106
            if (otherNumbers != '')
107
                lastThree = ',' + lastThree;
108
        }
109
        return otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + (lastThree)
110
                + x2;
111
 
112
    }
113
 
114
    $(document).ready(function () {
115
        $('.currency').each(function (index, ele) {
116
            if (!isNaN(parseInt($(ele).html()))) {
117
                $(ele).html(numberToComma($(ele).html()));
118
            }
119
        });
120
    })
121
</script>
29966 amit.gupta 122
</body>
123
</html>