<div class="content_warp">
<div class="content">
<div class="title"><div class="main_tit_setp">按章练习</div><span class="main_tit_setp">可更好的巩固知识点!</span></div>
<div style="overflow-y:auto;overflow-x:hidden;height:450px;width:978px;">
<div class="main_warp">
<div class="main">
<div class="main_tit">
  <div>第二步</div><span>请设置本章练习中心的题型及题量（默认做题时间60分钟，默认取50道题）</span></div>
<?php if ($banktype_list): ?>
<div class="two">

<table cellspacing="0" cellpadding="0" class="biaoge1">
<tbody> 
<tr>
<td width="70">练习名称：</td>
<td><input type="text" class="mocktitle" style="width:341px;" value="<?php echo $mocktitle?>" name="q" class="i1"></td>
</tr>
<tr>
<td>做题时间：</td>
<td><input type="text" class="mocktime" name="q" value="60" class="i2">&nbsp;分</td>
</tr>
<tr>
<td>题目类型：</td>

<?php foreach ($banktype_list as $k=>$banktype): ?>
<?php if ($k == 0): ?>
<td><div style="width:190px; float:left;"><input type="checkbox" class="btid" value="<?php echo $banktype['id']?>" num="<?php echo $banktype['count']?>" name="btid[]">&nbsp;<?php echo $banktype['title']?>（共计<?php echo $banktype['count']?>题）</div><input type="text" class="btid_<?php echo $banktype['id']?>" name="q" class="i3">题</td>
</tr>
<?php else: ?>
<tr>
<td>&nbsp;</td>
<td><div style="width:190px; float:left;"><input type="checkbox" class="btid" value="<?php echo $banktype['id']?>" num="<?php echo $banktype['count']?>" name="btid[]">&nbsp;<?php echo $banktype['title']?>（共计<?php echo $banktype['count']?>题）</div><input type="text" class="btid_<?php echo $banktype['id']?>" name="q" class="i3">题</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>


<tr>
<td>&nbsp;</td>
<td></td>
</tr>     
</tbody>
</table> 


</div>
<div style="margin-left:130px;"><a href="javascript:void(0);" target="_self" class="go3" target="_blank"><img src="/Public/quanzhen/images/self/kslx.gif" /></a></div>


<?php else: ?>
<div style="font-size: 15px;margin: 150px 200px;">本章暂时没有可供练习的试题，请<a onclick="history.go(-1);" style="color:blue;cursor: pointer;" >返回</a>选择其他章节的试题练习</div>
<?php endif; ?>
</div>

</div>
</div>
<div class="b_bg"></div>

<div id="cover" style="display:none"> 
	<div id="tb_window"><div class="wait"><img src="__PUBLIC__/quanzhen/images/wait.gif"></div> <img src="__PUBLIC__/quanzhen/images/waitfor1.png"><span id="chart"></span></div>
	<div class="mk_botbg"></div> 
</div>

<!--版权-->
<div class="footer c_hui">
Copyright 2000 - 2012 www.chinaacc.com All Rights Reserved　 <a href="#" target="_blank">使用条款</a> | <a href="#" target="_blank">隐私声明</a> | <a href="#" target="_blank">反馈</a> | <a href="#" target="_blank">支持</a> | <a href="#" target="_blank">用户帮劣中心</a><br />
<a href="http://www.chinaacc.com/" target="_blank"><font color="#1979d7">中华会计网校</font></a> 版权所有 </div>
<!--版权 end-->
<div class="mk_botbg"></div>
</div>
</div>
<script>
$(document).ready(function(){
	
	$(".go3").click(function(){
		var mocktitle = $(".mocktitle").val();
		var mocktime = parseInt($(".mocktime").val());
		
		if (mocktitle == '')
		{
			alert("请您输入章节练习的名称");
		}
		
		if (mocktime == '' || mocktime <= 0)
		{
			alert("请您输入章节练习的答题时长");
		}
		else
		{
			var i = 0;
			var addon = '';
			var errormsg = '';
			$(".btid").each(function(){
				if ($(this).attr("checked"))
				{
					var num = parseInt($(this).attr("num"));
					var btid = $(this).val();
					var btid_num = parseInt($(".btid_"+btid).val());
					if (btid_num != 'undefined' && btid_num > 0)
					{
						if (num < btid_num)
						{
							errormsg = "您填写的题数超出范围，请修改";
						}
					}
					else
					{
						btid_num = num<50?num:50;
					}
					addon = addon+'/btid_'+i+'/'+btid+'/btid_num_'+i+'/'+btid_num;
					i++;
				}
				
			});
			
			if (errormsg)
			{
				alert(errormsg);
			}
			else if (addon == '')
			{
				alert("请您选择章节练习的题型并填写题数");
			}
			else
			{
//				$(this).hide();
				$("#cover").css("display","");
				setTimeout(function(){
					location.href="<?php echo U(MODULE_NAME.'/setConfStep3/cd_id/'.$cd_id.'/unit_id/'.$unit['id'].'/mocktitle/')?>"+mocktitle+'/mocktime/'+mocktime+addon;
				},2000);
				
				/*
				var url = "<?php echo U(MODULE_NAME.'/setConfStep3/cd_id/'.$cd_id.'/unit_id/'.$unit['id'].'/mocktitle/')?>"+mocktitle+'/mocktime/'+mocktime+addon;
				$.get(url,function() {
					$(".go3").hide();
					location.href=url;
				});
				*/
			}
		}
		
	});
	
});

</script>
