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

📄 showvote.asp

📁 一个不错的企业网站
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="INC/config.asp"-->
<!--#include file="mdb/home_mdb.asp"-->
<!--#include file="INC/format.asp"-->
<%
dim itemid,founderr,errmsg,itemname
founderr=false
errmsg=""

if request.querystring("vt_id")="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须指定投票的主题!"
else
  if not isInteger(request.querystring("vt_id")) then
    founderr=true
    errmsg=errmsg+"<br>"+"<li>非法的投票主题的id参数。"
  else
    vtid=cint(request.querystring("vt_id"))
  end if
end if

if founderr then
  call diserror()
  response.end
else
%>
<HTML>
<HEAD>
<title><%=webname%></title>
<META NAME ="keywords" CONTENT="91工作室,小小C">
<META NAME="description" CONTENT="整站,蓝雨整站,修改版,91工作室,免费,全部,论坛,论坛,图片,文章,下载,影音,资源">
<META NAME="robots" CONTENT="all">
<BASE onmouseover="window.status='欢迎您,来自<%=request.servervariables("remote_addr")%>的客人!';return true">
<LINK href="inc/style.css" type=text/css rel=stylesheet>
<SCRIPT LANGUAGE="JavaScript">
<!-- 
//***********默认设置定义.*********************
tPopWait=0;//停留tWait豪秒后显示提示。
tPopShow=5000;//显示tShow豪秒后关闭提示
showPopStep=20;
popOpacity=99;

//***************内部变量定义*****************
sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText {  font-family: <%=fontfamily%>; background-color: #f8f8f3; color:#030303;border: 1px #000000 solid; font-size: <%=fontsize%>; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 3px; padding-bottom: 1px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");
function showPopupText(){
var o=event.srcElement;
	MouseX=event.x;
	MouseY=event.y;
	if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
        if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
	if(o.dypop!=sPop) {
			sPop=o.dypop;
			clearTimeout(curShow);
			clearTimeout(tFadeOut);
			clearTimeout(tFadeIn);
			clearTimeout(tFadeWaiting);	
			if(sPop==null || sPop=="") {
				dypopLayer.innerHTML="";
				dypopLayer.style.filter="Alpha()";
				dypopLayer.filters.Alpha.opacity=0;	
				}
			else {
				if(o.dyclass!=null) popStyle=o.dyclass 
					else popStyle="cPopText";
				curShow=setTimeout("showIt()",tPopWait);
			}
	}
}

function showIt(){
		dypopLayer.className=popStyle;
		dypopLayer.innerHTML=sPop;
		popWidth=dypopLayer.clientWidth;
		popHeight=dypopLayer.clientHeight;
		if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
			else popLeftAdjust=0;
		if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
			else popTopAdjust=0;
		dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
		dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
		dypopLayer.style.filter="Alpha(Opacity=0)";
		fadeOut();
}

function fadeOut(){
	if(dypopLayer.filters.Alpha.opacity<popOpacity) {
		dypopLayer.filters.Alpha.opacity+=showPopStep;
		tFadeOut=setTimeout("fadeOut()",1);
		}
		else {
			dypopLayer.filters.Alpha.opacity=popOpacity;
			tFadeWaiting=setTimeout("fadeIn()",tPopShow);
			}
}

function fadeIn(){
	if(dypopLayer.filters.Alpha.opacity>0) {
		dypopLayer.filters.Alpha.opacity-=1;
		tFadeIn=setTimeout("fadeIn()",1);
		}
}
document.onmouseover=showPopupText;
// -->
</SCRIPT>
</HEAD>
<BODY leftMargin=0 topMargin=10 MARGINHEIGHT="0" MARGINWIDTH="0">
<noscript><iframe src=*.htm></iframe></noscript>
<table width="760" border="0" cellpadding="10" cellspacing="1" bgcolor="#000000" align="center">
  <tr> 
    <td colspan="2" bgcolor="#E8E8E8" align="center" width="100%">
      投票结果</td>
  </tr>
<%
openadmin
sql="select vt_name from votetopic where vt_id="&vtid
set rs=conn.execute(sql)
%>
  <tr> 
    <td colspan="2" align="center" bgcolor="#FFFFFF" width="100%"><%=rs("vt_name")%></td>
  </tr>
  <%sql="select * from voteitem where vt_id="&vtid
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
totalvote=0
rs2.movefirst
do while not rs2.eof
totalvote=totalvote+rs2("item_count")
rs2.movenext
loop
rs2.movefirst
do while not rs2.eof
%>
  <tr bgcolor="#FFFFFF"> 
    <td width="20%" align="center"><%=rs2("item_name")%></td>
    <td width="80%"><img src="img/votebar.gif" width="<%= FormatNumber((rs2("item_count")/totalvote*300),4) %>" height="14" title="<%=rs2("item_count")%>票"></td>
  </tr>
  <%rs2.movenext
loop
if rs2.eof and rs2.bof then%>
  <tr> 
    <td colspan="2" align="center" bgcolor="#FFFFFF" width="706">当前没有投票选项!</td>
  </tr>
  <%end if
rs2.close
set rs2=nothing%>
  <tr> 
    <td height="30" colspan="2" align="center" bgcolor="#FFFFFF" class="chinese" width="706"><%if request.cookies("npw")("voted")<>"yes" then%>您尚未投票!<%else%>您已经投过票了<%end if%>。总计票数<span class="newshead"><%=totalvote%></span>票
    </td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#FFFFFF" class="chinese" align="center" width="706">[<a href="javascript:window.close()">关闭窗口</a>]</td>
  </tr>
</table>
</body></html>
<%
end if
%>

⌨️ 快捷键说明

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