<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>操作日志</title>
	<meta name="decorator" content="default"/>
	<%@include file="/WEB-INF/views/include/head.jsp" %>
	<style type="text/css">.sort{color:#0663A2;cursor:pointer;}</style>
</head>
<body>
    <ul class="nav nav-tabs">
        <li class="active"><a href="##">日志列表</a></li>
    </ul>
	<form id="searchForm"  action="${ctx}/admin/operation/log" method="post" class="breadcrumb form-search">
		<input type="hidden" id="pageNumber" name="pageNumber" value="${query.pageNumber}"/>
		<input type="hidden" id="pageSize" name="pageSize" value="${query.pageSize}"/>
		<div>
			<label>登录名</label>
			<input type="text" name="loginName" value="${query.loginName}"  maxlength="20" class="input-medium"/>
			&nbsp;
			<label>用户类型</label>
            <select class="input-medium" name="marker" id="role-select">
                <option value="">不限</option>
                <option value="true" <c:if test="${query.marker!=null && query.marker==true}">selected</c:if>>评卷员</option>
                <option value="false" <c:if test="${query.marker!=null && query.marker==false}">selected</c:if>>管理员</option>
            </select>
            &nbsp;
            <label>操作类型</label>
            <select class="input-medium" name="type" id="enable-select">
                <option value="">不限</option>
                <c:forEach items="${typeList}" var="type">
                <option value="${type.value}" <c:if test="${type.value==query.type.value}">selected</c:if>>${type.name}</option>
                </c:forEach>
            </select>
            &nbsp;
			<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
		</div>
	</form>
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>登录名</th>
				<th>用户类型</th>
				<th>类型</th>
				<th>登录IP</th>
				<th>功能</th>
				<th>操作时间</th>
				<th>详情</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${query.result}" var="log">
			<tr>
			    <td>${log.loginName}</td>
				<td>
				    <c:if test="${log.marker==true}">
				    评卷员
				    </c:if>
				    <c:if test="${log.marker==false}">
				    管理员
                    </c:if>
				</td>
				<td>${log.type.name}</td>
				<td>${log.ipAddress}</td>
				<td>${log.menu}</td>
				<td><fmt:formatDate value="${log.createTime}" type="date" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td>${log.description }</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${query}</div>
<script type="text/javascript">
function page(n,s){
	$("#pageNumber").val(n);
	$("#pageSize").val(s);
	$("#searchForm").submit();
	return false;
}
function goSearch(){
	$("#pageNumber").val(1);
	$("#pageSize").val('${query.pageSize}');
	$("#searchForm").submit();
	return false;
}
</script>	
</body>
</html>