%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
Const PurviewLevel=2
Const CheckChannelID=0
Const PurviewLevel_Others="Form"
%>
<%
dim FileName
const MaxPerPage=20
dim totalPut,CurrentPage,TotalPages
dim sql,rs,FormID,rsFormList,FCID
dim Action,FoundErr,ErrMsg
FCID = cint(ReplaceBadChar(Trim(Request("fcid"))))
Action=ReplaceBadChar(trim(request("Action")))
FormID=ReplaceBadChar(Trim(Request("FormID")))
FileName="Admin_FormManage.asp?fcid="&FCID
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<%
if Action="view" then
call view()
else
if Action="Del" then
conn.execute "Delete From Form Where FormID in (" & FormID & ")"
end if
call main()
end if
if FoundErr=True then
call WriteErrMsg()
end if
sub showContent()
dim FormNum
FormNum=0
%>
<%
end sub
sub main()
sql="select * from Form where FormType=" & FCID & " order by FormID desc"
Set rsFormList= Server.CreateObject("ADODB.Recordset")
rsFormList.open sql,conn,1,1
if rsFormList.eof and rsFormList.bof then
totalPut=0
response.write "
没有任何表单!
"
else
totalPut=rsFormList.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage<>1 then
if (currentPage-1)*MaxPerPage
<%
end sub
sub view()
if FormID="" then
FoundErr=True
ErrMsg=ErrMsg & "
请指定表单ID
"
exit sub
else
end if
dim rsForm
set rsForm=Server.CreateObject("Adodb.RecordSet")
rsForm.open "select * from Form where FormID=" & Clng(FormID),conn,1,3
if rsForm.bof and rsForm.eof then
FoundErr=True
ErrMsg=ErrMsg & "
找不到指定的表单!
"
rsForm.close
set rsForm=nothing
exit sub
end if
%>
<%
end sub
%>
<%
call CloseConn()
%>