<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="cn.sendsms.jdsmsserver.*"%>
<%@ page import="java.util.ArrayList" %>
<%
	response.setHeader("Cache-Control", "no-store");
	response.setHeader("Pragrma", "no-cache");
	response.setDateHeader("Expires", 0);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
	<%
		out.println(ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.login_title"));
	%>
</title>
<link href="css.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" type="image/x-icon" href="w_img/favicon.ico">
<noscript>
<center><h1>您的浏览器存在以下限制，会导致页面显示问题，强烈建议您处理后再访问：</h1>
<ul>
<li>浏览器不支持Javascript脚本</li>
<li>浏览器支持脚本，但脚本被禁用</li>
<li>IE用户请将此页面添加到信任站点，或者使用其他浏览器</li>
</ul>
</center>
</noscript>
<script type="text/javascript">
/*alert('<%=request.getSession().getAttribute("randomCode")%>');*/
function check(){
	var usr = document.getElementById('username');
	if(usr.value==''){
		alert('<%= ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.login_username1")%>');
		usr.focus();
		return false;
	}
	var pwd = document.getElementById('password');
	if(pwd.value==''){
		alert('<%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.login_password1")%>');
		pwd.focus();
		return false;
	}
	var va = document.getElementById('randomCode');
	if(va.value==''){
		alert('<%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.login_code1")%>');
		va.focus();
		return false;
	}
	return true;
}

function change(){
	var language = document.getElementById('language').value;
	url="/languageAction?action=languageChange&language="+language;
	window.location.href=url;
}
</script>

<style type="text/css">
	.left{
		overflow: hidden;
		display: inline-block;
		float:left;
		width:460px;
		height:351px;
		/*background-image: url(w_img/index.png);
		background-size: 100%;*/
		position: relative;
	}
	.wlanguage{
		text-align: center;
		width:90px;
		padding:5px;
		position: absolute;
		bottom:40px;
		right:50px;
		outline: none;
		border-radius: 25px;
		behavior:url(./css/PIE.htc);
		border:1px solid #ababab;
	}
	.right{
		display: inline-block;
		float:left;
		margin-left:50px;
		margin-top:28px;
	}
	.right_top{
		/*border:1px solid #0f0;*/
	}
	.right_top .img{
		display: inline-block;
		width:52px;
		height:31px;
		overflow: hidden;
	}
	.right_top .img img{
		width:100%;
	}
	.right .right_bottom{
		margin-top:10px;
		margin-right:2px;
	}
	.right .right_item{
		border-bottom:1px solid #979797;
		padding:5px 0px 8px 6px;
		margin-bottom:15px;
	}
	.right .right_item span{
		color:#989898;
		font-size: 14px;
	}
	.denglu_k{
		border:none;
		outline: none;
		background:#fff;
	}
	.denglu_code{
		border:none;
		outline: none;
		background-image: #fff;
	}
	.imgcode{
		display: inline-block;
		overflow: hidden;
		/*position: relative;
		top:10px;
		right:-10px;*/
		cursor: pointer;
		float:right;
		margin-top:-8px;
		margin-right:10px;

	}
	.imgcode img{
		border:none;
	}
	.denglu_dl_bt{
		width:100%;
		color:#fff;
		background:#66b0b2;
		border:none;
		padding:10px 0px;
		cursor: pointer;
	}
	.foot{
		position: fixed;
		bottom:10px;
		width:100%;
	}
</style>

</head>
<body style="border: none;background:#fff; ">
	<%
        String path = request.getContextPath();
        if(request.getScheme().equalsIgnoreCase("http")){
        	int nSslPort = JDSMSServer.getInstance().getProperties().getInt("console.ssl.port", 8050);
        	if(nSslPort>0 && nSslPort<65535) {
        		  String basePath = "https" + "://"+request.getServerName()+":"+ nSslPort +path+"/";;
            	response.sendRedirect(basePath);	
        	}
        	
        }
	%>
	<div class="denglu_form" style="background:#fff;padding-left:0px;padding-top:10%;">
		<form action="/logon" method="post" onsubmit="return check();">
			<div class="left">
				<img src="w_img/index.png" style="width:100%;">
				<select name="language" id="language" class="wlanguage" onchange="change()">
					<option value="language"><%=ResourceManager.getInstance().getDefaultLanguage()%></option>
					<%
						ArrayList<String> languages = ResourceManager.getInstance().getLanguages();
						if (languages != null)
							for (int i=0;i<languages.size();i++) {
								String language = languages.get(i);
					%>
					<option value="<%=language%>"><%=language%></option>
					<%} %>
				</select>
			</div>
			<div class="right">
				<div class="right_top">
					<div class="img" style="position: relative;top:12px;">
						<img src="img/logo.gif">
					</div>
					<span style="color: #515151;letter-spacing: 1.35px; font-size: 27px; font-family: 黑体;line-height: 14px;margin-left:3px;">
						<%
							out.println(ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.menu_Title"));
						%>
					</span>
					<span style="display: block;margin-left:60px;margin-top:3px;font-size: 14px;color:#b3b3b3;">
						<%
							out.println(ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.menu_version"));
						%>
					</span>
				</div>
				<div class="right_bottom">
					<div class="right_item">
						<span>
							<%
								out.println(ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault)
										.getString("settings.login_username"));
							%>
						</span>
						<Input id="username" name="username" value="" size="20" maxlength="20" type="text" class="denglu_k" autofocus="autofocus">
					</div>
					<div class="right_item">
						<span>
							<%
								out.println(ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.login_password"));
							%>
						</span>
						<Input id="password" name="password" value="" size="21" maxlength="20" type="password" class="denglu_k">
					</div>
					<div class="right_item">
						<span>
							<%
								out.println(ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.login_code"));
							%>
						</span>
						<Input id="randomCode" name="randomCode" value="" size="5" maxlength="4" type="text" class="denglu_code">
						<div class="imgcode">
							<img alt="" src="randomCode.jsp" onclick="this.src=this.src+'?k='+Math.random();">
						</div>
					</div>
					<div class="right_item" style="border:none;padding:0px;padding-top:8px;">
						<input value=<%out.println(ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.login_submit"));%> type="submit" class="denglu_dl_bt">
					</div>
				</div>
			</div>
			<div style="clear:both;"></div>
		</form>
		<%
			if (request.getAttribute("global_info") != null) {
		%>

		<script type="text/javascript">
alert('<%=request.getAttribute("global_info")%>');
		</script>

		<%
			}
		%>
	</div>
	<div class="foot">
		<center>
			Copyright&copy; 2021&nbsp;
			<%
				out.println(ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.login_title2"));
			%>
		</center>
	</div>
</body>
</html>