<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file = "setup.asp"-->
<!--#include file = "conn.asp"-->
<!--#include file = "md5.asp"-->
<%
Dim sAction, sErrMsg
Dim ytss_use, ytss_Pword
sAction = UCase(Trim(Request("action")))
sErrMsg = ""

Select Case sAction
Case "LOGIN"
	Set oRs = Server.CreateObject( "ADODB.Recordset" )
	ytss_use = HX_Replace(Trim(Request("usr")))
	ytss_Pword = HX_Replace(Trim(Request("pwd")))
	ytss_yan=HX_Replace(trim(request.Form("yan")))
	if Session("wumei_GetCode")= ytss_yan then
			If ytss_use <> "" And ytss_Pword <> "" Then
				sSql = "select * from deandata where deanno='"&ytss_use&"'"
				oRs.Open sSql, conn, 0, 1
				If Not oRs.Eof Then
					If oRs("deanno") = ytss_use And oRs("deanpass") = md5(ytss_Pword) Then
						Session("deanno") = oRs("deanno")
						Session("deanname") = oRs("deanname")
						Response.Redirect "admin/dean_book.asp"
						response.Write "<script LANGUAGE='javascript'>window.location.href = 'ck_manage.asp target=_top'</script>"
						Response.End
					End If
				End If
				oRs.Close
			End If
			sErrMsg = "提示：用户名或密码错误！"
	else 
		response.Write "<script LANGUAGE='javascript'>alert('请输入正确的验证码！');history.go(-1);</script>"
		response.end
	end if
Case "OUT"
End Select

%>
<html>
<head>
<LINK href="img/css.css" type=text/css rel=stylesheet>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=site_name%>——写留言</title>
<SCRIPT language=JavaScript>
function checklogin() {
	if (document.myform.usr.value=="") {
		alert("请输入用户名!");
		myform.usr.focus();
		return false;
	}
	if (document.myform.pwd.value=="") {
		alert("请输入密码!");
		myform.pwd.focus();
		return false;
	}
	if (document.myform.yan.value=="") {
		alert("请输入验证码!");
		myform.yan.focus();
		return false;
	}
	return true;
}
</SCRIPT>
<style type="text/css">
<!--
.style4 {font-size: 20pt; font-family: "黑体";}
-->
</style></head>

<body class="body_qian"><!--#include file="top.asp" -->

<table width="908" height="368" border="3" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
  <tr>
    <td width="200" height="362" valign="top" bgcolor="#FFFFFF"><br>
    <a href="gbwrite.asp"><img src="img/write.gif" border="0"></a><a href="gindex.asp"><img src="img/look.gif" border="0"></a><br>
    <a href="dean_Login.asp"><img src="img/dean.gif" width="200" height="45" border="0"></a> </td>
    <td width="547" align="center" valign="top" bgcolor="#FFFFFF">&nbsp;	
      <img src="img/dean.jpg">
      <table width="373" height="209" border="7" align="center" cellpadding="0" cellspacing="0" bordercolor="#EEEEEE">
        <tr>
          <td width="357" height="195" align="center" valign="top"><br>
              <%response.Write("<font color=red>"&sErrMsg&"</font>")%>
              <form name="myform" onSubmit="return checklogin()" method="post" action="?action=login">
                <table width="90%" height="159" border="0" cellpadding="3" cellspacing="0">
                  <tr>
                    <td width="19%" height="36">用户名</td>
                    <td width="81%"><input name="usr" type="text" id="usr" size="20" maxlength="20" style="height:22px;border:1px solid #006699">
                    </td>
                  </tr>
                  <tr>
                    <td height="38">密&nbsp; 码</td>
                    <td><input name="pwd" type="password" id="pwd" size="20" maxlength="20" style="height:22px;border:1px solid #006699">
                    </td>
                  </tr>
                  <tr>
                    <td>验证码</td>
                    <td><input  style="height:22px;border:1px solid #006699" name="yan" type="text" id="yan" value="<%If GetCode=9999 Then Response.Write "9999"%>" size="20" maxlength="4">
                        <img src="GetCode.asp" alt="看不清就点击一下" onClick="this.src='GetCode.asp'" style="cursor:pointer"></td>
                  </tr>
                  <tr>
                    <td></td>
                    <td>&nbsp;&nbsp;&nbsp;
                        <input name="Submit2" type="image" style="height:23px;width:70px;" value="登录" src="img/login.gif" width="70" height="23"></td>
                  </tr>
                </table>
          </form></td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="bottom.asp"-->
</body>
</html>
<%conn.close
set conn=nothing%>
