<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../common/init.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="${ctx}/resources/css/main.css" type="text/css" />
<link rel='stylesheet' href='${ctx}/resources/css/easyui.css' type='text/css' media='screen' />
<link rel='stylesheet' href='${ctx}/resources/css/easyui/icon.css' type='text/css' media='screen' />
<link rel='stylesheet' href='${ctx}/resources/css/user-center-style.css' type='text/css' media='screen' />
<%@ include file="../common/top.jsp"%>
<script type="text/javascript" src="${ctx}/resources/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx}/resources/js/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/resources/js/papers/batchPaper.js"></script>
<title>密码本管理</title>

<script language="javascript">
function addCodeBtn(){
	$('#addCode').window('open');
}
function formatDate(date){
	var d=undefined;
	if(typeof(date)=="undefined"){
		d=new Date();
	}else{
		d = new Date(date);
	}
	return (d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate())+"  "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
}
</script>
</head>
<body>
<div class="container-fluid">
	<%@ include file="../common/header.jsp"%>
	
	<div class="row-fluid">
		<%@ include file="../common/sub_menu.jsp"%>
		
		<div class="span10">
			<ul class="breadcrumb">
	            <li class="active">密码本管理</li>
            </ul>
            <div style="margin-top:10px;">
	            <table id="dg" class="easyui-datagrid"
	                data-options="url:'${ctx}/examSetting/queryLog'
	                ,toolbar: '#tb'
	                ,fitColumns:true
	                ,singleSelect:true
	                ,striped:true
	                ,pagination:true">
	                <thead>
	                    <tr class="title">
	                        <th data-options="field:'id',width:20,editor:{type:'validatebox',options:{required:true}}">ID</th>
	                        <th data-options="field:'codeNum',width:70,editor:{type:'validatebox',options:{required:true}}">生成密码条数</th>
	                        <th data-options="field:'surplus',width:120,editor:{type:'validatebox',options:{required:true}}">还剩可用密码条数</th>
	                        <th data-options="field:'createTime',width:120,editor:{type:'validatebox',options:{required:true}},formatter: formatDate">生成日期</th>
	                        <th data-options="field:'createBy',width:70,editor:{type:'validatebox',options:{required:true}}">操作者</th>
	                    </tr>
	                </thead>
	              </table>
              </div>
              
              <div id="tb" style="height:auto">
                   <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'easyui-icon-add',plain:true" onclick="addCodeBtn()">生成密码本</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'easyui-icon-download',plain:true" onclick="downPassword('${ctx}')">导出密码本</a>
               </div>
			</div>
		</div>
	</div>
	<%@ include file="../common/footer.jsp"%>
	
	<div id="addCode" class="easyui-window" title="生成密码本" data-options="modal:true,closed:true,iconCls:'icon-add'" style="width:450px;height:200px;padding:10px;">
		<div id="codeBookInfo" align="center">
			<table>
				<tr>
					<td align="right"><font style="font-size: 14px;">生成密码条数:</font></td>
					<td><input type="text" name="codeNum" id="codeNum"/><input type="hidden" id="url" value="${ctx}"/></td>
					<td></td>
				</tr>
				<tr>
					<td align="right"><font style="font-size: 14px;">操作者:</font></td>
					<td><input type="text" name="createBy" id="createBy" value="${web_session_user.name }" disabled="disabled"/></td>
					<td></td>
				</tr>
			</table>
			<div style="padding-top: 15px;"><input type="button" value="生成密码本" style="width: 70px;height: 30px;" id="addCodeBookBtn"/></div>
		</div>
	</div>
</body>
</html>