From 3d7535360087bb5c54e762cc0d59a8e0dd3db33e Mon Sep 17 00:00:00 2001 From: gayathri1990 Date: Tue, 12 Jun 2018 17:00:19 +0530 Subject: [PATCH] batchshedule --- Apollo/assets/js/controllers/schCtrl.js | 171 ++++++++++++------------ 1 file changed, 88 insertions(+), 83 deletions(-) diff --git a/Apollo/assets/js/controllers/schCtrl.js b/Apollo/assets/js/controllers/schCtrl.js index 54a1757f..865ff1a7 100755 --- a/Apollo/assets/js/controllers/schCtrl.js +++ b/Apollo/assets/js/controllers/schCtrl.js @@ -34,7 +34,7 @@ app.controller('schCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableP $scope.semDropDownShowLoading1 = false; $scope.semDetailsLoadingStatus1 = false; $scope.semDetailsLoadingTxt1 = ""; - $scope.setEditId = function (pid,cid,schid,subid,c) { + $scope.setEditId = function (pid,cid,schid,subid,c) { var branchid=JSON.parse(localStorage.getItem('localObj')).localBranchID; $scope.semDetailsLoadingStatus1 = true; $scope.semDetailsLoadingTxt1 = "Loading..."; @@ -118,85 +118,7 @@ app.controller('schCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableP $scope.reverse = !$scope.reverse; //if true make it false and vice versa } - /* - * init function - * created by TamilBala - * */ - $scope.init = function () { - - var branchid=JSON.parse(localStorage.getItem('localObj')).localBranchID; - //alert(branchid); - $scope.semDetailsLoadingStatus = true; - $scope.semDetailsLoadingTxt = "Loading..."; - - var getUniv = { - method: 'POST', - url: apiPoint.url + 'getUniversityCourseDetails/', - headers: { - 'Content-Type': 'application/json' - }, - data: { - requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, - branchId:JSON.parse(localStorage.getItem('localObj')).localBranchID - - } - }; - - - $http(getUniv).then(function (response) { - if (response.data.status==200 && response.data.universityStatus) { - $scope.university=response.data.univerSityDetails; - - - - } else { - - $scope.university=""; - - } - }); - - $scope.selectedCourseNameC = { - list: $scope.selectedCourseName, - } - - /* - * getUnivid function - * created by TamilBala - * */ - - var getUnivid = { - method: 'POST', - url: apiPoint.url + 'getUniversityCourseId/', - headers: { - 'Content-Type': 'application/json' - }, - data: { - //requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, - branchCode:branchid, - - } - }; - $http(getUnivid).then(function (response) { - if (response.data.status==200) - { - - $scope.universitycourse=response.data.getUnivDetailsinfo; - - - - } else { - - - $scope.universitycourse=""; - - } - }); - - - - - } + //Assign Courses to Course array for Multiple select @@ -446,6 +368,7 @@ app.controller('schCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableP if (response.data.status==200) { swal(" ", "Saved successfully,", "success"); + $scope.init(); } },function(error){ @@ -493,9 +416,11 @@ app.controller('schCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableP $http(update).then(function (response) { if (response.data.status==200 ) { // $scope.ldloading[loading.replace('-', '_')] = false; - //$scope.editId = -1; - $scope.init(); - swal("", "Saved Successfully.", "success"); + // + + swal("", "Saved Successfully.", "success"); + //$scope.editId = -1; + // $scope.init(); } else { @@ -551,6 +476,86 @@ app.controller('schCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableP } + /* + * init function + * created by TamilBala + * */ + $scope.init = function () { + + + var branchid=JSON.parse(localStorage.getItem('localObj')).localBranchID; + //alert(branchid); + $scope.semDetailsLoadingStatus = true; + $scope.semDetailsLoadingTxt = "Loading..."; + + var getUniv = { + method: 'POST', + url: apiPoint.url + 'getUniversityCourseDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, + branchId:JSON.parse(localStorage.getItem('localObj')).localBranchID + + } + }; + + + $http(getUniv).then(function (response) { + if (response.data.status==200 && response.data.universityStatus) { + $scope.university=response.data.univerSityDetails; + + + + } else { + + $scope.university=""; + + } + }); + + $scope.selectedCourseNameC = { + list: $scope.selectedCourseName, + } + + /* + * getUnivid function + * created by TamilBala + * */ + + var getUnivid = { + method: 'POST', + url: apiPoint.url + 'getUniversityCourseId/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + //requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, + branchCode:branchid, + + } + }; + $http(getUnivid).then(function (response) { + if (response.data.status==200) + { + + $scope.universitycourse=response.data.getUnivDetailsinfo; + + + + } else { + + + $scope.universitycourse=""; + + } + }); + + + + + } $scope.batchschedule={