course details changes done

This commit is contained in:
gandhimathi 2017-12-22 13:46:52 +05:30
parent 33cc5c4e9f
commit bdc3833b66

View File

@ -11,7 +11,6 @@ app.controller('sessionCtrl', ["$scope", "$localStorage", "$state", 'ipCookie',
// client side logined details // client side logined details
var localDetail = JSON.parse(localStorage.getItem('localObj')); var localDetail = JSON.parse(localStorage.getItem('localObj'));
var localDetails = ipCookie('cookiechk'); var localDetails = ipCookie('cookiechk');
console.log('session control');
$scope.getLoginDash = ''; $scope.getLoginDash = '';
@ -23,6 +22,9 @@ app.controller('sessionCtrl', ["$scope", "$localStorage", "$state", 'ipCookie',
} else if (localDetail.localType == 'R002') { } else if (localDetail.localType == 'R002') {
$scope.getLoginDash = 'staff'; $scope.getLoginDash = 'staff';
} }
else if (localDetail.localType == 'R001') {
$scope.getLoginDash = 'student';
}
} else { } else {
$state.go('login.signin'); $state.go('login.signin');
} }
@ -44,7 +46,7 @@ app.controller('topnavCtrl', ["$scope", "$http", "API_POINTS", "$localStorage",
var localDetail = JSON.parse(localStorage.getItem('localObj')); var localDetail = JSON.parse(localStorage.getItem('localObj'));
var localDetails = ipCookie('cookiechk'); var localDetails = ipCookie('cookiechk');
console.log(localDetails);
$scope.init = function () { $scope.init = function () {
if (localDetail != null) { if (localDetail != null) {
$scope.getProfile(); $scope.getProfile();
@ -73,7 +75,7 @@ app.controller('topnavCtrl', ["$scope", "$http", "API_POINTS", "$localStorage",
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
data: { data: {
employeeLoginID: localDetails.localUserID employeeLoginID: localDetails.localUserID,
} }
}; };
$http(req).then(function (response) { $http(req).then(function (response) {
@ -92,8 +94,11 @@ app.controller('topnavCtrl', ["$scope", "$http", "API_POINTS", "$localStorage",
'branchCode': $scope.resultData.BranchCode, 'branchCode': $scope.resultData.BranchCode,
'branchList': response.data.branch_details, 'branchList': response.data.branch_details,
}; };
var currArr = response.data.branch_details; if(response.data.branch_details.length > 0){
$scope.getCurrentBran = currArr.find(item => item.BranchCode === localDetails.localBranchID); var currArr = response.data.branch_details;
$scope.getCurrentBran = currArr.find(item => item.BranchCode === localDetails.localBranchID);
}
} else { } else {
} }
}); });