angular.module("app").controller('TicketCtrl', function($rootScope, $scope, $stateParams, $timeout) {
	var down_flag = $stateParams.down_flag;
	// 通用ajax请求
	if ($rootScope.GobalInitMap.StdTicket == undefined) {
		$scope.goUrl('main');
		return;
	}
	
	
	$scope.goDownload = function() {
		$rootScope.ajaxRequest('../enrol/std/ticket/download.htm', {}, function(entity) {
			window.open(entity);
		}, 'entity');
	}
	
	

	$rootScope.ajaxRequest('../enrol/std/ticket/list.htm', {}, function(array) {
		$scope.subjectArray = array;
		if (down_flag == true)
			$scope.goDownload();
	}, 'array');

});