<?php if (!defined('THINK_PATH')) exit();?><?php if ($view == 'mock_all'): ?>
<!-- layout::element/showPaperRecordList/mock_all::0 -->
<?php elseif ($view == 'mock_wrong'): ?>
<!-- layout::element/showPaperRecordList/mock_wrong::0 -->
<?php elseif ($view == 'self_all'): ?>
<!-- layout::element/showPaperRecordList/self_all::0 -->
<?php elseif ($view == 'self_wrong'): ?>
<!-- layout::element/showPaperRecordList/self_wrong::0 -->
<?php endif; ?>

<script>
$(document).ready(function(){
	
	$("#order").change(function() {
		var value = $(this).val();
		var url = "<?=U(MODULE_NAME.'/showPaperRecordList/cd_id/'.$cd_id.'/act/'.$act.'/menu_id/'.$menu_id.'/result/'.$result)?>" + '/order/' + value;
		location.href = url;
	});
	
	$("#from").change(function() {
		var value = $(this).val();
		var url = "<?=U(MODULE_NAME.'/showPaperRecordList/cd_id/'.$cd_id.'/menu_id/'.$menu_id.'/result/'.$result);?>" + '/act/' + value;
		location.href = url;
	});
});


function showRecord(rid,act)
{
	var url = "<?=U('paper/showPaperRecord/cd_id/'.$cd_id.'/menu_id/'.$menu_id.'/result/'.$result)?>" + "/record_id/" + rid + "/act/" + act;
	//alert(url);
	parent.location.href = url;
}

function doRecordAgain(rid,act,result)
{
	var url = "<?=U('paper/doPaperRecord/cd_id/'.$cd_id.'/menu_id/'.$menu_id)?>" + "/record_id/" + rid + "/act/" + act + '/result/' + result;
	parent.location.href = url;
}

function delRecord(rid,act)
{
	if (confirm("您确认要删除该条考试记录吗？") == true)
	{
		$.get("<?=U('record/delete/model/'.$act)?>",{'record_id':rid},function(rs) {
			if (rs == 1) {
				alert("删除成功");
				location.reload();
			} else {
				alert("删除失败");
			}
		})
	}
}

function pageJump(value,act) {
	var url = "<?=U('paper/showPaperRecordList/cd_id/'.$cd_id.'/menu_id/'.$menu_id.'/result/'.$result.'/order/'.$order)?>" + '/p/' + value + '/act' + act;
	if (value > 0 ) {
		location.href = url+value;
	} else {
		alert("为了您系统的安全，请正确输入页码");
	}
}

</script>