<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="${pageContext.request.contextPath }/common/admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/css/style.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/other/kingedit/themes/default/default.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>添加试卷</title>
</head>
<body>
<div class="pd-20">
	<form action="${pageContext.request.contextPath}/admin/questionPaper/add" method="post" class="form form-horizontal" id="form-coupon-add">
   
    
    <div class="row cl">
		<label class="form-label col-2"><span class="c-red">*</span>试卷名称：</label>
		<div class="formControls col-8">
			<input id="paperName" name="paperName" type="text" class="input-text" value="" placeholder="">
		</div>
	</div>
	
	
		
	<div  id="introductionFigure" class="row cl">
		<label class="form-label col-2"><span class="c-red">*</span>试卷图标：</label>
			<div class="col-10 ">
				<img alt="" src="" name="parameterImg" id="parameterImg" width="90" height="80">
				<input type="hidden" id="paperPic" id="paperPic" value="" />
				<input type="button" id="insertfileParameter" value="选择文件" />
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>月龄开始日期：</label>
			<div class="formControls col-2">
				<input id="pageStartMonth" name="pageStartMonth" type="text" class="input-text" value="" placeholder="" maxlength="14" onkeyup="digitalDigital(this);">
			</div>
			<label class="form-label col-2"><span class="c-red">*</span>月龄结束日期：</label>
			<div class="formControls col-2">
				<input id="pageEndMonth" name="pageEndMonth" type="text" class="input-text" value="" placeholder="" maxlength="14" onkeyup="digitalDigital(this);">
			</div>
		</div>
		
	<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>状态：</label>
			<div class="formControls col-2"> <span class="select-box">
				<select name="paperStatus" class="select">
					<option value="1">使用</option>
					<option value="2">未使用</option>
				</select>
				</span> 
			</div>
		</div>
		
    <div class="row cl">
      <div class="col-9 col-offset-3">
        <input class="btn btn-primary radius" onclick="return checkForm()" type="submit" id="submitBtn" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
      </div>
    </div>
  </form>
</div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/layer/1.9.3/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/tips.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/ueditor.all.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 

<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/ueditor.config.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/js/utils/tools.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/js/utils/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/other/kingedit/kindeditor.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/other/kingedit/lang/zh_CN.js"></script> 	
<script type="text/javascript">
//上传产品参数图
KindEditor.ready(function(K) {
	var editor = K.editor({
    	fileManagerJson : '${pageContext.request.contextPath }/common/other/kingedit/jsp/file_manager_json.jsp',
        uploadJson : '${pageContext.request.contextPath }/common/other/kingedit/jsp/upload_json.jsp',
		allowFileManager : true
	});
	K('#insertfileParameter').click(function() {
	     var imgid = $(this).attr("id");//获取当前ID
		editor.loadPlugin('image', function() {
			editor.plugin.imageDialog({
				showRemote : false,
				imageUrl : K('#productParameterImg').val(),
				clickFn : function(url, title, width, height, border, align) {
					K('#parameterImg').attr("src",url);
					K('#paperPic').val(url);
					editor.hideDialog();
					return false; 
				}
			});
		});
	}); 
	
});


function checkForm(){
	//名称验证
	if(!commonTypeJdg('paperName',null,null,true)){
		layer.msg("试卷名称不能为空",{icon: 2,time:2000});
		return false;
	}
	
	if(!commonTypeJdg('paperPic',null,null,true)){
		layer.msg("试卷图标不能为空",{icon: 2,time:2000});
		return false;
	}
	
	if(!commonTypeJdg('pageStartMonth',null,null,true)){
		layer.msg("月龄开始时间不能为空",{icon: 2,time:2000});
		return false;
	}
	
	if(!commonTypeJdg('pageEndMonth',null,null,true)){
		layer.msg("月龄截止时间不能为空",{icon: 2,time:2000});
		return false;
	}
	return true;
}
function reloadWindow() {
	window.location.reload();
}


//关闭隐藏div
function closeDiv() {
	$("#userInfoList").hide();
}

//输入数字校验
function digitalDigital(obj){
	obj.value=obj.value.replace(/\D/gi,"");
}

</script>
</body>
</html>