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

📄 view.asp

📁 网吧游戏比赛投票系统,可以进行一些游戏比赛的投票统计.
💻 ASP
字号:
<html>
<head>
<title>枫叶网吧投票系统</title>
<link href="css.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
<!--
// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

//-->
</script>
</head>
<body>
<!-- #include file="conn.asp"-->
<%
  action=request.querystring("action")
  select case action
  case "addpl" '添加评论
  usname=trim(request.form("usname"))
  email=trim(request.form("email"))
  content=request.form("content")
  idd=trim(request.form("idd"))
  ip=request.servervariables("http_x_forwarded_fox")
  if ip="" then
  ip=request.servervariables("remote_addr")
  end if
  if usname="" or content="" or idd="" then
  response.write "<script>alert('对不起,必要的信息您没有填写');history.back();</script>"
  response.end
  end if
  conn.execute("insert into V_gbook (lid,V_user,V_email,V_content,V_ip) values ("&idd&",'"&usname&"','"&email&"','"&content&"','"&ip&"')")
  response.write "<script>alert('添加评论成功!');window.close();</script>"
  response.end
  end select
  %>
<table border="0" width="468" cellpadding="4" cellspacing="0" bordercolordark="#f7f7f7" bordercolorlight="#cccccc" class="inputt">
<%
on error resume next
dim id,rs,rs1,rs2
id=request.querystring("id")
set rs=server.createobject("adodb.recordset")
rs.open "select title from V_title where id=cint('"&id&"')",conn,1,1
if not rs.eof then
set rs2=server.createobject("adodb.recordset")
rs2.open "select sum(vcount) as asum from V_vote where lid=cint('"&id&"')",conn,1,1
if not rs2.eof then
%>
<tr>
<td height="30" colspan="4" align="center"><font color="#0066CC" size="3"><b><%=rs("title")%></b></font><br><br>目前共有<font color="#ff0000"><%=rs2("asum")%></font>人参予了投票</td>
</tr>

<%
set rs1=server.createobject("adodb.recordset")
rs1.open "select * from V_vote where lid=cint('"&id&"')",conn,1,1
if not rs1.eof then
do while not rs1.eof
%>
<tr>
<td>
<%=rs1("cont")%>
</td>
<td>
<img src="vb1.gif" border="0" height="10" width="<%=(rs1("vcount")/rs2("asum"))*50%>">
</td>
<td>
<font color="#A2A2A2"><%=rs1("vcount")%>票</font>
</td>
<td>
<font color="#A2A2A2"><%
dim disbf
disbf=formatnumber((rs1("vcount")/rs2("asum"))*100,2)
if disbf<0 then
response.write "0.00"
else
response.write disbf
end if%>%</font>
</td>
</tr>
<%
rs1.movenext
loop
end if
rs1.close
%>
<tr bgcolor="#efefef" OnMouseUp="with(findObj('viewpl'))if (style.display=='none') {style.display=''}else{style.display='none'}">
  <td colspan="4"><font color="#FF0000"><strong>点击←这里留言</strong></font></td>
</tr>

<tr>
  <td height="30" colspan="4">
  <%
  set pl=conn.execute("select V_user,V_email,V_content,V_time from V_gbook where lid="&id&"")
  if not pl.eof then
  do while not pl.eof
  %>
  <table width="100%" border="0" align="center" class="inputt">
    <tr>
      <td width="30%"><strong>昵称:</strong><%=server.htmlencode(pl("v_user"))%></td>
      <td><strong>E-mail:</strong><%=server.htmlencode(pl("v_email"))%></td>
    </tr>
    <tr>
      <td colspan="2"><%=pl("V_content")%></td>
    </tr>
  </table>
  <%
  pl.movenext
  loop
  end if
  pl.close
%>  </td>
</tr>
<tr id="viewpl" style="display:none">
  <td height="30" colspan="4">
  
  <table width="100%" align="left" class="inputt">
  <form method="post" action="?action=addpl" name="form1">
    <tr>
      <td><strong>昵称:</strong>        <input name="usname" type="text" class="inputt" id="usname" size="10" maxlength="20"> 
        <strong>E-mail:</strong>        <input name="email" type="text" class="inputt" id="email" size="15" maxlength="50"><a name="write"></a></td>
    </tr>
    <tr>
      <td valign="top"><strong>内容:</strong>        <textarea name="content" cols="40" rows="3" wrap="VIRTUAL" class="inputt" id="content"></textarea>
        <input name="idd" type="hidden" id="idd" value="<%=id%>"> 
        <input name="Submit" type="submit" class="inputt" value="俺写完啦!"></td>
    </tr>
  </form>
  </table></td>
</tr>
<tr>
<td bgcolor="#f7f7f7" colspan="4" align="center"><strong><a href="http://www.8r888.com" target="_blank">Copyright &copy; 
2007-2008 本网吧所权所有 All rights reserved.</a></strong></td>
</tr>
</table>
<%
rs2.close
end if
%>
<%
end if
rs.close
conn.close
set conn=nothing
%><br>
</body>
</html>

⌨️ 快捷键说明

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