main.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. app.controller('MainCtrl', [ '$rootScope', '$scope', '$timeout', function($rootScope, $scope, $timeout) {
  2. if (!$rootScope.loginSuccess)
  3. return;
  4. $scope.showAppointment = false;
  5. $scope.showTicket = false;
  6. $scope.showInfo = false;
  7. $scope.getEnrolArray2 = function() {
  8. console.log('12312');
  9. $rootScope.ajaxRequest({
  10. url : '../enrol/std/enrol/list.htm'
  11. }, function(response) {
  12. $scope.EnrolArray2 = response.array;
  13. console.log(response.array);
  14. });
  15. }
  16. $scope.getEnrolArray = function() {
  17. var today = $rootScope.shortDateString(new Date());
  18. var now = new Date();
  19. $rootScope.ajaxRequest({
  20. url : '../enrol/std/score/ym/final/list.htm'
  21. }, function(response) {
  22. $rootScope.EnrolArray = response.array;
  23. var qualified_total = 0;
  24. for(var i=0;i<response.array.length;i++){
  25. if(response.array[i].aspect_qualified !='不合格')
  26. qualified_total ++;
  27. }
  28. $rootScope.qualified_total = qualified_total ;
  29. if(response.array.length == 0) {
  30. $scope.getEnrolArray2();
  31. }
  32. });
  33. }
  34. $scope.goEnrol = function(e) {
  35. $rootScope.goLocation('ym/score/' + e.aspect_name);
  36. }
  37. $scope.getEnrolArray();
  38. } ])