<%@page pageEncoding="UTF-8"%>
<%@page trimDirectiveWhitespaces="true"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="gen" uri="http://help.jspgen.com/taglib/jstl"%>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
<title>管理登录 ${config.title}</title>
<!-- 当前页面 -->
<link type="text/css" href="${config.statie}ui/admin/images/login.css" rel="stylesheet">
</head>
<body>
<div class="login-form">
  <gen:if test="${!isAllow}">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="30" align="center" valign="middle"><h1>登录已关闭</h1></td>
      </tr>
      <tr>
        <td height="270" align="left" valign="top"><div style="height:270px; overflow:auto;"><span>${close}</span></div></td>
      </tr>
    </table>
    <gen:else />
    <form id="form" name="form" method="post" action="user!adminSubmit.gen">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="85" colspan="2" align="center"><a href="http://www.jspgen.com" target="_blank" title="欢迎您选用：JSPGenCMS4.0"><img src="${config.statie}ui/admin/images/login_logo.png" border="0"/></a></td>
        </tr>
        <tr>
          <td width="22%" height="40" align="right"><strong>用户名：</strong></td>
          <td align="left"><input name="account" type="text" class="text" id="account" style="width:240px;" /></td>
        </tr>
        <tr>
          <td height="40" align="right"><strong>密 &nbsp;&nbsp;码：</strong></td>
          <td align="left"><input name="password" type="password" class="text" id="password" style="width:240px;" /></td>
        </tr>
        <tr>
          <td height="40" align="right"><strong>验证码：</strong></td>
          <td align="left" class="captcha"><input type="text" name="captcha" id="captcha" class="text" style="width:80px;" />
            <img src="" title="点击刷新" align="absmiddle" style="background:#FFF;display:none;" /></td>
        </tr>
        <tr>
          <td height="60" colspan="2" align="right" valign="middle"><input name="redirectUrl" type="hidden" value="${redirectUrl}" />
            <input name="formHash" type="hidden" value="${formHash}" />
            <input type="submit" name="button" class="button orange" value=" 登 录 " />
            &nbsp;&nbsp;&nbsp;
            <input type="reset" name="reset" class="button gray" value=" 取 消 " /></td>
        </tr>
      </table>
    </form>
  </gen:if>
</div>
<div class="copyright">Copyright&nbsp;&copy;&nbsp;<a href="http://www.jspgen.com" target="_blank">www.JSPGen.com</a></div>
</body>
<!-- 必备插件 -->
<script type="text/javascript" src="${config.statie}js/jquery.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.grapes.js"></script>
<!-- UI界面必备 -->
<script type="text/javascript" src="${config.statie}ui/js/jspgen.js"></script>
<script type="text/javascript" src="${config.statie}ui/js/jspgen.ajax.js"></script>
<script type="text/javascript" src="${config.statie}ui/js/jspgen.ready.js"></script>
<!-- 当前页面 -->
<script type="text/javascript">
$(document).ready(function(){
	// 变量
	var $form = $('#form');
	var $account = $('#account');
	var $password = $('#password');
	var $captcha = $('#captcha');
	
	// 提交判断
	$form.submit(function() {
		if (grapes.isEmpty($account.val())) {
			alert('请输入用户名！');
			$account.focus();
			return false;
		}
		if (grapes.isEmpty($password.val())) {
			alert('请输入密码！');
			$password.focus();
			return false;
		}
		<gen:if test="${isCaptcha}">
		if ($captcha.length>0 && grapes.isEmpty($captcha.val())) {
			alert('请输入验证码！');
			$captcha.focus();
			return false;
		}
		</gen:if>
		$form.find(':submit').prop('disabled', true).removeClass('orange').addClass('disabled');
		return true;
	});
});
</script>
</html>