<?php
header("Content-type:text/html;charset=utf-8"); 
?>
<!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>
<title><?php require("info/title.php"); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href="css/base.css" />
<script src="js/md5.js" type="text/javascript"></script>
<script type="text/javascript">
String.prototype.trim=function() {
     return this.replace(/(^\s*)(\s*$)/g, '');
}
function setInnerText(obj, text) {
	if (document.all) {
		obj.innerText = text;
	} else {
		obj.textContent = text;
	}	
}
function chkform() {
	var form = document.getElementById('form');
    if(form.admin.value.trim() == "") { 
		setInnerText(document.getElementById('errstr'), '请输入管理员帐号');
		return false; 
    } 
	if(form.pwd1.value.trim() == "") { 
		setInnerText(document.getElementById('errstr'), '请输入登录密码');
		return false; 
    } 
	var md5Value = hex_md5(form.pwd1.value.trim());
	md5Value = md5Value.toUpperCase();
	if(md5Value == "") { 
      alert('登录密码MD5加密出错！'); 
      return false; 
    }
	form.pwd.value = md5Value;
    return   true; 
}//chkform
</script>
</head>
<body>

<div style="clear:both;margin:120px auto;padding:0;width:400px;height:300px;background:transparent url(images/login_frame.jpg) no-repeat;">
	<div style="margin:16px 10px 0 10px;padding:8px 6px 0 6px;width:368px;height:22px;font-size:13px;color:#ffffff;background-color:#068cbf;">
		<div style="float:left;margin:0;padding:0;font-weight:bold;"><?php require("info/title.php"); ?></div>
		<div style="float:right;margin:0;padding:0;"><?php require("info/version.php"); ?></div>		
	</div>
	<form action="login.php" method="post" id="form" onSubmit="return chkform();">
	<input type="hidden" name="pwd" value=""/>
	<ul style="margin:0;padding:20px 0 0 0;width:400px;list-style:none;font-size:13px;color:#797979;">
		<li style="padding:10px 0 0 110px;height:10px;">管理员帐号：</li>
		<li style="padding:10px 0 0 110px;height:30px;"><input style="width:180px;font-size:13px;" type="text" name="admin" value="<?php $admin = isset($_GET['admin']) ? $_GET['admin'] : '';  echo $admin; ?>"></li>
		<li style="padding:10px 0 0 110px;height:10px;;">登录密码：</li>
		<li style="padding:10px 0 0 110px;height:30px;"><input style="width:180px;font-size:13px;" type="password" name="pwd1" value=""></li>
		<li id="errstr" style="padding:5px 0 0 110px;height:15px;font-size:13px;color:#ff0000;"></li>
		<li style="padding:15px 0 0 0;text-align:center;"><input class="cssbtn" type="submit" value="登录"></li>
	</ul>
	</form>
</div>

</body>
</html>
