showvote.asp

来自「功能简介: 1) 首页投票调查系统 2)FLASH导航清新直观(带FLA源文件」· ASP 代码 · 共 60 行

ASP
60
字号
<!--#include file="conn.asp"--><%
vtid=cint(request("vtid"))
itemid=cint(request("itemid"))
Set rs= Server.CreateObject ("ADODB.RecordSet")
if session("voted")=1 then
	sql="update voteitem set item_count=item_count+1 where item_id=" & itemid
	conn.execute sql
end if

%>
<link rel="stylesheet" href="images/css.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<table width="500" height="34" border="1" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="32"><div align="center">投票结果</div></td>
  </tr>
</table>
<table width="500" height="34" border="1" align="center" cellpadding="0" cellspacing="0">
  <tr>
  <% if session("voted") =1 then %>
    <td width="500" height="32"><div align="center">感谢您投了一票</div></td>
  <% else %>
  	<td width="500" height="32"><div align="center">您已经投过票了</div></td>
  <% end if %>
  </tr>
</table>
<table width="500" height="38" border="0" align="center" cellpadding="0" cellspacing="0">
<colgroup>
	<col style="WIDTH:150px;">
	<col style="WIDTH:300px;">
	<col style="WIDTH:50px;">

  </colgroup>
<% sql="select sum(item_count)  as sm from voteitem where vt_id=" & vtid
	rs.open sql,conn,1,3
	sm=rs("sm")
	rs.close
sql="select * from voteitem where vt_id=" & vtid
rs.open sql,conn,1,3
	do while not rs.eof
%>
  <tr>
    <td class=voteotd ><% =rs("item_name") %></td>
    <td > <div style="width:<% =rs("item_count")*100/sm %>%;background-color:gray;height:16px;"><div></td>
    <td ><% =rs("item_count") %>票</td>
  </tr>
<% rs.movenext
loop
rs.close
session("voted")=2
%>
</table>
<div class=closew><a href="javascript:window.close();">关闭窗口</a><div>

<% conn.close %>



⌨️ 快捷键说明

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