<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%call head()
Call saycarda("添加版主")
dim userid,ids,TP
ids=request("ids")
userid=request("userid")
TP=request("TP")

if TP<>"" then
TP=clng(TP)
if TP=1 then

if ids="" or IsNumeric(ids)=False then
  Call Error("选择版块无效！")
  end if
end if

if userid="" or IsNumeric(userid)=False then
  Call Error("会员ID无效！")
  end if
'检查ID是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT name FROM users where id="&userid,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("会员ID不存在！")
end if
  rs.close
  set rs=Nothing
if TP=1 then
 conn.Execute"update users set skey="&ids&" Where ID="&userid
end if

if TP=2 then
 conn.Execute"update users set keys=1,skey=0 Where ID="&userid
end if
if TP=3 then
 conn.Execute"update users set keys=2 Where ID="&userid
end If
if TP=4 then
 conn.Execute"update users set keys=3 Where ID="&userid
end If
if TP=5 then
 conn.Execute"update users set keys=4 Where ID="&userid
end If
if TP=6 then
 conn.Execute"update users set keys=5 Where ID="&userid
end if
response.write "操作成功！<br/>"
ELSE
if saytk>1 Then
%><hr><%
Response.write "<form name=""form"" method=""post"" action=""adminboss.asp?sid="&sid&"&amp;saytk="&saytk&""">"
response.write "用户ID：<input name='userid' format='*N' value=''/><br/>"
response.write "选择版块<br/>"
response.write "<select name='ids'><option>版块列表</option>"
set rs=server.createobject("ADODB.Recordset")
rs.open"select id,name from ydbbs where lx=1 order by id desc",conn,1,1
dim j
j=1
do while not rs.eof
Response.write "<option value='" & ubb(rs("id")) & "'>" & ubb(rs("name")) & "</option>"
j=j+1
rs.movenext
loop
rs.close
set rs=nothing
Response.write "</select><br/>"
response.write "<input type=""hidden"" name=""tp"" value=""1""/>"
response.write "<input type=""submit"" name=""Submit"" value=""设为版主""></form><br/>"
Response.write "<form name=""form"" method=""post"" action=""adminboss.asp?sid="&sid&"&amp;saytk="&saytk&""">"
response.write "用户ID：<br/><input name='userid' format='*N' value=''/>"
response.write "<input type=""hidden"" name=""tp"" value=""2""/>"
response.write "<input type=""submit"" name=""Submit"" value=""设为"&saybbsgl&"""></form><br/>"
%><hr><%
Response.write "<form name=""form"" method=""post"" action=""adminboss.asp?sid="&sid&"&amp;saytk="&saytk&""">"
response.write "用户ID：<br/><input name='userid' format='*N' value=''/>"
response.write "<input type=""hidden"" name=""tp"" value=""3""/>"
response.write "<input type=""submit"" name=""Submit"" value=""设为"&saybbsgl1&"""></form><br/>"
%><hr><%
Response.write "<form name=""form"" method=""post"" action=""adminboss.asp?sid="&sid&"&amp;saytk="&saytk&""">"
response.write "用户ID：<br/><input name='userid' format='*N' value=''/>"
response.write "<input type=""hidden"" name=""tp"" value=""4""/>"
response.write "<input type=""submit"" name=""Submit"" value=""设为"&saybbsgl2&"""></form><br/>"
%><hr><%
Response.write "<form name=""form"" method=""post"" action=""adminboss.asp?sid="&sid&"&amp;saytk="&saytk&""">"
response.write "用户ID：<br/><input name='userid' format='*N' value=''/>"
response.write "<input type=""hidden"" name=""tp"" value=""6""/>"
response.write "<input type=""submit"" name=""Submit"" value=""设为"&saybbsgl4&"""></form><br/>"
%><hr><%
Response.write "<form name=""form"" method=""post"" action=""adminboss.asp?sid="&sid&"&amp;saytk="&saytk&""">"
response.write "用户ID：<br/><input name='userid' format='*N' value=''/>"
response.write "<input type=""hidden"" name=""tp"" value=""7""/>"
response.write "<input type=""submit"" name=""Submit"" value=""设为"&saybbsgl5&"""></form><br/>"
%><hr><%
else
response.write "用户ID：<input name='userid' format='*N' value=''/><br/>"
response.write "选择版块<br/>"
response.write "<select name='ids'><option>版块列表</option>"
set rs=server.createobject("ADODB.Recordset")
rs.open"select id,name from ydbbs where lx=1 order by id desc",conn,1,1
j=1
do while not rs.eof
Response.write "<option value='" & ubb(rs("id")) & "'>" & ubb(rs("name")) & "</option>"
j=j+1
rs.movenext
loop
rs.close
set rs=nothing
Response.write "</select><br/>"

Response.write "<anchor>设为版主<go href='adminboss.asp?sid="&sid&"&amp;saytk="&saytk&"' method='post' accept-charset='utf-8'>"
Response.write "<postfield name='ids' value='$(ids)'/>"
Response.write "<postfield name='userid' value='$(userid)'/>"
Response.write "<postfield name='TP' value='1'/>"
Response.write "</go></anchor><br/>"

Response.write "<anchor>设为"&saybbsgl&"<go href='adminboss.asp?sid="&sid&"&amp;saytk="&saytk&"' method='post' accept-charset='utf-8'>"
Response.write "<postfield name='userid' value='$(userid)'/>"
Response.write "<postfield name='TP' value='2'/>"
Response.write "</go></anchor><br/>"

Response.write "<anchor>设为"&saybbsgl1&"<go href='adminboss.asp?sid="&sid&"&amp;saytk="&saytk&"' method='post' accept-charset='utf-8'>"
Response.write "<postfield name='userid' value='$(userid)'/>"
Response.write "<postfield name='TP' value='3'/>"
Response.write "</go></anchor><br/>"

Response.write "<anchor>设为"&saybbsgl2&"<go href='adminboss.asp?sid="&sid&"&amp;saytk="&saytk&"' method='post' accept-charset='utf-8'>"
Response.write "<postfield name='userid' value='$(userid)'/>"
Response.write "<postfield name='TP' value='4'/>"
Response.write "</go></anchor><br/>"

Response.write "<anchor>设为"&saybbsgl4&"<go href='adminboss.asp?sid="&sid&"&amp;saytk="&saytk&"' method='post' accept-charset='utf-8'>"
Response.write "<postfield name='userid' value='$(userid)'/>"
Response.write "<postfield name='TP' value='6'/>"
Response.write "</go></anchor><br/>"

Response.write "<anchor>设为"&saybbsgl5&"<go href='adminboss.asp?sid="&sid&"&amp;saytk="&saytk&"' method='post' accept-charset='utf-8'>"
Response.write "<postfield name='userid' value='$(userid)'/>"
Response.write "<postfield name='TP' value='7'/>"
Response.write "</go></anchor><br/>"

END IF
end if
Response.write "------------<br/>"
conn.close
set conn=Nothing
response.write"<a href=""adminbbsboss.asp?sid="&sid&"&amp;saytk="&saytk&""">[版主管理]</a>"
%>
<!--#include file="fanhui.asp"-->
<%
call headsay()%>