⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showvote.asp

📁 这是我根据动网新闻核心自行设计的校园新闻系统
💻 ASP
字号:
<!-- #include file="../inc/const.asp" -->
<!-- #include file="../inc/config.asp" -->
<!-- #include file="../inc/conn.asp" -->
<!-- #include file="../inc/function.asp" -->
<!-- #include file="../inc/vote_function.asp" -->

<%
dim votedetail()
dim votetitle
dim votecount
dim style
dim voteid
dim addr0,addr1,addr
addr0=request.servervariables("server_name")
addr1=request.servervariables("url")
addr1=replace(addr1,"showvote.asp","")
addr="http://"&addr0&addr1
i=1
if isnull(FormatText(request("voteid"))) or FormatText(request("voteid"))="" then
	set rs=conn.execute("select top 1 votetitle,(select count(id) from vote_details where voteid=vote_vote.id),style,id from vote_vote")
else
	set rs=conn.execute("select votetitle,(select count(id) from vote_details where voteid="&FormatText(request("voteid"))&"),style,id from vote_vote where id="&FormatText(request("voteid")))
end if
voteid=rs(3)
votetitle=rs(0)
votecount=rs(1)
style=rs(2)
redim votedetail(votecount,2)
rs.close
set rs=conn.execute("select votedetail,votecount,id from vote_details where voteid="&voteid)
do while not rs.eof
	votedetail(i,0)=rs(2)
	votedetail(i,1)=rs(1)
	votedetail(i,2)=rs(0)
	i=i+1
	rs.movenext
loop
%>
vote<%=voteid%>="";<%=chr(10)%>
<%
if err then
	rs.close
	set rs=nothing
	call connclose
	%>
	vote<%=voteid%>=vote<%voteid%>+"出错了...";<%=chr(10)%>
	document.write (vote<%=voteid%>);
	<%
	response.end
else
	rs.close
	set rs=nothing
	call connclose
end if

if FormatText(request("windowwidth"))<>"" then
	window_width=FormatText(request("windowwidth"))
end if
if FormatText(request("windowheight"))<>"" then
	window_height=FormatText(request("windowheight"))
end if
show_vote_result=replace(show_vote_result,"$$resultpage$$",addr&"showvotedetails1.asp?voteid="&voteid)
%>

vote<%=voteid%>=vote<%=voteid%>+"<form name=voteform<%=voteid%> action='<%=addr%>countvote.asp?voteid=<%=voteid%>' target='<%=window_name%>' method='POST'>";<%=chr(10)%>
vote<%=voteid%>=vote<%=voteid%>+"<div align=center><table <%=show_vote_table%>>";<%=chr(10)%>
vote<%=voteid%>=vote<%=voteid%>+"<tr><td <%=show_vote_td1%>><%=votetitle%></td></tr>";<%=chr(10)%>

<%for i=1 to ubound(votedetail,1)%>
	vote<%=voteid%>=vote<%=voteid%>+"<tr>";<%=chr(10)%>
	vote<%=voteid%>=vote<%=voteid%>+"<td <%=show_vote_td2%>><input type='<%=style%>' name='votedetail' value='<%=votedetail(i,0)%>' size='20'><%=votedetail(i,2)%></td>";<%=chr(10)%>
	vote<%=voteid%>=vote<%=voteid%>+"</tr>";<%=chr(10)%>
<%next%>

vote<%=voteid%>=vote<%=voteid%>+"<tr><td <%=show_vote_td3%>><input type='button' value='投票' name='B1' onclick='tou<%=voteid%>();'><%=show_vote_result%></td></tr>";<%=chr(10)%>
vote<%=voteid%>=vote<%=voteid%>+"</table></div>";<%=chr(10)%>
vote<%=voteid%>=vote<%=voteid%>+"<\script>";<%=chr(10)%>
vote<%=voteid%>=vote<%=voteid%>+"function tou<%=voteid%>(){window.open('about:blank','<%=window_name%>','width=<%=window_width%>,height=<%=window_height%>,<%=window_style%>');voteform<%=voteid%>.submit();}";<%=chr(10)%>
vote<%=voteid%>=vote<%=voteid%>+"</\script>";<%=chr(10)%>
document.write(vote<%=voteid%>);<%=chr(10)%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -