university form upload access for admin and staff done

This commit is contained in:
gandhimathi 2018-09-18 11:50:02 +05:30
parent 5aa3b319cc
commit c7b923fc3b
5 changed files with 65 additions and 31 deletions

View File

@ -102,22 +102,17 @@ app.controller('sessionCtrl', ["$scope", "$localStorage", "$state", 'ipCookie',
$scope.checkStaff = function () {
var inlocalDetails = JSON.parse(localStorage.getItem('localObj'));
var inlocalDetailss = ipCookie('cookiechk');
console.log(inlocalDetails);
if (inlocalDetails != null) {
if ((inlocalDetails.localType == 'R002' && inlocalDetailss.localType == 'R002') || (inlocalDetails.localType == 'R005' && inlocalDetailss.localType == 'R005')) {
console.log('if');
} else {
if (inlocalDetails.localType == '' && inlocalDetailss.localType == '') {
console.log('else if');
ipCookie.remove('cookiechk');
$window.localStorage.clear();
$state.go('login.signin');
} else {
console.log('else else')
$location.url('/dashboard').replace();
$window.location.reload();
$state.go('app.dashboard');
@ -130,7 +125,7 @@ app.controller('sessionCtrl', ["$scope", "$localStorage", "$state", 'ipCookie',
} else {
$state.go('login.signin');
}
}
};
}]);
app.controller('topnavCtrl', ["$scope", "$http", "API_POINTS", "$localStorage", "$state", 'ipCookie', '$window', function ($scope, $http, apiPoint, $localStorage, $state, ipCookie, $window) {

View File

@ -20,20 +20,17 @@ app.controller('studentUnivFormIdFeeDetailsCtrl', ["$scope", "toaster", "$filter
const LOCALTYPE = logcheck.localType;
if (logcheck != null && (LOCALTYPE == 'R003' || LOCALTYPE == 'R004' || LOCALTYPE == 'R002' || LOCALTYPE == 'R005')) {
console.log("if");
} else {
if (logcheck != null && LOCALTYPE != 'R001') {
console.log("else if");
$state.go('app.dashboard');
} else {
console.log("else else");
window.localStorage.clear();
$state.go('login.signin');
}
}
if (localDetail != null) {
if (localDetails.localType === 'R004') {
if (localDetails.localType === 'R004' || localDetails.localType === 'R003' || localDetails.localType === 'R002') {
// $scope.getUniversityList();
$scope.getUniversitySearchList();
$scope.getUniveesityListFromApp();

View File

@ -8,7 +8,6 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil
/**
* student university fee details compare
*/
// get local client details
var localDetail = JSON.parse(localStorage.getItem('localObj'));
var localDetails = ipCookie('cookiechk');
@ -16,32 +15,17 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil
// load when html page load
$scope.init = function () {
var logcheck = JSON.parse(localStorage.getItem('localObj'));
const LOCALTYPE = logcheck.localType;
if (logcheck != null && (LOCALTYPE == 'R003' || LOCALTYPE == 'R004' || LOCALTYPE == 'R002' || LOCALTYPE == 'R005')) {
}else {
if(logcheck != null && LOCALTYPE !='R001') {
console.log("else if");
$state.go('app.dashboard');
} else {
console.log("else else");
window.localStorage.clear();
$state.go('login.signin');
}
}
if (localDetail != null) {
if (localDetails.localType === 'R004') {
// $scope.getUniversityList();
if (localDetail.localType === 'R004' || localDetail.localType === 'R003' || localDetail.localType === 'R002') {
// $scope.getUniversityList();
$scope.getUniversitySearchList();
$scope.getFileUploadUniversity();
} else {
ipCookie.remove('cookiechk');
$window.localStorage.clear();
localStorage.removeItem('localObj');
$state.go('login.signin');
}
} else {
$state.go('login.signin');
}
}
/*get university details for file upload

View File

@ -16,7 +16,7 @@ app.controller('univFormPaymentCtrl', ["$scope","$rootScope","$filter", "ngTable
$scope.init = function () {
if (localDetail != null) {
if (localDetail.localType === 'R004') {
if (localDetail.localType === 'R004' || localDetail.localType === 'R003' || localDetail.localType === 'R002') {
$scope.getPaymentUnivSearchData();
} else {
localStorage.removeItem('localObj');

View File

@ -1082,6 +1082,35 @@
</a>
</li>-->
<li ng-class="{'active open':$state.includes('app.formupload')}">
<a href="javascript:void(0)">
<div class="item-content">
<div class="item-media">
<i class="ti-check"></i>
</div>
<div class="item-inner">
<span class="title" translate="sidebar.nav.formupload.MAIN"> University Form Upload </span><i class="icon-arrow"></i>
</div>
</div>
</a>
<ul class="sub-menu">
<li ui-sref-active="active">
<a ui-sref="app.formupload.UnivFormEnroment" ng-click="checkAdmin()">
<span class="title" translate="sidebar.nav.formupload.STUDENTFEEDETAILCOMPARE"> Form Enrolment </span>
</a>
</li>
<li ui-sref-active="active">
<a ui-sref="app.formupload.studentUnivFormIdFeeDetails" ng-click="checkAdmin()">
<span class="title" translate="sidebar.nav.formupload.STUDENTFROMIDFEEDETAILS"> Form Fees </span>
</a>
</li>
<li ui-sref-active="active">
<a ui-sref="app.formupload.universityformpayment" ng-click="checkAdmin()">
<span class="title" translate="sidebar.nav.formupload.UNIVERSITYFORMPAYMENT"> Payment </span>
</a>
</li>
</ul>
</li>
@ -1363,6 +1392,35 @@
</ul>
</li>
<li ng-class="{'active open':$state.includes('app.formupload')}">
<a href="javascript:void(0)">
<div class="item-content">
<div class="item-media">
<i class="ti-check"></i>
</div>
<div class="item-inner">
<span class="title" translate="sidebar.nav.formupload.MAIN"> University Form Upload </span><i class="icon-arrow"></i>
</div>
</div>
</a>
<ul class="sub-menu">
<li ui-sref-active="active">
<a ui-sref="app.formupload.UnivFormEnroment" ng-click="checkStaff()">
<span class="title" translate="sidebar.nav.formupload.STUDENTFEEDETAILCOMPARE"> Form Enrolment </span>
</a>
</li>
<li ui-sref-active="active">
<a ui-sref="app.formupload.studentUnivFormIdFeeDetails" ng-click="checkStaff()">
<span class="title" translate="sidebar.nav.formupload.STUDENTFROMIDFEEDETAILS"> Form Fees </span>
</a>
</li>
<li ui-sref-active="active">
<a ui-sref="app.formupload.universityformpayment" ng-click="checkStaff()">
<span class="title" translate="sidebar.nav.formupload.UNIVERSITYFORMPAYMENT"> Payment </span>
</a>
</li>
</ul>
</li>
<!--<li ng-class="{'active open':$state.includes('app.myprofile')}">
<a ui-sref="app.myprofile" ng-click="checkStaff()">