$(function(){

	onloadurl();

	saveplayer = function(status){

		layer.confirm('确认保存当前信息?', function(index) {
			var playerId = $("#playerId").val();
			var recmm = $("#recmm").val();
			var remark = $("#remark").val();
			var params = {
					playerId:playerId,
					recmm:recmm,
					status:status,
					remark:remark
			};
			$.ajax({
				url: HttpRest+"eventplayer/save.shtml", 
				type: "post", 
				dataType: "json",
				data:$.toJSON(params),   
				contentType:"application/json",
				success: function(data) { 
					if(data.code=='01'){
						layer.confirm('保存成功！是否关闭窗口?', function(index) {
							parent.grid.loadData();
							parent.layer.close(parent.pageii);
							return false;
						});
					}else{
						layer.msg('保存失败！',{icon: 5});
					}
				}
			});

		});
	}

	$("#passBtn").click(function(){
		saveplayer('1');
	});

	$("#failBtn").click(function(){
		var remark = $.trim($("#remark").val());
		if(remark==''){
			layer.msg('审核不通过，请填写原因！',{icon: 5});
			return;
		}
		saveplayer('0');
	});
});