<?php if ($view == 'default'): ?>
	<layout name="showPaperRecordList_default" />

<?php elseif ($view == 'onlyWrong'): ?>
	<layout name="showPaperRecordList_onlyWrong" />
	
<?php elseif ($view == 'self'): ?>
	<layout name="showSelfPaperRecordList_default" />
	
<?php endif; ?>
<script type="text/javascript">
$(document).ready(function() {
	$("#order").change(function() {
		var from = "<?php echo $view; ?>";
		var value = $(this).val();
		if (from == 'self')
		{
			var url = '<?php echo U(MODULE_NAME."/showPaperRecordList/view/self/menu_id/".$menu_id."/order/")?>';
		}
		else
		{
			var url = '<?php echo U(MODULE_NAME."/showPaperRecordList/view/default/menu_id/".$menu_id."/order/")?>';
		}
		
		location.href = url+value;
	});
	
	$("#from").change(function() {
		var value = $(this).val();
		var url = '<?php echo U(MODULE_NAME."/showPaperRecordList/view/onlyWrong/menu_id/".$menu_id."/from/")?>';
		location.href = url+value;
	});
});
function pageJump(value) {
	var url = '<?php echo U(MODULE_NAME."/showPaperRecordList/view/default/menu_id/".$menu_id."/order/".$order.'/p/'); ?>';
	if (value > 0 ) {
		location.href = url+value;
	} else {
		alert("为了您系统的安全，请正确输入页码");
	}
}
function pageJumpSelf(value) {
	var url = '<?php echo U(MODULE_NAME."/showPaperRecordList/view/self/menu_id/".$menu_id."/order/".$order.'/p/'); ?>';
	if (value > 0 ) {
		location.href = url+value;
	} else {
		alert("为了您系统的安全，请正确输入页码");
	}
}
function pageJump_(value) {
	var url = '<?php echo U(MODULE_NAME."/showPaperRecordList/view/onlyWrong/from/".$from."/menu_id/".$menu_id."/order/".$order.'/p/'); ?>';
	location.href = url+value;
}

function do_selfagain(rid,confid) {
	parent.location.href="<?php echo U('selfconf/doSelfRecordPaper/result/all/record_id/'); ?>"+rid+'/selfconf_id/'+confid;
}
function do_again(rid) {
	parent.location.href="<?php echo U('mock/doRecordPaper/result/all/record_id/'); ?>"+rid;
}
function show_record(rid) {
	parent.location.href="<?php echo U('mock/showRecord/come_from/record_list/record_id/'); ?>"+rid;
}
function show_selfrecord(rid) {
	parent.location.href="<?php echo U('selfconf/showSelfRecord/come_from/record_list/record_id/'); ?>"+rid;
}
function do_wrong_again(rid,confid) {
	var from = "<?php echo $from; ?>";
	if (from == 'self')
	{
		parent.location.href="<?php echo U('selfconf/doSelfRecordPaper/result/wrong/record_id/'); ?>"+rid+'/selfconf_id/'+confid;
	}
	else
	{
		parent.location.href="<?php echo U('mock/doRecordPaper/result/wrong/record_id/'); ?>"+rid;
	}
}
function del_record(rid) {
	if (confirm("您确认要删除该条考试记录吗？") == true)
	{
		$.get("<?php echo U('record/delete/record_id/'); ?>"+rid,function(rs) {
			if (rs == 1) {
				alert("删除成功");
				location.reload();
			} else {
				alert("删除失败");
			}
		})
	}
}
function del_selfrecord(rid) {
	if (confirm("您确认要删除该条考试记录吗？") == true)
	{
		$.get("<?php echo U('record/delete/model/self/record_id/'); ?>"+rid,function(rs) {
			if (rs == 1) {
				alert("删除成功");
				location.reload();
			} else {
				alert("删除失败");
			}
		})
	}
}

</script>
