| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784 |
- define(['app'], function (app) {
- app.controller('UserRegistrationCtrl', function ($scope, $rootScope, AppData, $location) {
- $rootScope.menucont = true;
- $rootScope.pageLoadComp = false;
- $scope.formLoad = false;
- $scope.listFound = false;
- $scope.pageData = registrationData[$rootScope.selLanguage];
- $scope.submenu = $scope.pageData.sidemenu;
- $scope.url = "../senddata/log/";
- $scope.pageurl = "../senddata/report/";
- $scope.exporturl = "../senddata/reportdownload/";
- $scope.commonurl = "../senddata/common/";
- $scope.userurl = "../senddata/user/";
- $rootScope.sideselect = $scope.pageData.sidemenu[0];
- //Check Session//
- $scope.formData = {}
- $rootScope.formData = {}
- $scope.dseInactive=false;
- $scope.remarkslist=[];
- $scope.currentDate = moment().format("YYYY-MM-DD");
- console.log($scope.currentDate)
- $scope.startingDate = moment().startOf('month').format('YYYY-MM-DD');
- $scope.startingMonth = moment().startOf('month').format('MMMM YYYY');
- $scope.totalremarkscount=0;
- //pagination
- $scope.viewby = '10';
- $scope.currentPage = 1;
- $scope.itemsPerPage = $scope.viewby;
- $scope.maxSize = 5; //Number of pager buttons to show
- //Check Session//
-
- $scope.formData.ismenuload = "Yes";
- if ($rootScope.items == undefined || $rootScope.items == null) {
- $scope.formData.ismenuload = "No";
- }
- $scope.formData.funName = "checksession";
- $scope.formData.lang = $rootScope.selLanguage;
- $scope.formData.start = 2;
- $scope.formData.limit = 5;
- console.log($scope.startingMonth)
- $scope.formData.ismenuload = "Yes";
- if ($rootScope.items == undefined || $rootScope.items == null) {
- $scope.formData.ismenuload = "No";
- }
- $scope.formData.funName = "checksession";
- $scope.formData.lang = $rootScope.selLanguage;
- $scope.formData.start = 0;
- $scope.formData.limit = 2;
- AppData.sendData($scope.url, $scope.formData, function (res) {
- if (res.cont) {
- if ($rootScope.items == undefined || $rootScope.items == null) {
- $rootScope.items = res.item.control;
- }
- if ($rootScope.items != undefined) {
- for (var i = 0; i < $rootScope.items.length; i++) {
- if ($location.path() == $rootScope.items[i].modulepath) {
- $rootScope.modulename = $rootScope.items[i].modulename;
- $scope.usercontrol = String($rootScope.items[i].permission).split("|");
- }
- }
- }
- angular.element(document.querySelector('.table_area')).bind('scroll', function () {
- $('.datepicker').datepicker("hide")
- })
- // $scope.getZm();
- $scope.listClick($scope.submenu[0])
- console.log($rootScope.sideselect.id)
- } else {
- $location.path("/login");
- }
- })
- $scope.listClick = function (obj) {
- console.log(obj.id)
- $scope.formData = {}
- // $scope.currentPage = 1;
- $rootScope.sideselect = obj;
- $rootScope.sideselect.name = obj.name;
-
- if (obj.id == 1) {
- // $("<link rel='stylesheet' type='text/css' href='module/report/user-registration/css/user-registration.css' />").appendTo( 'head' );
- } else if (obj.id == 2) {
- $scope.formData = {};
- // $("<link rel='stylesheet' type='text/css' href='module/report/user-registration/css/test.css' />").appendTo( 'head' );
- $scope.selectTab('1')
- }
- $scope.getZm();
- }
- ///////////// Zone Data /////////////////
- $scope.getZm = function () {
- $scope.formData = {};
- $scope.dseInactive=false;
- $scope.formData.datetype = '4';
- $scope.formData.from_month = $scope.startingMonth
- $scope.formData.regtype = '1';
- console.log($scope.formData)
- if ($scope.formData.datetype == '1' || $scope.formData.datetype == '2' || $scope.formData.datetype == '3' || $scope.formData.datetype == '4') {
- $scope.formData.from_date = '';
- $scope.formData.to_date = '';
- } else {
- $scope.formData.from_date = $scope.startingDate;
- $scope.formData.to_date = $scope.currentDate;
- }
- $scope.formData.zm_email = "all";
- $scope.rmInactive = true;
- $scope.amInactive = true;
- var zobj = {};
- zobj.funName = "zmlist";
- zobj.lang = $rootScope.selLanguage;
- AppData.sendData($scope.commonurl, zobj, function (res) {
- console.log(res)
- $scope.zmuser_list = res.item;
- $scope.zmChange()
- })
- }
- $scope.zmChange = function () {
- $scope.dseInactive=false;
- $scope.dealerInactive=true;
- console.log($scope.formData.zm_email)
- $scope.formData.rm_email = "all";
- $scope.formData.am_email = "all";
- if ($scope.formData.zm_email == "all") {
- $scope.rmInactive = true;
- $scope.amInactive = true;
- if ($rootScope.sideselect.id == 1) {
- $scope.userRegistrationData()
- $scope.userRegistrationList()
- } else if ($rootScope.sideselect.id == 2) {
- $scope.userActivationData()
- } else if ($rootScope.sideselect.id == 3) {
- $scope.userInactiveRegistrationData()
- $scope.userInactiveRegistrationList()
- }
- } else {
- $scope.rmInactive = false;
- $scope.amInactive = true;
- $scope.getRm();
- }
- }
- ///////////// Regional Data //////////////
- $scope.getRm = function () {
- $scope.dseInactive=false;
- $scope.formData.rm_email = "all";
- var robj = {};
- robj.funName = "rmlist";
- robj.lang = $rootScope.selLanguage;
- robj.zm_email = $scope.formData.zm_email;
- AppData.sendData($scope.commonurl, robj, function (res) {
- console.log(res)
- $scope.rmuser_list = res.item;
- $scope.rmChange()
- })
- }
- $scope.rmChange = function () {
- $scope.dseInactive=false;
- $scope.dealerInactive=true;
- $scope.formData.am_email = "all"
- $scope.formData.dealer_code = "";
- if ($scope.formData.rm_email == "all") {
- $scope.amInactive = true;
- if ($rootScope.sideselect.id == 1) {
- $scope.userRegistrationData()
- $scope.userRegistrationList()
- } else if ($rootScope.sideselect.id == 2) {
- $scope.userActivationData()
- } else if ($rootScope.sideselect.id == 3) {
- $scope.userInactiveRegistrationData()
- $scope.userInactiveRegistrationList()
- }
- } else {
- // alert($scope.formData.rm_email)
- $scope.amInactive = false;
- if ($rootScope.sideselect.id == 1) {
- $scope.userRegistrationData()
- $scope.userRegistrationList()
- } else if ($rootScope.sideselect.id == 2) {
- $scope.userActivationData()
- } else if ($rootScope.sideselect.id == 3) {
- $scope.userInactiveRegistrationData()
- $scope.userInactiveRegistrationList()
- }
- $scope.getAm();
- }
- }
- //////////// Area Manager Data ///////////////////
- $scope.getAm = function () {
- $scope.dseInactive=false;
- var aobj = {};
- aobj.funName = "amlist";
- aobj.lang = $rootScope.selLanguage;
- aobj.rm_email = $scope.formData.rm_email;
- AppData.sendData($scope.commonurl, aobj, function (res) {
- console.log(res)
- $scope.amuser_list = res.item;
- // $scope.amChange()
- })
- }
- $scope.amChange = function () {
- $scope.dseInactive=false;
- $scope.dealerInactive=true;
- if ($rootScope.sideselect.id == 1) {
- $scope.userRegistrationData()
- $scope.userRegistrationList()
- } else if ($rootScope.sideselect.id == 2) {
- $scope.userActivationData()
- } else if ($rootScope.sideselect.id == 3) {
- $scope.userInactiveRegistrationData()
- $scope.userInactiveRegistrationList()
- }
- $scope.getDealer()
- }
- $scope.chartData = function () {
- $scope.userRegistrationData()
- $scope.userRegistrationList();
- }
- $scope.inactiveChartData = function () {
- $scope.userInactiveRegistrationData()
- $scope.userInactiveRegistrationList();
- }
- $scope.userRegistrationList = function () {
- var obj = {};
- // obj.funName = "user_registration_percent";
- obj.funName = "user_registration_percent_v2";
- obj.zm_email = $scope.formData.zm_email;
- obj.rm_email = $scope.formData.rm_email;
- obj.am_email = $scope.formData.am_email;
- obj.from_date = $scope.formData.from_date;
- obj.to_date = $scope.formData.to_date;
- obj.regtype = $scope.formData.regtype;
- obj.datetype = $scope.formData.datetype;
- AppData.sendData($scope.pageurl, obj, function (res) {
- if (res.cont) {
- console.log(res.item)
- $scope.userPercentList = res.item;
- } else {
- $scope.userPercentList = []
- }
- })
- }
- $scope.userInactiveRegistrationList = function () {
- // alert("initialized-->"+$scope.currentPage)
- var obj = {};
- $scope.searchvalue = ($scope.formData.mymodel != '') ? $scope.formData.mymodel : "";
- obj.funName = "inactive_user_registration_list";
- obj.zm_email = $scope.formData.zm_email;
- obj.rm_email = $scope.formData.rm_email;
- obj.am_email = $scope.formData.am_email;
- obj.from_date = $scope.formData.from_date;
- obj.to_date = $scope.formData.to_date;
- obj.regtype = $scope.formData.regtype
- obj.lang = $rootScope.selLanguage;
- obj.pn = $scope.currentPage;
- obj.nr = $scope.itemsPerPage;
- obj.key = $scope.searchvalue
-
- AppData.sendData($scope.pageurl, obj, function (res) {
- if (res.cont) {
- console.log(res.item)
- $scope.userPercentList = res.item;
- $scope.totalItems = res.item.total_records;
- $scope.listFound = true;
- $scope.search_box = true;
- }else{
- $scope.listFound = false;
- $scope.errorMsg = res.mess;
- }
- })
-
-
- $scope.pageChanged = function(tempval) {
- $scope.currentPage=tempval
- console.log('Page changed to: ' + $scope.currentPage);
- $scope.userInactiveRegistrationList();
- };
-
- $scope.filterData = function() {
- console.log($scope.searchtext)
- $scope.userInactiveRegistrationList();
- }
- }
-
- $scope.onSearchChange = function () {
- console.log($scope.formData.mymodel)
- $scope.userInactiveRegistrationList();
- }
- $scope.selectStatus = function () {
- $scope.userRegistrationData();
- $scope.userRegistrationList();
- }
- $scope.selectInActiveStatus = function () {
- $scope.userInactiveRegistrationList()
- // $scope.userRegistrationData();
- // $scope.userRegistrationList();
- }
- $scope.selectActiveStatus = function () {
- $scope.userActivationData();
- }
- //////////////// User Registration Report ////////////////////
- $scope.userRegistrationData = function () {
- $scope.userLabel = [];
- $scope.userValue = [];
- // $scope.formData.status = [];
- $scope.formData.funName = "user_registration";
- // $scope.formData.from_date = $scope.formData.fromDate;
- // $scope.formData.to_date = $scope.formData.toDate;
- AppData.sendData($scope.pageurl, $scope.formData, function (res) {
- if (res.cont) {
- console.log(res.item)
- $scope.userReport = res.item;
- $rootScope.modulename = 'report';
- for (var i = 0; i < $scope.userReport.value.length; i++) {
- $scope.userLabel.push($scope.userReport.value[i].title)
- $scope.userValue.push(Number($scope.userReport.value[i].value))
- }
- console.log($scope.userLabel)
- console.log($scope.userValue)
- var showChart;
- if (Math.max(...$scope.userValue) == 0) {
- console.log('false')
- showChart = false;
- $('.inner-container').html('');
- $('.inner-container').html("<h4 class='text-center' >No data found</h4>");
- } else {
- showChart = true;
- $scope.areaChart();
- }
- } else {
- $scope.userReport = [];
- $('.inner-container').html('');
- $('.inner-container').html("<h4 class='text-center' >No data found</h4>");
- }
- })
- }
- //////////////// User Registration Report ////////////////////
- $scope.userInactiveRegistrationData = function () {
- $scope.userLabel = [];
- $scope.userValue = [];
- $scope.formData.funName = "inactive_user_registration";
- // $scope.formData.from_date = $scope.formData.fromDate;
- // $scope.formData.to_date = $scope.formData.toDate;
- AppData.sendData($scope.pageurl, $scope.formData, function (res) {
- if (res.cont) {
- console.log(res.item)
- $scope.userReport = res.item;
- $rootScope.modulename = 'report';
- for (var i = 0; i < $scope.userReport.value.length; i++) {
- $scope.userLabel.push($scope.userReport.value[i].title)
- $scope.userValue.push(Number($scope.userReport.value[i].value))
- }
- console.log($scope.userLabel)
- console.log($scope.userValue)
- var showChart;
- if (Math.max(...$scope.userValue) == 0) {
- console.log('false')
- showChart = false;
- $('.inner-container').html('');
- $('.inner-container').html("<h4 class='text-center' >No data found</h4>");
- } else {
- showChart = true;
- $scope.areaChart();
- }
- } else {
- $scope.userReport = [];
- $('.inner-container').html('');
- $('.inner-container').html("<h4 class='text-center' >No data found</h4>");
- }
- })
- }
- $scope.areaChart = function () {
- var maxValue = 0;
- if (Math.max.apply(Math, $scope.userValue) == 0) {
- maxValue += 10
- } else {
- maxValue += Math.max.apply(Math, $scope.userValue) + 1;
- }
- console.log(maxValue)
- $('.inner-container').html('');
- $('.inner-container').html('<canvas id="registrationChart"></canvas>');
- var ctx = document.getElementById('registrationChart').getContext("2d");
- Chart.defaults.global.legend.display = true;
- var gradientStroke = ctx.createLinearGradient(500, 0, 100, 0);
- gradientStroke.addColorStop(0, '#80b6f4');
- gradientStroke.addColorStop(1, '#f49080');
- var gradientFill = ctx.createLinearGradient(500, 0, 100, 0);
- gradientFill.addColorStop(0, "rgba(128, 182, 244, 0.6)");
- gradientFill.addColorStop(1, "rgba(244, 144, 128, 0.6)");
- var registrationChart = new Chart(ctx, {
- type: 'line',
- data: {
- labels: $scope.userLabel,
- datasets: [{
- label: "User Registration",
- borderColor: gradientStroke,
- pointBorderColor: gradientStroke,
- pointBackgroundColor: gradientStroke,
- pointHoverBackgroundColor: gradientStroke,
- pointHoverBorderColor: gradientStroke,
- pointBorderWidth: 10,
- pointHoverRadius: 10,
- pointHoverBorderWidth: 1,
- pointRadius: 3,
- fill: true,
- backgroundColor: gradientFill,
- borderWidth: 4,
- scaleStartValue: 0,
- data: $scope.userValue
- }]
- },
- options: {
- beginAtZero: true,
- legend: {
- position: "bottom"
- },
- scales: {
- yAxes: [{
- ticks: {
- min: 0,
- suggestedMin: 0,
- fontColor: "rgba(0,0,0,0.5)",
- fontStyle: "bold",
- maxTicksLimit: 5,
- padding: 20,
- max: maxValue,
- },
- gridLines: {
- drawTicks: false,
- display: false
- }
- }],
- xAxes: [{
- gridLines: {
- zeroLineColor: "transparent"
- },
- ticks: {
- padding: 20,
- fontColor: "rgba(0,0,0,0.5)",
- fontStyle: "bold",
- }
- }]
- },
- }
- });
- }
- $scope.exportData = function () {
- if ($rootScope.sideselect.id == 1) {
- $scope.formData.funName = "user_registration"
- } else if ($rootScope.sideselect.id == 2) {
- $scope.formData.funName = "activeinactive_report"
- // $scope.formData.funName="activeinactive_report_v2"
- } else if ($rootScope.sideselect.id == 3) {
- $scope.formData.funName = "inactive_user_registration"
- }
- AppData.sendData($scope.exporturl, $scope.formData, function (res) {
- if (res.cont) {
- $('body').append("<iframe id='fileDownload' src='" + res.item.report_url + "' ></iframe>");
- var setO = setTimeout(function () {
- clearTimeout(setO);
- $('#fileDownload').remove();
- }, 2000);
- }
- })
- }
- $scope.viewdetails = function(id){
- $rootScope.cofirmWindow = true;
- $rootScope.modalShown = true;
- $rootScope.message = $scope.pageData.errorMsg[4];
- $scope.formData.userid = id;
- }
- $scope.$on("confirmDelete", function () {
- $scope.formData.funName = "activeuser";
- AppData.sendData($scope.userurl, $scope.formData, function (res) {
- console.log(res);
- if (res.cont) {
- $scope.userInactiveRegistrationList();
- }
- })
- })
- $scope.exportTableData = function () {
- if ($rootScope.sideselect.id == 1) {
- $scope.formData.funName = "user_registration_percent"
- } else if ($rootScope.sideselect.id == 2) {
- $scope.formData.funName = "inactive_user_table"
- } else if ($rootScope.sideselect.id == 3) {
- $scope.formData.funName = "inactive_user_registration"
- }
- AppData.sendData($scope.exporturl, $scope.formData, function (res) {
- if (res.cont) {
- $('body').append("<iframe id='fileDownload' src='" + res.item.report_url + "' ></iframe>");
- var setO = setTimeout(function () {
- clearTimeout(setO);
- $('#fileDownload').remove();
- }, 2000);
- }
- })
- }
- /////////// Custom Filter /////////////
- $scope.dataFilter = function () {
- if ($scope.formData.datetype == '1' || $scope.formData.datetype == '2' || $scope.formData.datetype == '3' || $scope.formData.datetype == '4') {
- $scope.formData.from_date = '';
- $scope.formData.to_date = '';
- } else {
- $scope.formData.from_date = $scope.startingDate;
- $scope.formData.to_date = $scope.currentDate;
- }
- $scope.userRegistrationData();
- $scope.userRegistrationList();
- }
- ///////////////////////// Active / Inactive Report /////////////////////
- $scope.activeChart = function () {
- console.log($scope.tabActive)
- $('.inner-container' + $scope.tabActive).html('');
- $('.inner-container' + $scope.tabActive).html('<canvas id="statusChart' + $scope.tabActive + '"></canvas>');
- var ctx = document.getElementById("statusChart" + $scope.tabActive).getContext("2d");
- Chart.defaults.global.legend.display = true;
- var gradientStroke = ctx.createLinearGradient(500, 0, 100, 0);
- gradientStroke.addColorStop(0, '#80b6f4');
- gradientStroke.addColorStop(1, '#f49080');
- var yAxesticks = [];
- var highestVal;
- var statusChart1 = new Chart(ctx, {
- type: 'line',
- data: {
- labels: $scope.activeLabel,
- datasets: [
- {
- label: "Initial Users",
- borderColor: "#FD5F80",
- pointBorderColor: "#FD5F80",
- pointBackgroundColor: "#FD5F80",
- pointHoverBackgroundColor: "#FD5F80",
- pointHoverBorderColor: "#FD5F80",
- pointBorderWidth: 10,
- pointHoverRadius: 10,
- pointHoverBorderWidth: 1,
- pointRadius: 3,
- fill: false,
- borderWidth: 4,
- backgroundColor: '#FD5F80',
- data: $scope.initialArray
- },
- {
- label: "Active Users",
- borderColor: "#31A0EA",
- pointBorderColor: "#31A0EA",
- pointBackgroundColor: "#31A0EA",
- pointHoverBackgroundColor: "#31A0EA",
- pointHoverBorderColor: "#31A0EA",
- pointBorderWidth: 10,
- pointHoverRadius: 10,
- pointHoverBorderWidth: 1,
- pointRadius: 3,
- fill: false,
- borderWidth: 4,
- backgroundColor: '#31A0EA',
- data: $scope.activeArray
- }, {
- label: "Inactive Users",
- borderColor: "#FEC94D",
- pointBorderColor: "#FEC94D",
- pointBackgroundColor: "#FEC94D",
- pointHoverBackgroundColor: "#FEC94D",
- pointHoverBorderColor: "#FEC94D",
- pointBorderWidth: 10,
- pointHoverRadius: 10,
- pointHoverBorderWidth: 1,
- pointRadius: 3,
- fill: false,
- borderWidth: 4,
- backgroundColor: '#FEC94D',
- data: $scope.inactiveArray
- }
- ]
- },
- options: {
- legend: {
- position: "bottom"
- },
- scales: {
- yAxes: [{
- ticks: {
- fontColor: "rgba(0,0,0,0.5)",
- fontStyle: "bold",
- beginAtZero: true,
- maxTicksLimit: 3,
- padding: 20,
- scaleStartValue: 0,
- min: 0,
- suggestedmin: 0,
- callback: function (value, index, values) {
- yAxesticks = values;
- return value;
- }
- },
- gridLines: {
- drawTicks: false,
- display: false
- }
- }],
- xAxes: [{
- gridLines: {
- zeroLineColor: "transparent"
- },
- ticks: {
- padding: 20,
- fontColor: "rgba(0,0,0,0.5)",
- fontStyle: "bold"
- }
- }]
- }
- }
- });
- // statusChart1.options.scales.yAxes[0].ticks.min = 0;
- // statusChart1.update();
- console.log(statusChart1.options.scales.yAxes[0].ticks.min)
- }
- $scope.selectTab = function (tab) {
- $scope.tabActive = tab;
- $scope.userActivationData();
- // setTimeout(function () {
- // $scope.activeChart();
- // }, 100)
- }
- $scope.activeData = function () {
- $scope.userActivationData();
- }
- $scope.userActivationData = function () {
- // console.log("hai");
- // console.log($("#from").val())
- console.log($scope.formData)
- var val = $("#from").val();
- if (val == '' || val == undefined) {
- $('#from').datepicker("setDate", "today");
- $('#to').datepicker("setDate", "today");
- // $("#from").val($scope.startingMonth)
- // $("#to").val($scope.startingMonth)
- $scope.startMonth = moment($scope.startingMonth).format("YYYY-MM-DD");
- $scope.endMonth = moment($scope.startingMonth).format("YYYY-MM-DD");
- } else {
- $scope.startMonth = moment($("#from").val()).format("YYYY-MM-DD");
- $scope.endMonth = moment($("#to").val()).format("YYYY-MM-DD");
- }
- // $scope.formData.from_month = moment($("#from").val()).format("DD-MM-YYYY");
- // $scope.formData.to_month = moment($("#to").val()).format("DD-MM-YYYY");
- // console.log($("#to").val())
- if ($scope.tabActive == 1) {
- $scope.formData.type = 0;
- } else if ($scope.tabActive == 2) {
- $scope.formData.type = 1;
- }
- // $scope.formData.funName = "activeinactive_report";
- $scope.formData.funName = "activeinactive_report_v2";
- $scope.formData.from_date = $scope.startMonth
- $scope.formData.to_date = $scope.endMonth
- // console.log($scope.formData)
- AppData.sendData($scope.pageurl, $scope.formData, function (res) {
- if (res.cont) {
- console.log(res.item)
- $scope.userPercentList = res.item;
- // userPercentList=res.list
- // console.log(res.cont)
- // $scope.userActiveReport = res.item;
- // $scope.activeLabel = res.item.label;
- // $scope.activeReportValue = $scope.userActiveReport.value;
- // console.log($scope.userActiveReport);
- // $scope.activeArray=[]
- // $scope.inactiveArray=[]
- // $scope.initialArray=[]
- // for(var i=0;i<$scope.activeReportValue.length;i++){
- // $scope.activeArray.push($scope.activeReportValue[i].active)
- // $scope.inactiveArray.push($scope.activeReportValue[i].inactive)
- // $scope.initialArray.push($scope.activeReportValue[i].inital)
- // }
- // var arr = [$scope.activeArray, $scope.inactiveArray,$scope.initialArray];
- // var maxRow = arr.map(function(row){ return Math.max.apply(Math, row) });
- // if(Math.max(...maxRow)!=0){
- // $scope.activeChart();
- // }else{
- // $('.inner-container' + $scope.tabActive).html('');
- // $('.inner-container'+ $scope.tabActive).html("<h4 class='text-center' >No data found</h4>");
- // }
- }
- })
- }
- $scope.getDealer = function () {
- $scope.dealerInactive=false;
- // $scope.dseInactive=true;
- $scope.formData.dealer_code='all';
- var aobj = {};
- aobj.funName = "dealerlist";
- aobj.lang = $rootScope.selLanguage;
- aobj.am_email = $scope.formData.am_email;
- AppData.sendData($scope.commonurl, aobj, function (res) {
- $scope.dealer_userlist = res.item;
- // $scope.amChange()
- })
- }
- $scope.dealerChange = function(){
- if($scope.formData.dealer_code =='all'){
- $scope.dseInactive=false;
- }else{
- $scope.dseInactive=true;
- }
-
- $scope.userActivationData();
- }
- $scope.modal_dismiss = function(){
- // if($scope.currentPage>=2){
- // $scope.currentPage = 1;
- // $scope.setPage($scope.currentPage);
- // }
- // $(".pagination li").removeClass("active");
- // $('#modal').on('hidden.bs.modal', function() {
- // $(this).removeData('bs.modal');
- // });
- $('.myViewModal').modal('hide');
- // console.log('page'+$scope.currentPage )
- }
- $scope.viewremarks =function(paramvalue){
- console.log(paramvalue);
- var aobj = {};
- aobj.funName = "dse_remark";
- aobj.userid = paramvalue.userid;
- aobj.pn='0';
- aobj.nr='10';
- AppData.sendData($scope.pageurl, aobj, function (res) {
- $scope.remarkslist = res.item.report;
- $scope.totalremarkscount=res.total_records;
- $scope.totalItems=$scope.totalremarkscount;
- console.log("$scope.remarkslist--->,$scope.remarkslist")
- })
- }
- });
- });
|