📄 edit_xinxi_b.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file=usercookies.asp-->
<link rel="stylesheet" type="text/css" href="1.CSS">
<%
dim rs,sql,id,b,username,user_b,i
i=1
id=trim(request("id"))
username=request.cookies("ijob")("username")
set rs = Server.CreateObject("ADODB.RecordSet")
if request("ijob")="chk" then
call edit_b()
response.end
else
sql="select b from [user] where username='"&username&"'"
rs.open sql,conn,1,1
if rs.eof then
response.write "参数错误!"
response.end
end if
user_b=rs("b")
if user_b<1 then
response.write "你还没有道具,请先购买道具!"
cl
response.end
end if
rs.close
sql="select b from [xinxi] where username='"&username&"' and id="&cstr(id)
rs.open sql,conn,1,1
if rs.eof then
response.write "参数错误!"
response.end
end if
b=rs("b")
rs.close
%>
<body topmargin="0">
<title>信息修改-置顶道具使用</title>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="100%" height="25">此前该信息<%if b=1 then%>使用了<%=b%>个<%else%>没有使用<%end if%><font color="#0000FF">信息置顶道具
</font></td>
</tr>
<tr>
<td width="100%" height="25">你现在还有<%=user_b%>个<font color="#0000FF">信息置顶道具</font></td>
</tr>
<tr>
<form action="?id=<%=id%>&ijob=chk" method="POST">
<td width="100%" height="25">如果你想增加请选择数量
<%if user_b>0 then%>
<select name="b">
<option value="0">不使用</option>
<%for i=1 to user_b%>
<option value="<%=i%>"><%=i%></option>
<%next%>
</select>
<input type="submit" value="提交" name="B1">
<%else%><font color="#999999">没有道具</font>
<%end if%>
</td>
</form>
</tr>
</table>
<p>此操作将减掉相应的道具数量</p>
<%
end if
sub edit_b()
sql="select b from [user] where username='"&username&"'"
rs.open sql,conn,1,3
b=rs("b")
if b<1 then
response.write "没有足够的道具!"
cl
response.end
else
rs("b")=rs("b")-int(trim(request("b")))
rs.update
end if
rs.close
sql="select b from [xinxi] where username='"&username&"' and id="&cstr(id)
rs.open sql,conn,1,3
if rs("b")=0 then
rs("b")=trim(request("b"))
else
rs("b")=rs("b")+int(trim(request("b")))
end if
rs.update
response.write "修改信息置顶道具成功!"
rs.close
cl
response.end
end sub
%>
<%sub cl()%>
<body onLoad="setTimeout(window.close, 2000)">
<%end sub%>
<%closedb%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -