app.controller('MainCtrl', [ '$rootScope', '$scope', '$timeout', function($rootScope, $scope, $timeout) { if (!$rootScope.loginSuccess) return; $scope.showAppointment = false; $scope.showTicket = false; $scope.showInfo = false; $scope.getEnrolArray2 = function() { console.log('12312'); $rootScope.ajaxRequest({ url : '../enrol/std/enrol/list.htm' }, function(response) { $scope.EnrolArray2 = response.array; console.log(response.array); }); } $scope.getEnrolArray = function() { var today = $rootScope.shortDateString(new Date()); var now = new Date(); $rootScope.ajaxRequest({ url : '../enrol/std/score/ym/final/list.htm' }, function(response) { $rootScope.EnrolArray = response.array; var qualified_total = 0; for(var i=0;i