<!--#include file="../conn/conn.asp"-->
<!--#include file="../conn/nosql.asp"-->
<!--#include file="../conn/config.asp"-->
<!--#include file="../conn/page.asp"-->
<%if session("adminname")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
end if%>
<%
if request("action")="add" then
bbslogo=nosql(request.form("bbslogo"))
bbsname=nosql(request.form("bbsname"))
bbsnr=nosql(request.form("bbsnr"))
bbsbz=nosql(request.form("bbsbz"))
bbspx=nosql(request.form("bbspx"))
rzh=nosql(request.form("advshow"))
username=nosql(request.form("username"))
if bbsname="" or bbsnr="" then
response.write"<script language='javascript'>alert('请填写完整信息！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if
if not IsNumeric(bbspx) then
response.write"<script language='javascript'>alert('排序必须为数字！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if

Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM snsn_bbsclass"
rs.Open sql,conn,3,2
rs.addnew
rs("bbsname")=bbsname
rs("bbslogo")=bbslogo
rs("bbspx")=bbspx
rs("bbsnr")=bbsnr
rs("bbsbz")=bbsbz
rs("bbsrzh")=bbsrzh
rs("username")=username
rs.update
set rs=nothing
set conn=nothing
response.redirect "bbs.asp"
elseif request("action")="save" then
if isChkInteger(request("bid")) then
bid=request("bid")
else
Response.Redirect ("../index.asp")
end if
bbslogo=nosql(request.form("bbslogo"))
bbsname=nosql(request.form("bbsname"))
bbsnr=nosql(request.form("bbsnr"))
bbsbz=nosql(request.form("bbsbz"))
bbspx=nosql(request.form("bbspx"))
rzh=nosql(request.form("advshow"))
username=nosql(request.form("username"))
if bbsname="" or bbsnr="" then
response.write"<script language='javascript'>alert('请填写完整信息！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if
if not IsNumeric(bbspx) then
response.write"<script language='javascript'>alert('排序必须为数字！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if

Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM snsn_bbsclass where id="&bid 
rs.Open sql,conn,3,2
rs("bbsname")=bbsname
rs("bbslogo")=bbslogo
rs("bbspx")=bbspx
rs("bbsnr")=bbsnr
rs("bbsbz")=bbsbz
rs("bbsrzh")=bbsrzh
rs("username")=username
rs.update
set rs=nothing
set conn=nothing
response.redirect "bbs.asp"
end if
%>