<%@ 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" %>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="##">账号绑定</a></li>
</ul>
<br/>
<form id="edit-form" action="${ctx}/admin/exam/marker/account/" method="post" class="form-horizontal">
    <tags:message content="${message}"/>
    <input name="markerId" type="hidden" value="${marker.id }"/>
    <div class="control-group">
        <label class="control-label">评卷员</label>
        <div class="controls">
            ${marker.loginName }
        </div>
    </div>
    <div class="control-group">
        <label class="control-label"></label>
        <div class="controls">
            <select class="input-large" id="account-select" name="accountId">
                <c:forEach var="account" items="${openAccountList}">
                    <option value="${account.id}">${account.account}_${account.name}</option>
                </c:forEach>
            </select>
        </div>
    </div>
    <div class="form-actions">
        <a href="##" id="bind-button" class="btn btn-primary">绑定</a>
        <c:if test="${marker.openAccountId != null}">
            &nbsp;&nbsp;
            <a href="##" id="unbind-button" class="btn btn-warning">解绑</a>
        </c:if>
        &nbsp;&nbsp;
        <a href="javascript:" onclick="history.go(-1);"  class="btn">返回</a>
    </div>
</form>

<script language="JavaScript">
    $('#bind-button').click(function () {
        submit('bind')
    })
    $('#unbind-button').click(function () {
        submit('unbind')
    })

    function submit(action) {
        $('#edit-form').attr('action', $('#edit-form').attr('action') + action)
        $('#edit-form').submit()
    }
</script>
</body>
</html>
