<!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" />
<title>【<!--{$config.sitename}-->】管理登录-Powered by OEmarry</title>
<meta name="author" content="OEdev,OEmarry" />
<link type="text/css" rel="stylesheet" href="<!--{$urlpath}-->tpl/admin/css/oemarry.login.css" />
<link type="text/css" rel="stylesheet" href="<!--{$urlpath}-->tpl/static/varpop/css/oe_varpop.css" />
<script src="<!--{$urlpath}-->tpl/static/js/jquery.min.js"></script>
<script src="<!--{$urlpath}-->tpl/static/js/common.js"></script>
<script src="<!--{$urlpath}-->tpl/static/varpop/oe_varpop.js"></script>
</head>
<body>

<div class="oemarry_main">
  <div class="oemarry_login">
    
	<div class="oemarry_logincon">
      <h3>OEmarry后台管理登录</h3>
      <div class="oemarry_con">
        <dl class="oemarry_cc">
		  <dt class="oemarry_user">帐号：</dt>

		  <dd><input type="text" id="loginname" name="loginname" maxlength="16" />&nbsp;</dd>
		</dl>

        <dl class="oemarry_cc">
		  <dt class="oemarry_pass">密码：</dt>
		  <dd><input type="password" id="password" name="password" maxlength="16" />&nbsp;</dd>
        </dl>

        <dl class="oemarry_co">
		  <dt class="oemarry_code">
            <span>验证码：</span>
			<input type="text" name="checkcode" id="checkcode" />&nbsp;
          </dt>
		  <dd>
		    <img style="cursor:pointer;" title="点击换一个" id="img_checkcode" src="<!--{$urlpath}-->source/include/imagecode.php?act=verifycode" />&nbsp;
		  </dd>
        </dl>
        
        <div class="oemarry_button">
          <span id="oe_btn_login">登 录</span>
		  <i id="tips_trap"></i>
        </div>
      </div>

    </div>
    <img class="oemarry_rbg" src="<!--{$urlpath}-->tpl/admin/images/login/lg_r.jpg" />
    <img class="oemarry_bbg" src="<!--{$urlpath}-->tpl/admin/images/login/lg_b.jpg" />
  </div>
  <div class="clear"></div>
</div>

<div class="oe_marry_footer">
	Copyright&copy;2010~2099 奥壹(OE)技术&nbsp;&nbsp;&nbsp;
	Powered by <a href="http://www.oemarry.com/" target="_blank">OEmarry</a>
</div>  
<script type="text/javascript">
$(function(){
	$("#oe_btn_login").live("click", function(){
		_loginPost();
	});

	$("#img_checkcode").bind("click", function(){ //更换验证码
		$(this).attr("src", "<!--{$urlpath}-->source/include/imagecode.php?act=verifycode&"+Math.random());
	});

});
$(document).keydown(function(event){
	if (event.keyCode == 13){
		_loginPost();
	}
}); 

function _loginPost() {
	$loginname = $("#loginname").val();
	if ($loginname.length == 0) {
		$("#tips_trap").html("<font color='red'>请填写登录帐号</font>");
		return false;
	}
	$password = $("#password").val();
	if ($password.length == 0) {
		$("#tips_trap").html("<font color='red'>请填写登录密码</font>");
		return false;
	}
	$checkcode = $("#checkcode").val();
	if ($checkcode.length == 0) {
		$("#tips_trap").html("<font color='red'>请填写验证码</font>");
		return false;
	}

	$("#tips_trap").html("登录中...");
	$.ajax({
		type: "POST",
		url: "<!--{$oefile}-->&c=<!--{$c}-->",
		cache: false,
		data: {a:"loginpost", loginname:$loginname, password:$password, checkcode:$checkcode, r:get_rndnum(8)},
		dataType: "json",
		success: function(data) {
			$json = eval(data);
			$response = $json.response;
			$result = $json.result;
			if ($response == '1') {
				setTimeout(function(){
					window.top.location.href = "<!--{$oefile}-->&c=index"
				}, 500);
			}
			else {
				if ($result.length > 0) {
					$("#tips_trap").html("<font color='red'>"+$result+"</font>");
				}
				else {
					$("#tips_trap").html("<font color='red'>登录失败</font>");
				}
			}
		},
		error: function() {
			$("#tips_trap").html("<font color='red'>请检查网络...</font>");
		}
	});

}
</script>
</body>
</html>