angular.module("app").controller('EnrolNavCtrl', function($rootScope, $scope,$sce) {
	// 通用ajax请求

	$rootScope.ajaxRequest('../enrol/std/school/aspect/list.htm', {}, function(array) {
		angular.forEach(array,function(ap){
			ap.aspect_notice = $sce.trustAsHtml(ap.aspect_notice );
		});
		$scope.AspectArray = array;
	}, 'array');

	$scope.goEnrol = function(ap) {
		var enrol = {};
		enrol.std_id = $rootScope.GobalStdReg.std_id;
		enrol.aspect_id = ap.aspect_id;
		$rootScope.ajaxRequest('../enrol/std/enrol/save.htm', enrol, function(entity) {
			$rootScope.msg('专业报考完成，为保证报考生效，请尽快缴费！', undefined, function() {
				$rootScope.goUrl('enrolinfo', {
					pay_flag : true,
					enrol_id : entity.enrol_id

				})
			});
			
//			$rootScope.msg('专业报考完成！', undefined, function() {
//				$scope.goUrl('main'); //返回主页
//				return;
//			});

		}, 'entity');
	}


});