
<!--#include file="inc_top.asp" -->
<table width="762" bgcolor="#ffffff" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10" height="259" valign="top" class="table-you">
    </td>
    <td width="750" valign="top"> <p>&nbsp;</p><table width="99%" height="19" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td>
<%
	huiyuan=nohack(request("huiyuan"))
	password=nohack(Request("password"))

	set rs=server.createobject("adodb.recordset")
	sql="select * from huiyuan where huiyuan='"&huiyuan&"' and password='"&password&"'"

	rs.open sql,conn,1,3
 	if not(rs.bof and rs.eof) then
 		if huiyuan=rs("huiyuan") and password=rs("password") then
			if rs("logins")="" or isnull(rs("logins")) then
			rs("logins")=1
			else
			rs("logins")=rs("logins")+1
			end if
			rs("lastlogin")=Now()
			rs.update
			article=rs("article")
set rs1=server.createobject("adodb.recordset")
sql1 = "select top 1* from bbs_config"
rs1.Open sql1,conn,1,1
user_level1=rs1("user_level1")
user_level2=rs1("user_level2")
user_level3=rs1("user_level3")
user_level4=rs1("user_level4")
user_level5=rs1("user_level5")
user_level6=rs1("user_level6")
user_level7=rs1("user_level7")
user_level8=rs1("user_level8")
user_level9=rs1("user_level9")
level1_point=rs1("level1_point")
level2_point=rs1("level2_point")
level3_point=rs1("level3_point")
level4_point=rs1("level4_point")
level5_point=rs1("level5_point")
level6_point=rs1("level6_point")
rs1.close
set rs1=nothing

			if rs("userclass")<>user_level7 and rs("userclass")<>user_level8 and rs("userclass")<>user_level9 then
				if rs("article")>=level2_point and rs("article")<level3_point then
					if rs("userclass")<>user_level2 then
						rs("userclass")=user_level2
						rs.update
					end if
				elseif rs("article")>=level3_point and rs("article")<level4_point then
					if rs("userclass")<>user_level3 then
						rs("userclass")=user_level3
						rs.update
					end if
				elseif rs("article")>=level4_point and rs("article")<level5_point then
					if rs("userclass")<>user_level4 then
						rs("userclass")=user_level4
						rs.update
					end if
				elseif rs("article")>=level5_point and rs("article")<level6_point then
					if rs("userclass")<>user_level5 then
						rs("userclass")=user_level5
						rs.update
					end if
				elseif rs("article")>=level6_point then
					if rs("userclass")<>user_level6 then
						rs("userclass")=user_level6
						rs.update
					end if
				end if
			end if
	Response.Cookies("lgcookie")("username") = rs("huiyuan")
	Response.Cookies("lgcookie")("password") = rs("password")
	Response.Cookies("lgcookie")("userclass") = rs("userclass")
	Response.Cookies("lgcookie").Expires = Now()+365
	session("huiyuan")=rs("huiyuan")
	'如果购买车为空，转入网站首页，否则进入购物车页面
	Response.write "<br><br>欢迎<font color=red>"&rs("huiyuan")&"</font>第<font color=red>"&rs("logins")&"</font>次登录，您的积分是<font color=red>"&rs("jifen")&"</font>分!<br><br>"
	set rs2 = conn.execute("select * from ls_cart where sessionid="&session.SessionID&"")
		If rs2.eof Then
		Response.write "<img src=image/tp01.gif width=17 height=17> <a href=allsubject.asp><u>最新的促销活动</u></a><br><br>"
		Response.write "<img src=image/tp01.gif width=17 height=17> <a href=index.asp><u>商城首页</u></a><br><br>"
		Response.write "<img src=image/tp01.gif width=17 height=17> <a href=go-cart.asp><u>去收银台</u></a><br><br>"
		Response.write "<img src=image/tp01.gif width=17 height=17> <a href=huiyuan-1.asp><u>查看我的帐户</u></a><br><br>"
		Response.write "<img src=image/tp01.gif width=17 height=17> <a href=bbs/index.asp><u>去社区</u></a><br><br>"
		Else
		Response.write "<img src=image/tp01.gif width=17 height=17> <a href=go-cart.asp><u>去收银台</u></a><br><br>"
		Response.write "<img src=image/tp01.gif width=17 height=17> <a href=index.asp><u>商城首页</u></a><br><br>"
		Response.write "<img src=image/tp01.gif width=17 height=17> <a href=huiyuan-1.asp><u>查看我的帐户</u></a><br><br>"
		Response.write "<img src=image/tp01.gif width=17 height=17> <a href=bbs/index.asp><u>去社区</u></a><br><br>"
		End If
	rs2.close
 	else
	call Error
	end if
	else
		call Error()
	end if

	sub Error()
        Response.write "<img src=image/tp01.gif width=17 height=17>用户名或密码错误！<br><br>&nbsp;&nbsp;<a href=# onclick='javascript:window.history.go(-1)'>&gt;&gt;返回上一页</a>"
	end sub
	rs.close
	set rs=nothing
%>
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table><!--#include file="inc_end.asp" -->