<%@page contentType="text/html; charset=GBK"%><%@include file="../include/Config.jsp"%><%@include file="../include/DBCon.jsp"%><%if(!StrFormat.isNull(request.getParameter("do"))){if(!StrFormat.isNull(request.getParameter("Name").trim()) && !StrFormat.isNull(request.getParameter("Password").trim())){DBSql = "Select a.id,a.name AS aname,a.`user`,a.roleid,a.lasttime,a.lastip,r.name AS rname,r.scopeid "+"From admin AS a Left Join role AS r ON a.roleid = r.id "+"where a.name ='"+StrFormat.htmlTo(StrTrans.toGBK(request.getParameter("Name").trim()))+"' "+"and a.passw='"+MD5.getMD5ofStr(StrFormat.htmlTo(StrTrans.toGBK(request.getParameter("Password").trim()))) +"'";DBStmt = DBCon.createStatement();DBRs = DBStmt.executeQuery(DBSql);if(DBRs.next()){GenCookie.setCookie(response,"AdmID",DBRs.getString("id"),CookieMaxTime);GenCookie.setCookie(response,"AdmRoleID",DBRs.getString("roleid"),CookieMaxTime);GenCookie.setCookie(response,"AdmName",DBRs.getString("aname"),CookieMaxTime);GenCookie.setCookie(response,"AdmUser",DBRs.getString("user"),CookieMaxTime);GenCookie.setCookie(response,"AdmScopeID",DBRs.getString("scopeid"),CookieMaxTime);GenCookie.setCookie(response,"AdmRoleName",DBRs.getString("rname"),CookieMaxTime);GenCookie.setCookie(response,"AdmLastIP",DBRs.getString("lastip"),CookieMaxTime);GenCookie.setCookie(response,"AdmLastTime",DBRs.getString("lasttime"),CookieMaxTime);DBSql = "update admin set lasttime='"+ DateFormat.getDateTime() +"',lastip='"+ request.getRemoteAddr() +"' where id="+DBRs.getString("id");DBStmt.executeUpdate(DBSql);MesgStr = "登录成功";	response.sendRedirect(HostStr+"/manager/index.jsp");}else{MesgStr = "该帐号或密码无效";}DBRs.close();	DBStmt.close();}else{MesgStr = "信息输入错误...请重新输入！";}out.print("<script type=\"text/javascript\">alert(\""+MesgStr+"\"); history.back(); </script>");}else{out.clearBuffer();%><html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK" /><meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache,must-revalidate"><meta http-equiv="expires" content="mon,23 jan 1978 12:52:30 gmt"><meta name="keywords" content="向继根,Xiang Jigen,QQ,190582560"><meta name="description" content="Programmer:向继根 QQ:190582560 Email:190582560@qq.com"><meta name="author" content="向继根,Xiang Jigen" /><title><%=TitleStr%>后台登录</title><link rel="stylesheet" type="text/css" href="images/Style.css"/><script type="text/javascript" src="../js/min.js"></script><script type="text/javascript" src="../js/common.js"></script><script type="text/javascript" src="../js/css.js"></script><style type="text/css">body {background-image: url(images/loginbg.gif);}.Linput {margin: 1px;padding: 1px;border: 1px solid #086CB7;background-color: #EEEDED;font-family: "宋体";font-size: 12px;text-decoration: none;color: #086CB7;line-height: normal;}.Lbutton {margin: 1px;padding: 1px;border: 1px solid #086CB7;background-color: #086CB7;font-family: "宋体";font-size: 12px;text-decoration: none;color: #FFFFFF;line-height: normal;}</style></head><body><script type="text/javascript">$GenID("Name").value = getCookie("AdmName");</script><table width="332" height="207" border="0" cellpadding="0" cellspacing="0" background="images/login.gif" style="margin-top:150px"><tr><td><table width="280" border="0" align="center" cellpadding="0" cellspacing="0"><form id="Login" name="Login" method="post" action="?do=login"><tr><td height="40" colspan="2" valign="bottom" class="align_c">用户名：<input name="Name" id="Name" size="30" maxlength="25" /></td></tr><tr><td height="40" colspan="2" valign="bottom" class="align_c">密&nbsp;&nbsp;码：<input name="Password" type="password" id="Password" size="30" maxlength="35" /></td></tr><tr><td height="50" colspan="2" align="center" valign="bottom" class="align_c"><input name="S" type="submit" class="button_style" id="S" value="登 录" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="R" type="reset" class="button_style" id="R" value="取 消" /></td></tr></form></table></td></tr></table></body></html><%}%><%@include file="../include/DBConClose.jsp"%>