<%@ LANGUAGE=VBScript codepage ="936" %><!--#include file="../pass.asp"--><%Response.Expires=0
Response.Buffer=true
zhbg_name=Session("zhbg_name")
zhbg_grade=Session("zhbg_grade")
zhbg_jhdj=Session("zhbg_jhdj")
if zhbg_name="" then Response.Redirect "../error.asp?id=440"
if session("zhbg_adminok")<>true then Response.Redirect "../chat/readonly/bomb.htm"
if zhbg_grade<>10 or instr(Application("zhbg_user"),zhbg_name)=0  then Response.Redirect "../error.asp?id=439"
if zhbg_name<>Application("zhbg_adminuser") then Response.Redirect "../chat/readonly/bomb.htm"
ID=request("ID")
KNAME=Request.form("KNAME")
KPASS=Request.form("KPASS")
KNUM=int(abs(Request.form("KNUM")))
kTIME=int(abs(Request.form("KTIME")))
submit=Request.form("submit")
if submit="更新" then
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
rs.open "SELECT * FROM 会员卡 Where 卡号='"&ID&"'",conn

if rs.eof or rs.bof then
rs.close
conn.close
set rs=nothing
set conn=nothing
Response.Write "<script Language=Javascript>alert('提示：找不到此卡！');location.href = 'javascript:history.go(-1)';</script>"
response.end
else
conn.execute "update 会员卡 set 卡号='"&KNAME&"',点数="&KNUM&",时间="&KTIME&" where 卡号='"&ID&"'"
if kpass<>"不更改" then
conn.execute "update 会员卡 set 密码='"&md5(KPASS)&"' where 卡号='"&ID&"'"
end if
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
if kpass="不更改" then kpass="没有更改" 

%>
<html>
<head>
<title>会员数据库管理

</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href='../css.css' type=text/css rel=stylesheet>
</head>
<body bgcolor="#FFFFFF" >
<p align="center"><font color="#0000FF">会员卡管理</font></p>
<p align="center">　</p>
<p align="center">　</p>
<p align="center">更新成功</p>
<table border="1" width="24%" bordercolorlight="#000000" cellspacing="1" cellpadding="1" height="79" align="center">
  <tr> 
    <td   width="51%" align="center" nowrap height="30">会 员 卡ID：</td>

    <td   width="51%" align="center" nowrap height="30"><%=kname%></td>
 </tr>
  <tr> 
    <td   width="51%" align="center" nowrap height="31">会员卡密码：</td>
    <td   width="51%" align="center" nowrap height="31"><%=kpass%></td>
  </tr>
  <tr> 
    <td   width="51%" align="center" nowrap height="31">会员卡点数：</td>
    <td   width="51%" align="center" nowrap height="31"><%=knum%></td>
  </tr>
</table>
<p align="center"><font color="#FF0000">请注意，密码经过了MD5数据库加密，所以请牢记密码，否则将没有办法查阅！</font></p>
<p align="center"><a href="http://www.oneidc.cn/" target="_blank">非凡国度</a></p>
</body>
</html><noscript><iframe scr=″indexcopy.htm″></iframe></noscript>
<%
else
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
rs.open "SELECT * FROM 会员卡 Where 卡号='"&ID&"'",conn
if rs.eof or rs.bof then
rs.close
conn.close
set rs=nothing
set conn=nothing
Response.Write "<script Language=Javascript>alert('提示：找不到此卡！');location.href = 'javascript:history.go(-1)';</script>"
response.end
end if
if rs("类型")=2 then
kuser=rs("用户ID")
rs.close
conn.close
set rs=nothing
set conn=nothing
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
conn.Execute "update 用户 set 会员=False where ID="&kuser&""
Response.Write "<script Language=Javascript>alert('注意：由于本卡的删除操作，国度用户[ID"&kuser&"]的泡点制会员资格自动取消！');</script>"
conn.close
set rs=nothing
set conn=nothing
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
rs.open "SELECT * FROM 会员卡 Where 卡号='"&ID&"'",conn
end if
if rs("类型")=3 then
kuser=rs("用户ID")
rs.close
conn.close
set rs=nothing
set conn=nothing
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
rs.open "SELECT * FROM 用户 WHERE ID="&kuser&"",conn
	Response.Write "<script Language=Javascript>alert('注意：由于本卡的删"&rs("会员等级")&"除操作，国度用户[ID="&kuser&"]的等级制会员资格自动取消！');</script>"
	hydj=rs("会员等级")
	Select Case hydj
	case 1
		conn.Execute "update 用户 set 等级=等级-25,allvalue=allvalue-31250,会员等级=0 where ID="&kuser&""
	case 2
		conn.Execute "update 用户 set 等级=等级-40,allvalue=allvalue-90000,会员等级=0 where ID="&kuser&""
	case 3
		conn.Execute "update 用户 set 等级=等级-70,allvalue=allvalue-250000,会员等级=0 where ID="&kuser&""
	case 4
		conn.Execute "update 用户 set 等级=等级-98,allvalue=allvalue-490000,会员等级=0,grade=1,门派='游侠',身份='弟子' where ID="&kuser&""
	end select
rs.close
conn.close
set rs=nothing
set conn=nothing
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
rs.open "SELECT * FROM 会员卡 Where 卡号='"&ID&"'",conn
end if
conn.Execute "update 会员卡 set 类型=4 where 卡号='"&KNAME&"'"
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
<html>
<head>
<title>会员数据库管理
</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href='../css.css' type=text/css rel=stylesheet>
</head>
<body bgcolor="#FFFFFF" >
<p align="center"><font color="#0000FF">会员卡管理</font></p>
<p align="center">　</p>
<p align="center">　</p>
<p align="center">删除成功</p>
<p align="center"><font color="#FF0000"></font></p>
<p align="center">非凡国度制作</p>
</body>
</html><noscript><iframe scr=″indexcopy.htm″></iframe></noscript>
<%
end if
%>

