'use strict'; /*** controller for Wizard Form example***/ app.controller('myProfileCtrl', ["$scope", "$filter", "ngTableParams", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', function ($scope, $filter, ngTableParams, apiPoint, $http, SweetAlert, $state, md5, ipCookie) { /** * Logined user profile view * by : kdk */ var localDetail = JSON.parse(localStorage.getItem('localObj')); var localDetails = ipCookie('cookiechk'); $scope.init = function () { if (localDetail != null) { $scope.getProfile(); } else { } } $scope.loginUser = { 'staffID': '', 'fName': '', 'lName': '', 'mobileNumber': '', 'gender': '', 'branchCode': '', 'branchList': '', }; // client side logined details $scope.getProfile = function () { var req = { method: 'POST', url: apiPoint.url + 'employeeGetProf/', headers: { 'Content-Type': 'application/json' }, data: { employeeLoginID: localDetails.localUserID } }; $http(req).then(function (response) { if (response.data.empStatus == true) { /* * Get Top Nav user details */ $scope.userInfo = response.data.details; $scope.userStatusInfo = response.data.work_State; $scope.userBranchInfo = response.data.branch_details; // alert(JSON.stringify($scope.userInfo)); // alert(JSON.stringify($scope.userStatusInfo)); // alert(JSON.stringify($scope.userBranchInfo)); // $scope.loginImage = $scope.resultData.ProfilePicPath; // $scope.loginUser = { // 'staffID': $scope.resultData.StaffID, // 'fName': $scope.resultData.Firstname, // 'lName': $scope.resultData.Lastname, // 'mobileNumber': $scope.resultData.MobileNumber, // 'gender': $scope.resultData.Gender, // 'branchCode': $scope.resultData.BranchCode, // 'branchList': response.data.branch_details, // }; // var currArr = response.data.branch_details; // $scope.getCurrentBran = currArr.find(item => item.BranchCode === localDetails.localBranchID); } else { } }); }; }]);