<!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>后台管理</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="/static/css/top_css.css" rel="stylesheet" type="text/css" />
	<link href="/static/css/login_css.css" rel="stylesheet" type="text/css" />
	<link rel="shortcut icon" href="/static/images/E-ZKEco32.ico" /> 
	<script src="/static/dwz-ria/bin/jquery.js" type="text/javascript"></script>
	<script>
			function getDate(){
			 var d = new Date();
			 var year = d.getFullYear();
			 var month = d.getMonth()+1;
			 var date = d.getDate();
			 var hour=d.getHours();
			 var minutie=d.getMinutes();
			 var second=d.getSeconds();
			 time=year+"-"+month+"-"+date+" &nbsp;"+hour+":" +minutie+":"+second+"";
			 $("#login_time")[0].innerHTML=time;
			}
		$(document).ready(function(){
			setInterval(getDate,100);
		});
		
</script>
</head>
<body>
	<div class="login">
	<div class="login_biao">后台管理系统</div>
	<div class="login_time" id="login_time">
	</div>
	
	    	<form id = "manager_login" action="" method="post" onkeydown="javasceipt:if(event.keyCode == 13){$('#login_id').click();}  ">
				<table class="login_table" border="0" cellpadding="0" cellspacing="0">
					  <tr>
					    <td align="right" class="login_l">用户名: </td>
					    <td>
					      <input class="input" type="text" name="username" id="username" />    </td>
					  </tr>
					  <tr>
					    <td align="right" class="login_l">密码:</td>
					    <td >
					      <input class="input" type="password" name="password" id="password" />   </td>
					  </tr>
					  <tr>
					    <td>&nbsp;</td>
					    <td align="left" >
					      <input class="inputan" type="button" id="login_id" name="Submit" value=" 登录 " onclick="login();"/>
					      <input class="inputan" type="button" name="Submit2" value="重置" onclick="reset();"/>    </td>
					  </tr>
					  <tr>
						<td colspan="2" align="center" ><div class="ts" id= "tip"></div></td>
					  </tr>
					  
					</table>
		    	
		    </form>

	
	<script>
		$(function(){
			$("#username").focus();
		})
		function reset(){
			$("#username").val("");
			$("#password").val("");
			return;
		}
		function login(){
			var uname = $.trim($("#username").val());
		 	var pwd = $.trim($("#password").val());
		 	
		 	if (uname=="" || pwd == ""){
		 		$("#tip").html("用户名或密码不能为空!");
		 		return;
		 	}
		 	serialize_form=$("#manager_login").serialize();
	        $.ajax({
	            url:"/login_check",
	            type:"POST",
	            data:serialize_form,
	            dataType:"html",
	            success:function(msg){
	                if(msg=='OK'){
	                	window.location.href="/";
	                }else{
	                    $("#password").val('');
	                    $("#tip").html("用户名或密码不正确!");
	                }
	            }
	        });
		}
	</script>
	</div>
</body>
</html>
