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

📄 results.htm

📁 javascript source code part2
💻 HTM
字号:
<HTML>
<HEAD>
<TITLE>
Voting Results
</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<h2>Voting Results</h2>

<SERVER>
var voteConn = null; // voting db connection
// get the connection
// name connection for debugging purposes
// set server timeout to 10 seconds

 voteConn = project.appPool.connection("checkVoters",10);

debug
if (voteConn == null)
{
   write('<font color="#ff0000">Error: Unable to connect to database</FONT>');
}

// build the cursor to handle results

var sql = "SELECT votes.voteskey, votes.yesvote,votes.novote FROM votes";
var voterCursor = voteConn.cursor(sql);

if (!voterCursor.next())
{
  write('<h2> No voters found </h2>');
}
else
{
   write('<TABLE BORDER=0>');
   write('<TR><TD>question</TD><TD>yes</TD><TD>no</TD></TR>');

   do 
   {
      write('<TR><TD>' + voterCursor.voteskey + '</TD>');
      write('<TD>' + voterCursor.yesvote + '</TD>');
      write('<TD>' + voterCursor.novote + '</TD></TR>');
   } while (voterCursor.next());

  write('</TABLE>');
}
voterCursor.close();
voteConn.release();
</SERVER>
<HR>
<A HREF="login.htm">Vote!</A>
</BODY>
</HTML>

⌨️ 快捷键说明

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