📄 delsta.asp
字号:
<%Option Explicit%>
<%
dim objRS,objRS_parent,sql
dim sortid,staid,ispass
dim tmp,referer
sortid = Request.Form("sortid")
staid = Request.Form("staid")
ispass = UCase(Request.Form("ispass"))
if Trim(staid) = "" then
Response.Write("<script language=""JavaScript"">alert(""请选择要删除的站点!"");history.go(-1)</script>")
Response.End
end if
%>
<!--#include file="adoconn.asp"-->
<%
referer = Request.ServerVariables("HTTP_REFERER")
tmp = split(staid,chr(44))
objConn.BeginTrans
Set objRS = Server.CreateObject("ADODB.RecordSet")
if sortid <> "" and IsNumeric(sortid) then
sql = "delete * from stationinfo where id in (" & staid & ")"
objConn.Execute(sql)
sql = "select * from sort where id = " & sortid
objRS.Open sql, objConn, 3, 3
if ispass = "FALSE" then
objRS("totalnopass").value = objRS("totalnopass").value - (UBound(tmp) + 1)
else
objRS("totalispass").value = objRS("totalispass").value - (UBound(tmp) + 1)
end if
objRS.Update()
objRS.Close()
else
sql = "select * from stationinfo where id in (" & staid & ")"
objRS.Open sql, objConn, 3, 3
if not objRS.EOF then Set objRS_parent = Server.CreateObject("ADODB.RecordSet")
do while not objRS.EOF
sql = "select * from sort where id = " & objRS("parentid")
objRS_parent.Open sql, objConn, 3, 3
if objRS_parent.EOF then
'err
else
if objRS("ispass") then
objRS_parent("totalispass").value = objRS_parent("totalispass").value - 1
else
objRS_parent("totalnopass").value = objRS_parent("totalnopass").value - 1
end if
objRS_parent.Update()
end if
objRS_parent.Close()
objRS.Delete()
objRS.MoveNext()
loop
Set objRS_parent = nothing
objRS.Close()
end if
objConn.CommitTrans
Set objRS = nothing
objConn.Close()
Set objConn = nothing
Response.Redirect(referer)
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -