<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ page isELIgnored="false" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>用户管理</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="<%=request.getContextPath() %>/js/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="<%=request.getContextPath() %>/js/bootstrap/css/bootstrap-theme.min.css">
    <script type="text/javascript" charset="utf-8" src="<%=request.getContextPath() %>/js/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="<%=request.getContextPath() %>/js/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<br/>
<div class="container">
    <form:form cssClass="form-horizontal" commandName="sysUser" action="addUser.do" method="post">

        <legend>添加用户</legend>

        <div class="form-group-sm">
            <label class="control-label col-xs-4">用户名:</label>
            <div class="col-xs-8">
                <form:input path="userName" cssClass="form-control" placeholder="1到10个字！" maxLength="10"/>
            </div>
        </div>
        <div class="form-group-sm">
            <label class="control-label col-xs-4">初始密码:</label>
            <div class="col-xs-8">
                <form:input path="password" cssClass="form-control" placeholder="6到20个字！"  maxLength="20"/>
            </div>
        </div>
        <div class="form-group-sm">
            <label class="control-label col-xs-4">性别:</label>
            <div class="col-xs-8">
                <form:select path="sex" cssClass="form-control">
                    <form:option value="0" label="男"></form:option>
                    <form:option value="1" label="女"></form:option>
                </form:select>
            </div>
        </div>
        <div class="form-group-sm">
            <label class="control-label col-xs-4">权限:</label>
            <div class="col-xs-8">
                <form:select path="role" cssClass="form-control">
                    <form:option value="0" label="guest"></form:option>
                    <form:option value="1" label="admin"></form:option>
                </form:select>
            </div>
        </div>
        <div class="form-group-sm text-center">
            <button type="button" class="btn btn-sm btn-default" id="back">返回</button>
            <button type="submit" class="btn btn-sm btn-primary">提交</button>
        </div>
    </form:form>

</div>
<script>
    $(function(){
        $("#back").on("click",function(){
            window.history.go(-1);
        })
    })
</script>
</body>
</html>
