<%@ 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" %> --%>
    <script src="${ctxStatic}/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="${ctxStatic}/jquery/jquery-migrate-1.1.1.min.js" type="text/javascript"></script>
    <link href="${ctxStatic}/jquery-validation/1.11.1/jquery.validate.min.css" type="text/css" rel="stylesheet"/>
    <script src="${ctxStatic}/jquery-validation/1.11.1/jquery.validate.min.js" type="text/javascript"></script>
    <script src="${ctxStatic}/jquery-validation/1.11.1/jquery.validate.method.min.js" type="text/javascript"></script>
    <link href="${ctxStatic}/fancyBox/source/jquery.fancybox.css" type="text/css" rel="stylesheet"/>
    <script src="${ctxStatic}/fancyBox/source/jquery.fancybox.js" type="text/javascript"></script>
    <script src="${ctxStatic}/common/jeesite.min.js" type="text/javascript"></script>
    <link href="${ctxStatic}/common/jeesite.min.css" type="text/css" rel="stylesheet"/>
    <script src="${ctxStatic}/select2/select2.js" type="text/javascript"></script>
    <script src="${ctxStatic}/select2/select2_locale_zh-CN.js" type="text/javascript"></script>
    <link href="${ctxStatic}/select2/select2.css" type="text/css" rel="stylesheet"/>
    <link rel="stylesheet" href="${ctxStatic}/common/login.css">
    <script type="text/javascript">
        $(document).ready(function () {
            <!--针对nw.js评卷客户端，自动窗口最大化-->
            try {
                require('nw.gui').Window.get().maximize();
            } catch (e) {
            }

            $('#submit-button').click(function () {
                var examId = $('#exam-select').val();
                return examId != undefined && examId != '' && examId != null;
            });

            $('.point').hide();
            var message = "${message}";
            if (message != null && message != "") {
                showError(message);
            }

            $(document).ajaxError(function (evt, req, settings) {
                if (req.status == 401) {
                    alert("权限失效，请重新登录！");
                    window.location.href = "/login";
                }
            });

        });

        function showError(message) {
            $('.point').show();
            $('.error').html(message);
        }

        // 如果在框架中，则跳转刷新上级页面
        if (self.frameElement && self.frameElement.tagName == "IFRAME") {
            parent.location.reload();
        }
    
    
    </script>
</head>
<body>
<div class="container">
    <div class="middle cl">
        <div class="left">
            <%-- <div class="logo"><img src="${ctxStatic}/images/<c:if test="${indexLogo ==null||indexLogo =='' }">logo@2x.png</c:if><c:if test="${indexLogo !=null }">${indexLogo }</c:if>"/></div> --%>
             <p>
				<a target="_blank" style="color: rgba(255,255,255,.65)">v${versionName} beta${versionDate}</a><br/>
				<a href="https://beian.miit.gov.cn/" target="_blank" style="color: rgba(255,255,255,.65)">鄂ICP备12000033号-3</a>
			</p>
        </div>
        <div class="right">
            <div class="title">
                <h1>请选择考试批次</h1>
                <br/>
            </div>
            <div class="loginbox">
                <form class="form login-form" action="${ctx}/admin/exam/select" method="post">
                    <div class="exam-select">
                        <select name="examId" id="exam-select">
                            <option value="">请选择考试</option>
                            <c:forEach items="${examList}" var="item">
                                <option value="${item.id}" <c:if test="${item.id==exam.id}">selected</c:if>>${item.id}-${item.name}</option>
                            </c:forEach>
                        </select>
                    </div>
                    <c:if test="${web_user.schoolAdmin==true && examList.size()==0}">
                        <div class="login-btn">
                            <a href="${ctx}/admin/exam/create">新建考试</a>
                        </div>
                    </c:if>
                    <div class="point hide">
                        <em class="error"></em>
                    </div>
                    <div class="login-btn">
                        <input class="opacity" type="submit" id="submit-button" value="确 定"/>
                        <a href="${ctx}/logout" class="opacity">退 出</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</body>
</html>