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

📄 voting.asp

📁 企业及其分支机构的内部办公管理系统,包括人事
💻 ASP
字号:
<%@ Language=VBScript %>
<%
'判断用户是否登录
if isempty(Session("ID")) then
Response.Redirect "../login.asp"
end if
'连接系统数据库
set conn = server.createobject ("adodb.connection")
conn.open "ASPData", "sa", "yourpassword"
'开始发布投票
if not IsEmpty(Request.Form("Send")) then
'投票发布的范围
if Request.Form("SendTo") = "All" then
set RSEmails = conn.Execute("select ID, Name, EmailAddress from PSLogins")
set RSVoterNumber = conn.Execute("SELECT COUNT(ID) AS VoterNumber FROM PSLogins ")
elseif Request.Form("SendTo") = "Department" then
set RSEmails = conn.Execute("select ID, Name, EmailAddress from PSLogins where Department = '" _
& Request.Form("DepartmentName") & "'")
set RSVoterNumber = conn.Execute("SELECT COUNT(ID) AS VoterNumber FROM PSLogins " _
& "where Department = '" & Request.Form("DepartmentName") & "'")
else
set RSEmails = conn.Execute("select ID, Name, EmailAddress from PSLogins where Position = '" _
& Request.Form("PositionName") & "'")
set RSVoterNumber = conn.Execute("SELECT COUNT(ID) AS VoterNumber FROM PSLogins " _
& "where Position = '" & Request.Form("PositionName") & "'")
end if
CurrentDateTime = Now()
conn.Execute "Insert Into VotingQuestions (SenderName, Subject, Question, WhenSent, VoterNumber) " _
& "values (" _
& "'" & Session("Name") & "', " _
& "'" & Request.Form("Subject") & "', " _
& "'" & Request.Form("SuggestionText") & "', " _
& "'" & CurrentDateTime & "', " _
& "'" & RSVoterNumber("VoterNumber") & "')"
set RSQuestionID = conn.Execute("select QuestionID from VotingQuestions " _
& "where WhenSent = #" & CurrentDateTime & "#")
do Until RSEmails.eof
'构造电子邮件内容
EmailMessage = Session("Name") & "发起了一轮投票:" & chr(13)
EmailMessage = EmailMessage & "投票的问题题目是:" & Request.Form("Subject") & chr(13)
EmailMessage = EmailMessage & "投票的问题内容是:" & Request.Form("SuggestionText") & chr(13)
EmailMessage = EmailMessage & "要想投票,请点击下面的链接(请注意,如果您已经投过票," _
& "您将无法看到链接): "
EmailMessage = EmailMessage & "http://166.111.56.212/Messageboard/ToVote.asp?"
EmailMessage = EmailMessage & "QuestionID=" & RSQuestionID("QuestionID")
EmailMessage = EmailMessage & "&VoterID=" & RSEmails("ID") & chr(13)
'发送投票通知的电子邮件
set objMail = CreateObject("CDONTS.NewMail")
objMail.Send Session("EmailAddress"),RSEmails("EmailAddress"), _
cstr(Request.Form("Subject")),cstr(EmailMessage)
set objmail = nothing
conn.Execute "insert into VotingVotes (QuestionID, VoterID, VoterName) " _
& "values (" & RSQuestionID("QuestionID") & ", '" & RSEmails("ID") & "', '" & RSEmails("Name") &"')"
RSEmails.MoveNext
loop
TheMessage = "投票信息已发出!"
else
TheMessage = "请在下面填写投票内容"
end if
set RSDepartments = conn.Execute("select * from Departments where DepartmentName <>'All' " _
& "order by DepartmentName")
set PSPositions = conn.Execute("select PositionName from Positions order by PositionID")
%>


<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><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="Communication.asp"><font color="#104DAD">返回上一级网页</font></a></td></tr></table> 

<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr><td height="10" colspan="4" valign="top" bgcolor="#FFFFFF"> 
    <table width="100%" border="0" height="13" cellspacing="0" cellpadding="0" mm_noconvert="TRUE">
    <tr><td height="13"><img src=".././image/banner2.jpg" width="800" height="12"></td></tr></table>
</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>

<FORM ACTION="Voting.asp"  METHOD=POST>
<table width=100% border=1>
<tr height=30>
<td>请选择您发布投票的范围</td><td>
<table width=100% border=1>
<tr>
<td><INPUT TYPE="radio" CHECKED NAME="SendTo" VALUE="All" >全体投票</td>
<td><INPUT TYPE="radio" NAME="SendTo" VALUE="Department" >部门投票</td>
<td><INPUT TYPE="radio" NAME="SendTo" VALUE="Position" >职位投票</td></tr>
<tr><td>&nbsp</td>
<td align=center>
<SELECT NAME="DepartmentName" >
<%
Do Until RSDepartments.EOF
%>	
<OPTION VALUE="<% Response.Write RSDepartments("DepartmentName") %>"><% Response.Write RSDepartments("DepartmentName") %></OPTION>
<%
RSDepartments.Movenext
loop
%>	
</SELECT>
</td>
<td align=center>
<SELECT NAME="PositionName" >
<%
Do Until PSPositions.EOF
%>	
<OPTION VALUE="<% Response.Write PSPositions("PositionName") %>"><% Response.Write PSPositions("PositionName") %></OPTION>
<%
PSPositions.MoveNext
Loop
%>	
</SELECT>
</td></tr></table>


</td></tr>
<td>请选择您要进行投票的标题</td><td><INPUT TYPE="text" NAME="Subject" VALUE="" SIZE=30 MAXLENGTH=30 ></td></tr>
<td>请选择您要进行投票的内容</td><td>
<TEXTAREA NAME="SuggestionText" ROWS=6 COLS=40 ></TEXTAREA
</td></tr>
<tr><td colspan=2 align=center>
<input type=submit name=send value="开始投票" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
</td></tr>
</table>
</form>

</td></tr></table>


</BODY>
</HTML>

⌨️ 快捷键说明

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