<!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>登录 - X.weibo管理中心</title>
<link href="<?php echo W_BASE_URL;?>css/admin.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='<?php echo W_BASE_URL;?>js/jquery.min.js'></script>
<script type='text/javascript' src='<?php echo W_BASE_URL;?>js/admin.js'></script>
<script language="javascript" type="text/javascript">
function refreshCc() {
	var ccImg = document.getElementById("checkCodeImg");
	if (ccImg) {
		ccImg.src= ccImg.src + '&' +Math.random();
	}
}
$(function() {
	$('input[type="text"],textarea,input[type="password"]').blur(function() {
		checkForm(this);
	});
	$('#username').focus();
});
function ajax_submit() {
	if (!checkForm($('#loginFrm').get(0))) {
		return false;
	}
	var url = '<?php echo URL('admin/admin.login');?>';
	var data = {
			'username': $('#username').val(),
			'password': $('#password').val(),
			'verify_code': $('#verify_code').val()
		};
	$.post(url, data, function(json){
		json = eval('(' + json + ')');
		if (json.state == '200') {
			window.location.href = '<?php echo URL('admin/admin.index');?>';
		} else {
			if (json.state == '402') {
				$('#verify_code_msg').html(json.msg).addClass("reg_info1").show();
				$('#username_msg').hide();
			} else {
				$('#username_msg').html(json.msg).addClass("reg_info1").show();
				$('#verify_code_msg').hide();
			}
		}
	})
}
</script>
</head>
<body>
    <div id="login">
        <!--login-->
        <!-- <?php if ($message) {?><p class="block"><?php echo $message;?></p><?php }?> -->
        <div class="login-body">
            <div class="description">
                <h3>登录Xweibo管理中心</h3>
                <span>使用管理中心，你可以：</span>
                <ul>
                    <li>定制给用户添加官方认证，或指定屏蔽内容</li>
                    <li>在微博广场中推荐用户，话题</li>
                    <li>设置网页logo，页头页尾等前端显示元素</li>
                </ul>
                <p class="tips">请使用您安装Xweibo时设置的管理员账号和密码，登录站长管理后台。</p>
            </div>
            <div class="login-form">
                <form id="loginFrm" action="" method="post" onsubmit="ajax_submit();return false;">
                    <div class="form-row">
                        <label for="username">管理员账号：</label>
                        <input id="username" name="username"  type="text" value="" class="insert_text input-a" maxlength="20" valid="required" />
                        <div class="reg_info1" id="username_msg"></div>
                    </div>
                    <div class="form-row">
                        <label for="password">密码：</label>
                        <input id="password" name="password" type="password" value="" class="insert_text input-a" maxlength="20" valid="required" />
						<div class="reg_info1" id="password_msg"></div>
                    </div>
                    <div class="form-row">
                        <label for="verify_code">验证码：</label>
                        <input id="verify_code" name="verify_code" type="text" class="insert_text input-b" autocomplete="off" size="9" maxlength="4" valid="required" />
                        <div class="reg_info1" id="verify_code_msg"></div>
                    </div>
                    <div class="form-row">
                        <img id="checkCodeImg" class="codeImg" src="<?php echo APP::mkModuleUrl('authImage.paint','w=70&h=25');?>" width="60" height="25"/>
                        <a class="changeImg" href="javascript:refreshCc();">看不清楚？换个图片</a>
                    </div>
                    <div class="form-row">
                        <span class="button"><input type="submit" class="log-btn" value="登 录" /></span>
                    </div>
                </form>
            </div>
            <div class="login-bottom">
                <div id="nav">
                    <a href="http://x.weibo.com/cooperation.php">联系我们</a> | <a href="http://x.weibo.com/help.php">使用帮助</a> | <a href="http://bbs.x.weibo.com/">意见反馈</a>
                </div>
                <div id="copyright">
                    Copyright ?? 1996-2010 SINA 新浪公司 版权所有
                </div>
            </div>
        </div>
    </div>
</body>
</html>

