📄 edit.asp
字号:
<% option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/Page.asp" -->
<%
Dim ObjDB
Dim C
Dim IntID,ParentID
Dim ObjRS,StrSQL,ObjRS1,ObjRS2,ObjRS3
Dim i,Contents
Dim Checked1,Checked2
IntID = Request.QueryString("ID")
'Response.Write IntID
If IntID ="" Then IntID = 1
Set ObjDB = Server.CreateObject("ADODB.Connection")
OpenDB ObjDB
Set C = Server.CreateObject ("CMS2003.DBhandle")
C.Init(ObjDB)
StrSQL = "select * from t_OA_Public_Vote where ID = '" & IntID & "'"
Set ObjRS = C.View(StrSQL)
StrSQL = "select * from t_OA_Public_Vote where SubID<>0 And ParentID in( Select ParentID From t_OA_Public_Vote Where ID = '" & IntID & "')"
ObjRS1 = C.List(1,0,StrSQL)
If Request.Form.Count > 0 Then
IntID = Request.Form("ID")
StrSQL = "Update t_OA_Public_Vote Set Topic='" & Request.Form("Topic") & "',IsSingle='" & Request.Form("IsSingle") & "' Where ID='" & IntID & "'"
ObjDB.Execute StrSQL
for i= 1 to 10
If Request.Form("Item" & i) <> "" Then
StrSQL = "Update t_OA_Public_Vote Set Topic ='" & Request.Form("Item" & i) &"',IsSingle='" & Request.Form("IsSingle") & "' Where ParentID in(select ParentID from t_OA_Public_Vote where ID=" & IntID & ") And SubID ='" & i &"'"
ObjDB.Execute StrSQL
if i > UBound(ObjRS1,2)+1 then
Response.Write Request.Form("Item5")
StrSQL = "insert into t_OA_Public_Vote(Topic,IsSingle,ParentID,SubID,AccountID) values('" & Request.Form("Item" & i) & "','" & Request.Form("IsSingle") & "','" & ObjRS("ParentID") & "'," & i & ",'" & Session("AccountID") & "')"
ObjDB.Execute StrSQL
end if
End If
next
'Response.End
Response.Redirect "List.asp"
End If
if ObjRS("IsSingle") then
Checked1 ="Checked"
Checked2 =""
else
Checked1 =""
Checked2 ="Checked"
end if
Sub Main
%>
<form action="" method="post" onsubmit="return(CheckForm(this))" id=form1 name=form1>
<table class=Ltable cellspacing=1 cellpadding=3>
<tr class=LHtr>
<input type=hidden name=ID value="<%=IntID%>"></tr>
<tr class=Ltr>
<td>投票名称</td>
<td><input type="text" class=Input Check=1 Show="投票名称" name="Topic" value="<%=ObjRS("Topic")%>"></td>
</tr>
<%
for i = 1 to 10
if i <= UBound(ObjRS1,2) +1 then
Contents = ObjRS1(1,i-1)
else
Contents = ""
end if
%>
<tr class=Ltr>
<td>选项<%=i%></td>
<td><input type="text" class=Input <%If i<3 Then%>Check=1 Show="选项<%=i%>"<%End If%> name="Item<%=i%>" value="<%=Contents%>"></td>
</tr>
<%
next
%>
<tr class=Ltr>
<td>投票方式</td>
<td>单选<input type="radio" value="1" <%=Checked1%> name="IsSingle">多选<input type="radio" value="0" <%=Checked2%> name="IsSingle"></td>
</tr>
<table cellspacing=1 cellpadding=3>
<tr>
<td>
<input type="submit" name="Submit" class=Button value="提 交"><input type="button" class=Button value="取 消" onclick="doList()"></td>
<td></td>
</tr>
</table>
</form>
<%
ObjDB.Close
Set ObjDB = Nothing
End Sub
%>
<!-- #include file="Templet.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -