?? main_vote.asp
字號:
<%
sub main_vote()
sql="select top "&mainvote&" * from votetopic where datediff('d',Now(),vt_expiredate)>0 order by vt_id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
%>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<form name="form1" method="post" action="savevote.asp?vt_id=<%=rs("vt_id")%>&vt_name=<%=rs("vt_name")%>" target="vote" onsubmit="return vote()">
<tr>
<td colspan="2" style="vertical-align: middle" align="center"><%=rs("vt_name")%></td>
</tr>
<%sql="select * from voteitem where vt_id="&rs("vt_id")
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
%>
<tr>
<td width="15%"></td>
<td>
<input type="radio" name="item_id" value="<%=rs2("item_id")%>">
<%=rs2("item_name")%></td>
</tr>
<%rs2.movenext
loop
if rs2.eof and rs2.bof then%>
<tr>
<td colspan="2" align="center">當前沒有投票選項!</td>
</tr>
<%end if
rs2.close
set rs2=nothing%>
<tr>
<td height="30" colspan="2" align="center">
<%if request.cookies("npw")("voted")<>"yes" or request.cookies("npw")("topic")<>rs("vt_name") then%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr align="center">
<td> <input name="login" type="image" src="images/pic/toupiao.gif" align="middle" width="61" height="20"></td>
<td><a onClick="MM_openBrWindow('showvote.asp?vt_id=<%=rs("vt_id")%>','Vote','status=yes,scrollbars=yes,width=600,height=400')" href="#"><img src="images/pic/jieguo.gif" width="61" height="20" border="0"></a></td>
</tr>
</table>
<%else%>
<font color="#FF0000">您已經投過票了</font><br>
<a onClick="MM_openBrWindow('showvote.asp?vt_id=<%=rs("vt_id")%>','Vote','status=yes,scrollbars=yes,width=600,height=400')" href="#">查看結果</a>
<%end if%>
</td>
</tr>
<input name="itemname" type="hidden" value="<%=rs("vt_name")%>">
</form>
</table>
<%
else
%>
<%
response.write "<div align='center'>當前沒有投票主題!</div>"
end if
rs.close
set rs=nothing
end sub
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -