Subversion Repositories SmartDukaan

Rev

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

Rev 34525 Rev 34528
Line 1036... Line 1036...
1036
                            #parse("dashboard-grn-pending-activated-imeis.vm")
1036
                            #parse("dashboard-grn-pending-activated-imeis.vm")
1037
                        </div>
1037
                        </div>
1038
                    #end
1038
                    #end
1039
                    <div class="row col-lg-12">
1039
                    <div class="row col-lg-12">
1040
                        <ul class="nav nav-tabs">
1040
                        <ul class="nav nav-tabs">
1041
                            <li class="bar_chart"><a class="ba">Sale</a></li>
1041
                            <li class="analysis_bar_chart" data-fofoid="$fofoId"><a class="ba">Sale</a></li>
1042
                            <li class="lms_line_chart"><a class="la">#springMessage("dashboard.monthlysale")</a></li>
1042
                            <li class="analysis_lms_line_chart" data-fofoid="$fofoId"><a class="la">#springMessage(
-
 
1043
                                "dashboard.monthlysale")</a></li>
1043
                            <li class="purchase_line_chart"><a class="pa">#springMessage(
1044
                            <li class="analysis_purchase_line_chart" data-fofoid="$fofoId"><a class="pa">#springMessage(
1044
                                "dashboard.monthlypurchase")</a></li>
1045
                                "dashboard.monthlypurchase")</a></li>
1045
                            <li class="priceDrop_chart"><a class="pd">#springMessage("dashboard.pricedrop")</a></li>
1046
                            <li class="analysis_priceDrop_chart" data-fofoid="$fofoId"><a class="pd">#springMessage(
1046
                            <li class="pending_activation_chart"><a class="pac">Pending Activation</a></li>
1047
                                "dashboard.pricedrop")</a></li>
1047
                            <li class="pending_upgrade_offer"><a class="puo"> #springMessage(
1048
                            <li class="analysis_pending_activation_chart" data-fofoid="$fofoId"><a class="pac">Pending
1048
                                "dashboard.upgradeoffer")</a></li>
1049
                                Activation</a></li>
1049
 
1050
 
1050
                        </ul>
1051
                        </ul>
1051
                        <div style="float:left;margin-top: 2% ; font-size: 20px ;margin-left: 5%" id="dateRangeDiv">
1052
                        <div style="float:left;margin-top: 2% ; font-size: 20px ;margin-left: 5%" id="dateRangeDiv">
1052
                            From:
1053
                            From:
1053
                            <input type="date" name="from" id="chartForm" value="">
1054
                            <input type="date" name="from" id="chartForm" value="">
Line 1056... Line 1057...
1056
 
1057
 
1057
                            <select name="quantityType" id="quantity_type_id">
1058
                            <select name="quantityType" id="quantity_type_id">
1058
                                <option value="false" selected>Value</option>
1059
                                <option value="false" selected>Value</option>
1059
                                <option value="true">Quantity</option>
1060
                                <option value="true">Quantity</option>
1060
                            </select>
1061
                            </select>
1061
                            <button id="viewSaleBarChart" class="btn-success">
1062
                            <button id="analysis_viewSaleBarChart" data-fofoid="$fofoId" class="btn-success">
1062
                                Veiw Chart
1063
                                Veiw Chart
1063
                            </button>
1064
                            </button>
1064
                        </div>
1065
                        </div>
1065
                        <br>
1066
                        <br>
1066
                        <div class="row ChartContainer" style="margin:5px;margin-top: 4%">
1067
                        <div class="row ChartContainer" style="margin:5px;margin-top: 4%">
Line 1085... Line 1086...
1085
                <p>All rights reserved.&copy;2017, Smart Dukaan</p>
1086
                <p>All rights reserved.&copy;2017, Smart Dukaan</p>
1086
            </div>
1087
            </div>
1087
        </div>
1088
        </div>
1088
 
1089
 
1089
    </section>
1090
    </section>
-
 
1091
    <div class="modal fade" id="modelChartModal" tabindex="-1" role="dialog"
-
 
1092
         aria-labelledby="modelChartModalLabel" aria-hidden="true">
-
 
1093
        <div class="modal-dialog modal-xl" role="document"> <!-- modal-lg for large modal -->
-
 
1094
            <div class="modal-content">
-
 
1095
                <div class="modal-header">
-
 
1096
                    <h3 class="modal-title" id="modelChartModalLabel">Model-wise Chart
-
 
1097
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-
 
1098
                            <span aria-hidden="true">&times;</span>
-
 
1099
                        </button>
-
 
1100
                    </h3>
-
 
1101
                </div>
-
 
1102
                <div class="modal-body model_charbar_container">
-
 
1103
                    <!-- Chart will be injected here -->
-
 
1104
                </div>
-
 
1105
            </div>
-
 
1106
        </div>
1090
 
1107
    </div>
1091
    <script type="text/javascript">
1108
    <script type="text/javascript">
1092
        context = "${rc.contextPath}";
1109
        context = "${rc.contextPath}";
1093
        webApiScheme = "$webApiScheme";
1110
        webApiScheme = "$webApiScheme";
1094
        webApiRoot = "$webApiRoot";
1111
        webApiRoot = "$webApiRoot";
1095
        webApiHost = "$webApiHost";
1112
        webApiHost = "$webApiHost";
Line 1115... Line 1132...
1115
                    $('.monthsaleContainer').html('');
1132
                    $('.monthsaleContainer').html('');
1116
                }
1133
                }
1117
                salesCloseFlag = !salesCloseFlag;
1134
                salesCloseFlag = !salesCloseFlag;
1118
            });
1135
            });
1119
 
1136
 
1120
            $(".bar_chart").click();
1137
            $(".analysis_bar_chart").click();
1121
 
1138
 
1122
            var month = 0;
1139
            var month = 0;
1123
            doGetAjaxRequestHandler(context + "/partnerTotalIncomeByMonth/" + month, function (response) {
1140
            doGetAjaxRequestHandler(context + "/partnerTotalIncomeByMonth/" + month, function (response) {
1124
                console.log(response);
1141
                console.log(response);
1125
                $(".partnerIncomeContainer").html(response);
1142
                $(".partnerIncomeContainer").html(response);
Line 1147... Line 1164...
1147
        function sleep(delay) {
1164
        function sleep(delay) {
1148
            var start = new Date().getTime();
1165
            var start = new Date().getTime();
1149
            while (new Date().getTime() < start + delay) ;
1166
            while (new Date().getTime() < start + delay) ;
1150
        }
1167
        }
1151
 
1168
 
1152
        $(document).on("click", ".priceDrop_chart",
1169
        $(document).on("click", ".analysis_priceDrop_chart",
1153
                function () {
1170
                function () {
1154
                    $(".pd").css("color", "blue");
1171
                    $(".pd").css("color", "blue");
1155
                    $(".pd").css("background-color", "white");
1172
                    $(".pd").css("background-color", "white");
1156
                    $(".ba").css("color", "white");
1173
                    $(".ba").css("color", "white");
1157
                    $(".ba").css("background-color", "#C0C0C0");
1174
                    $(".ba").css("background-color", "#C0C0C0");
Line 1165... Line 1182...
1165
 
1182
 
1166
 
1183
 
1167
                    $(".puo").css("color", "white");
1184
                    $(".puo").css("color", "white");
1168
                    $(".puo").css("background-color", "#C0C0C0");
1185
                    $(".puo").css("background-color", "#C0C0C0");
1169
 
1186
 
1170
 
-
 
-
 
1187
                    var fofoId = $(this).data("fofoid")
1171
                    sleep(500);
1188
                    sleep(500);
1172
                    doGetAjaxRequestHandler(context + "/getMonthlyPriceDrop", function (response) {
1189
                    doGetAjaxRequestHandler(context + "/getMonthlyPriceDrop?fofoId=" + fofoId, function (response) {
1173
 
1190
 
1174
                        $('.ChartContainer').html(response);
1191
                        $('.ChartContainer').html(response);
1175
                    });
1192
                    });
1176
                });
1193
                });
1177
 
1194
 
1178
 
1195
 
1179
        $(document).on("click", ".pending_activation_chart",
1196
        $(document).on("click", ".analysis_pending_activation_chart",
1180
                function () {
1197
                function () {
1181
                    $(".pac").css("color", "blue");
1198
                    $(".pac").css("color", "blue");
1182
                    $(".pac").css("background-color", "white");
1199
                    $(".pac").css("background-color", "white");
1183
 
1200
 
1184
                    $(".pd").css("color", "white");
1201
                    $(".pd").css("color", "white");
Line 1190... Line 1207...
1190
                    $(".la").css("color", "white");
1207
                    $(".la").css("color", "white");
1191
                    $(".la").css("background-color", "#C0C0C0");
1208
                    $(".la").css("background-color", "#C0C0C0");
1192
 
1209
 
1193
                    $(".puo").css("color", "white");
1210
                    $(".puo").css("color", "white");
1194
                    $(".puo").css("background-color", "#C0C0C0");
1211
                    $(".puo").css("background-color", "#C0C0C0");
1195
 
-
 
-
 
1212
                    var fofoId = $(this).data("fofoid")
1196
                    sleep(500);
1213
                    sleep(500);
1197
                    doGetAjaxRequestHandler(context + "/getMonthlyActivation", function (response) {
1214
                    doGetAjaxRequestHandler(context + "/getMonthlyActivation?fofoId=" + fofoId, function (response) {
1198
 
1215
 
1199
                        $('.ChartContainer').html(response);
1216
                        $('.ChartContainer').html(response);
1200
                    });
1217
                    });
1201
                });
1218
                });
1202
 
1219
 
1203
        $(document).on("click", ".purchase_line_chart",
1220
        $(document).on("click", ".analysis_purchase_line_chart",
1204
                function () {
1221
                function () {
1205
                    $(".pa").css("color", "blue");
1222
                    $(".pa").css("color", "blue");
1206
                    $(".pa").css("background-color", "white");
1223
                    $(".pa").css("background-color", "white");
1207
                    $(".ba").css("color", "white");
1224
                    $(".ba").css("color", "white");
1208
                    $(".ba").css("background-color", "#C0C0C0");
1225
                    $(".ba").css("background-color", "#C0C0C0");
Line 1214... Line 1231...
1214
                    $(".pac").css("color", "white");
1231
                    $(".pac").css("color", "white");
1215
                    $(".pac").css("background-color", "#C0C0C0");
1232
                    $(".pac").css("background-color", "#C0C0C0");
1216
 
1233
 
1217
                    $(".puo").css("color", "white");
1234
                    $(".puo").css("color", "white");
1218
                    $(".puo").css("background-color", "#C0C0C0");
1235
                    $(".puo").css("background-color", "#C0C0C0");
1219
 
-
 
-
 
1236
                    var fofoId = $(this).data("fofoid")
1220
                    doGetAjaxRequestHandler(context + "/getMonthlyPurchaseLineChart", function (response) {
1237
                    doGetAjaxRequestHandler(context + "/getMonthlyPurchaseLineChart?fofoId=" + fofoId, function (response) {
1221
                        $('.ChartContainer').html(response);
1238
                        $('.ChartContainer').html(response);
1222
                    });
1239
                    });
1223
                });
1240
                });
1224
 
1241
 
1225
        $(document).on("click", ".lms_line_chart",
1242
        $(document).on("click", ".analysis_lms_line_chart",
1226
                function () {
1243
                function () {
1227
 
1244
 
1228
                    $(".ba").css("color", "white");
1245
                    $(".ba").css("color", "white");
1229
                    $(".ba").css("background-color", "#C0C0C0");
1246
                    $(".ba").css("background-color", "#C0C0C0");
1230
                    $(".pa").css("color", "white");
1247
                    $(".pa").css("color", "white");
Line 1237... Line 1254...
1237
                    $(".pac").css("color", "white");
1254
                    $(".pac").css("color", "white");
1238
                    $(".pac").css("background-color", "#C0C0C0");
1255
                    $(".pac").css("background-color", "#C0C0C0");
1239
 
1256
 
1240
                    $(".puo").css("color", "white");
1257
                    $(".puo").css("color", "white");
1241
                    $(".puo").css("background-color", "#C0C0C0");
1258
                    $(".puo").css("background-color", "#C0C0C0");
1242
 
-
 
-
 
1259
                    var fofoId = $(this).data("fofoid")
1243
                    doGetAjaxRequestHandler(context + "/getlmsLineChart", function (response) {
1260
                    doGetAjaxRequestHandler(context + "/getlmsLineChart?fofoId=" + fofoId, function (response) {
1244
                        $('.ChartContainer').html(response);
1261
                        $('.ChartContainer').html(response);
1245
                    });
1262
                    });
1246
                });
1263
                });
1247
 
1264
 
1248
        $(document).on("click", ".bar_chart",
1265
        $(document).on("click", ".analysis_bar_chart",
1249
                function () {
1266
                function () {
1250
                    $(".ba").css("color", "blue");
1267
                    $(".ba").css("color", "blue");
1251
                    $(".ba").css("background-color", "white");
1268
                    $(".ba").css("background-color", "white");
1252
                    $(".la").css("color", "white");
1269
                    $(".la").css("color", "white");
1253
                    $(".la").css("background-color", "#C0C0C0");
1270
                    $(".la").css("background-color", "#C0C0C0");
Line 1260... Line 1277...
1260
                    $(".pac").css("background-color", "#C0C0C0");
1277
                    $(".pac").css("background-color", "#C0C0C0");
1261
 
1278
 
1262
                    $(".puo").css("color", "white");
1279
                    $(".puo").css("color", "white");
1263
                    $(".puo").css("background-color", "#C0C0C0");
1280
                    $(".puo").css("background-color", "#C0C0C0");
1264
 
1281
 
1265
 
-
 
-
 
1282
                    var fofoId = $(this).data("fofoid")
1266
                    doGetAjaxRequestHandler(context + "/getBarChart", function (response) {
1283
                    doGetAjaxRequestHandler(context + "/analysis/getBarChart?fofoId=" + fofoId, function (response) {
1267
                        $('.ChartContainer').html(response);
1284
                        $('.ChartContainer').html(response);
1268
                    });
1285
                    });
1269
                });
1286
                });
1270
 
1287
 
1271
 
1288
 
Line 1756... Line 1773...
1756
            }
1773
            }
1757
        });
1774
        });
1758
    }
1775
    }
1759
 
1776
 
1760
 
1777
 
1761
    $(document).on('click', '#viewSaleBarChart', function () {
1778
    $(document).on('click', '#analysis_viewSaleBarChart', function () {
-
 
1779
        let partnerId = $(this).data("fofoid");
1762
        let from = $('#chartForm').val();
1780
        let from = $('#chartForm').val();
1763
        let to = $('#chartTo').val();
1781
        let to = $('#chartTo').val();
1764
        let quantity_type = $('select[name="quantityType"]').val();
1782
        let quantity_type = $('select[name="quantityType"]').val();
1765
        console.log("from - ", from);
1783
        console.log("from - ", from);
1766
        console.log("to - ", to);
1784
        console.log("to - ", to);
1767
        console.log("tquantity_typeo - ", quantity_type);
1785
        console.log("tquantity_typeo - ", quantity_type);
-
 
1786
        console.log("fofoId - ", partnerId);
1768
 
1787
 
1769
        doGetAjaxRequestHandler(`${context}/getBarChart?from=${from}&to=${to}&isQuantity=${quantity_type}`, function (response) {
1788
        doGetAjaxRequestHandler(`${context}/analysis/getBarChart?fofoId=${partnerId}&from=${from}&to=${to}&isQuantity=${quantity_type}`, function (response) {
1770
            console.log("res - ", response);
1789
            console.log("res - ", response);
1771
            $('.model_charbar_container').html("");
1790
            $('.model_charbar_container').html("");
1772
            $('.ChartContainer').html(response);
1791
            $('.ChartContainer').html(response);
1773
        });
1792
        });
1774
    });
1793
    });