📄 view.asp
字号:
<%option explicit%>
<%
Response.Expires = -1
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "Cache-Control","no-cache,must-revalidate"
%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/Page.asp" -->
<!-- #include file="Print.asp" -->
<%
Dim ObjDB,ObjRS,ObjRS1,StrSQL
Dim IntID,getIdRS
Dim C,C1
Dim ParentID
Dim i
Const MaxLength = 200
Set ObjDB = Server.CreateObject("Adodb.Connection")
OpenDB ObjDB
if Cint(Request.QueryString("ID")) = -1 then '下一个
StrSQL = "Select Min(ID) AS ID From t_OA_Public_Vote where SubID=0 And ID >" & Request.QueryString("VoteID")
'Response.Write StrSQL
Set getIdRS = ObjDB.Execute(StrSQL)
IntID = getIdRS("ID")
elseif Cint(Request.QueryString("ID")) = -2 then '上一个
StrSQL = "Select Max(ID) AS ID From t_OA_Public_Vote where SubID=0 And ID <" & Request.QueryString("VoteID")
'Response.Write StrSQL
Set getIdRS = ObjDB.Execute(StrSQL)
IntID = getIdRS("ID")
else
IntID = Request.QueryString("ID")
end if
if IntID = "" OR Isnull(IntID) then
%>
<script language=javascript>
alert("已经是第一个或者最后一个投票!")
window.location = "List.asp"
</script>
<%
End if
StrSQL = "Select ID,Topic,TicketCount,ParentID,SubID,IsSingle From t_OA_Public_Vote where SubID=0 And ID=" & IntID
Set C = Server.CreateObject ("CMS2003.DBHandle")
C.Init (ObjDB)
'Response.Write StrSQL
Set ObjRS = C.View (StrSQL)
ParentID = ObjRS("ParentID")
ObjRS1= C.List(1,0,"Select ID,Topic,TicketCount,SubID From t_OA_Public_Vote where (SubID<>0) And(ParentID=" & ParentID &")")
Sub Main
If ObjRS.Count > 0 then
%>
<form id=form1 name=form1 method=post action="vote.asp">
<input type = hidden name=ID value =<%=IntID%>>
<input type = hidden name=ParentID value =<%=ObjRS("ParentID")%>>
<table class=Ltable cellspacing=1 cellpadding=3>
<tr class=LHtr><td colspan=4><%=ObjRS("Topic")%>(总共<%=ObjRS("TicketCount")%>票)</td></tr>
<tr class=LStr>
<td width=1%></td>
<td>选项</td>
<td>图形显示</td>
<td width=10%>票数</td>
</tr>
<%
Dim a()
for i = 0 to UBound(ObjRS1, 2)
Redim Preserve a(i)
if ObjRS("TicketCount") <> 0 then
a(i) = (ObjRS1(2, i)/ObjRS("TicketCount")) * 100
else
a(i) = 0
end if
next
for i=0 to UBound(ObjRS1,2)%>
<tr class=Ltr>
<%
if ObjRS("IsSingle") Then
%>
<td><input type="radio" value="<%=i+1%>" name="SelectBox"></td>
<%
else
%>
<td><input type="checkbox" name="SelectBox" value="<%=i+1%>"></td>
<%
end if
%>
<td><%=ObjRS1(1,i)%></td>
<td>
<img Src="<%=Application("RootPath")%>IMAGES/OA/Public/Vote/Vote.gif" height=10 width=<%=MaxLength*ObjRS1(2,i)*100/(GetMaxCount(ObjRS1)*100+1)%> height=20><%= Left(a(i), 5)%>%
</td>
<td><%=ObjRS1(2,i)%></td>
</tr>
<%
next
%>
</table>
<input type=button class=button value="上一个" onclick="window.location = 'View.asp?ID=-2&VoteID=<%=IntID%>'" ><input type="submit" class=button value="投 票" name="B1"><input type=button class=button value="返 回" onclick="doList()" ><input type=button class=button value="下一个" onclick="window.location = 'View.asp?ID=-1&VoteID=<%=IntID%>'" >
</form>
<%
end if
End Sub
%>
<!-- #include file="Templet.asp" -->
<%
ObjDB.Close
Set ObjDB = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -