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

📄 votingbooth.asp

📁 企业及其分支机构的内部办公管理系统,包括人事
💻 ASP
字号:
<%@ Language=VBScript %>
<%
if not isempty(Request.QueryString("QuestionID")) and not isempty(Request.QueryString("VoterID")) then
TheMessage="请在下面进行投票"
	set conn = server.createobject ("adodb.connection")
	conn.open "ASPData", "sa", "yourpassword"
	set RSVerify = conn.Execute("Select vote from VotingVotes " _
		& "where QuestionID = " & Request.QueryString("QuestionID") _
		& " and VoterID ='" & Request.QueryString("VoterID") &"'")
	if RSVerify.EOF then
		Response.Redirect "../Login.asp"
	elseif not isnull(RSVerify("Vote")) then
		Response.Redirect "../Login.asp"
	end if				
	set RSQuestion = conn.Execute("Select SenderName, Subject, Question from VotingQuestions " _
		& "where QuestionID = " & Request.QueryString("QuestionID"))
elseif not isempty(Request.Form("Vote")) then
	set conn = server.createobject ("adodb.connection")
	conn.open "ASPData", "sa", "yourpassword"
	set RSQuestion = conn.Execute("Select SenderName, Subject, Question, VoterNumber from VotingQuestions " _
		& "where QuestionID = " & Request.Form("QuestionID"))
	
	conn.Execute "update VotingVotes set Vote = '" & Request.Form("VoteResponse") & "' where QuestionID = " & Request.Form("QuestionID") & " and VoterID = '" & Request.Form("VoterID") &"'"
	Response.write "update VotingVotes set Vote = '" & Request.Form("VoteResponse") & "' where QuestionID = " & Request.Form("QuestionID") & " and VoterID = '" & Request.Form("VoterID") &"'"
	set RSVoteSender=conn.Execute("select SenderName from VotingQuestions where QuestionID="&Request.Form("QuestionID"))
	set RSResultsTo = conn.Execute("select EmailAddress from PSLogins where Name='" & RSVoteSender("SenderName") & "'")
	set RSYesVotes = conn.Execute("SELECT COUNT(VoterID) AS VoteYes FROM VotingVotes " _
		& "WHERE QuestionID = " & Request.Form("QuestionID") & " AND Vote = 'Yes'")
	set RSNoVotes = conn.Execute("SELECT COUNT(VoterID) AS VoteNo FROM VotingVotes " _
		& "WHERE QuestionID = " & Request.Form("QuestionID") & " AND Vote = 'No'")
	HaveVote=RSYesVotes("VoteYes")+RSNoVotes("VoteNO")
	EmailMessage = "您发布的投票现在有了新结果了! 下面是最新的结果: " & chr(13)
	EmailMessage = EmailMessage & "投票ID: " & Request.Form("QuestionID") & chr(13)
	EmailMessage = EmailMessage & "投票问题题目: " & RSQuestion("Subject") & chr(13)
	EmailMessage = EmailMessage & "投票问题内容: " & RSQuestion("Question") & chr(13)
	EmailMessage = EmailMessage & "总共应投票人数: " & RSQuestion("VoterNumber") & chr(13)
	EmailMessage = EmailMessage & "现已投票人数 " & CStr(HaveVote) & chr(13)
	EmailMEssage = EmailMessage & "Yes: " & RSYesVotes("VoteYes") & chr(13)
	EmailMEssage = EmailMessage & "No: " & RSNoVotes("VoteNo") & chr(13)
	
	set objMail = CreateObject("CDONTS.NewMail")
	objMail.Send Session("EmailAddress"), RSResultsTo("EmailAddress"), _
		"最新的投票结果",cstr(EmailMessage)
	set objmail = nothing
                  Response.Redirect "Voting.asp"

else
	Response.Redirect "Voting.asp"
end if
%>


<HTML>
<HEAD>
<TITLE>公司内部意见箱-提交意见建议</TITLE>
<META NAME="Generator" CONTENT="NetObjects Fusion 2.0.2 for Windows">
</HEAD>
<body>

<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr bgcolor=white><td    valign=center ><img src="../ASPLogo3.jpg" width=796 height=100></td></tr>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr><td height="13"><img src=".././image/banner2.jpg" width="800" height="12"></td></tr>
</table>
<br>

<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr><td colspan=3>
<font color=white><P ALIGN="CENTER">公司内部办公信息管理系统->内部信息交流系统->进行投票&nbsp[当前用户-<% response.write Session("Name") %>]
</font></td></tr>
<tr bgcolor=white >
<td  align=left><a href=".././html/home.asp"><font color="#104DAD">返回内网主页</font></a></td>
<td  align=center> <font color="#104DAD" ><% response.write TheMessage %></FONT></td>
<td align=right><a href=javascript:parent.close();><font color="#104DAD">退出投票页面</font></a></td>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr><td height="13"><img src=".././image/banner2.jpg" width="800" height="12"></td></tr></table>
<br>


<TABLE CELLPADDING=1 CELLSPACING=2 BORDER=1 bordercolor="#164DA8" WIDTH=800 align=center>   
<TR VALIGN="center" ALIGN="center">
<TD WIDTH=35% bgcolor=#B5C7EF>
<img src="../image/MessageBoard1.jpg"></td>
<td valign=top>
<table width=100% border=0 bgcolor=#B5C7EF cellspacing=1 cellpadding=2>
<form action="VotingBooth.asp"  method=post>
  
  <INPUT TYPE=HIDDEN NAME="QuestionID" VALUE = "<% response.write Request.QueryString("QuestionID") %>">
  <INPUT TYPE=Hidden NAME="VoterID" VALUE = "<% response.write Request.QueryString("VoterID") %>">
  
  <tr><td colspan=2 height=30 align=center>本次投票详细信息</td></tr>
<tr bgcolor=white><td width=35% height=30>投票问题ID</td><td><% response.write Request.QueryString("QuestionID") %></td></tr>
<tr bgcolor=white><td height=30>举办投票者姓名</td><td><% response.write RSQuestion("SenderName") %></td></tr>
<tr bgcolor=white><td height=30>投票者姓名</td><td><% response.write Request.QueryString("VoterName") %></td></tr>
<tr bgcolor=white><td height=30>投票问题的内容</td><td>
<table bgcolor=black width=100% cellspacing=1 cellpadding=2>
<tr bgcolor=white><td><% response.write RSQuestion("Question") %></td></td></table>
</td></tr>
<tr bgcolor=white><td height=30>投票选项</td><td>
<SELECT NAME="VoteResponse" >
<OPTION VALUE="Yes" SELECTED>&nbsp&nbsp&nbsp Yes &nbsp&nbsp&nbsp</OPTION>
<OPTION VALUE="No">&nbsp&nbsp&nbsp No &nbsp&nbsp&nbsp</OPTION></SELECT>
</td></tr>
<tr bgcolor=white><td colspan=2 align=center>请注意,您只能有一次投票机会。</td></tr>
<tr bgcolor=white><td colspan=2 align=center><INPUT TYPE="submit" NAME="Vote" VALUE="进行投票"  style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB"></td></tr>
</form>
</table>
</td></tr></table>
</body>
</html>

⌨️ 快捷键说明

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