?? suggestionbox.asp
字號(hào):
<%@ Language=VBScript %>
<%
'判斷用戶是否登錄
if isempty(Session("ID")) then
Response.Redirect "../login.asp"
end if
'連接系統(tǒng)數(shù)據(jù)庫(kù)
set conn = server.createobject ("adodb.connection")
conn.open "ASPData", "sa", "yourpassword"
'如果用戶要查看自己提出的意見的處理結(jié)果
if not isempty(Request.Form("Review")) then
SqlReview="select * from SuggestionRecords where SenderName='" & Session("Name") _
& "' and Status='已處理' order by Status"
set RSReviewSuggestion=conn.Execute(SqlReview)
ReviewLabel=true
TheMessage="您所提交的意見目前已經(jīng)處理的結(jié)果如下"
'如果用戶提交新意見建議
elseif not isempty(Request.Form("OK")) then
CurrentTime = Now()
'將新意見建議插入數(shù)據(jù)庫(kù)
SqlString="Insert into SuggestionRecords (SenderName, ToDepartment, " _
& "SuggestionType, SuggestionText, WhenSent, Status) values (" _
& "'" & Session("Name") & "', " _
& "'" & Request.Form("ToDepartment") & "', " _
& "'" & Request.Form("SuggestionType") & "', " _
& "'" & Request.Form("SuggestionText") & "', " _
& "'" & CurrentTime & "', " _
& "'未處理')"
conn.Execute(SqlString)
'查出剛提交的意見建議的內(nèi)容
set RSSuggestionID = conn.Execute("select SuggestionID from SuggestionRecords where WhenSent = #" _
& CurrentTime & "#")
'查出要意見建議發(fā)往對(duì)象的電子郵件地址
set RSEmails = conn.Execute("Select EmailAddress from PSLogins where Department='" _
& Request.Form("ToDepartment") & "' and Position='主管'")
'構(gòu)造電子郵件的內(nèi)容
EmailMessage = "意見建議來自: " & Session("Name") & chr(13)
EmailMessage = EmailMessage & "意見類型: " & Request.Form("SuggestionType") & chr(13)
EmailMessage = EmailMessage & "意見內(nèi)容: " & Request.Form("SuggestionText") & chr(13)
EmailMessage = EmailMessage & "想要處理這條意見建議,請(qǐng)點(diǎn)擊下面的鏈接: " & chr(13)
EmailMessage = EmailMessage & "http://127.0.0.1"
EmailMessage = EmailMessage & "MessageBoard/Analysis.asp?SuggestionID=" _
& RSSuggestionID("SuggestionID")
'向所有對(duì)象發(fā)送電子郵件
Do Until RSEmails.EOF
set objMail = CreateObject("CDONTS.NewMail")
objMail.Send Session("EmailAddress"),RSEmails("EmailAddress"), _
"New Suggestion Box Message!",EmailMessage
set objmail = nothing
RSEmails.MoveNext
loop
TheMessage = "您的意見建議已提交成功,您可以填寫新意見建議"
else
TheMessage = "請(qǐng)?jiān)谙旅嫣顚懩慕ㄗh意見"
end if
set RSDepartments = conn.Execute("select * from Departments where DepartmentName <>'All' " _
& "order by DepartmentName")
set RSTypes = conn.Execute("select * from SuggestionTypes order by SuggestionType")
%>
<HTML>
<HEAD>
<TITLE>公司內(nèi)部意見箱-提交意見建議</TITLE>
<META NAME="Generator" CONTENT="NetObjects Fusion 2.0.2 for Windows">
</HEAD>
<body>
<table width=800 border=0 align=center cellpadding=2 cellspacing=1 bordercolor="#996633" bgcolor=#164DA8>
<tr bgcolor=white>
<td valign=center bgcolor="#0066CC" >
<div align="center"><font color="#CCCCCC" size="+7" face="華文隸書"><strong>公司內(nèi)部辦公信息管理系統(tǒng)</strong></font></div></td>
</tr>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="13"> </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"><font size="2">公司內(nèi)部辦公信息管理系統(tǒng)->內(nèi)部信息交流系統(tǒng)->意見建議箱 [當(dāng)前用戶-
<% response.write Session("Name") %>
] </font></font></td>
</tr>
<tr bgcolor=white >
<td><a href=".././html/home.asp"><font color="#104DAD" size="2">返回內(nèi)網(wǎng)主頁(yè)</font></a></td>
<td align=center> <font color="#104DAD" size="2" >
<% response.write TheMessage %>
</FONT></td>
<td align=right><a href="Communication.asp"><font color="#104DAD" size="2">返回上一級(jí)網(wǎng)頁(yè)</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"> </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="SuggestionBox.asp" METHOD=POST>
<table width=100% border=1>
<tr height=30>
<td>請(qǐng)選擇您要提意見的部門</td><td>
<SELECT NAME="ToDepartment" >
<%
Do Until RSDepartments.EOF
%>
<OPTION VALUE="<% Response.Write RSDepartments("DepartmentName") %>"><% Response.Write RSDepartments("DepartmentName") %></OPTION>
<%
RSDepartments.MoveNext
Loop
%>
</td></tr>
<td>請(qǐng)選擇您要提意見的類型</td><td>
<SELECT NAME="SuggestionType" >
<%
Do Until RSTypes.EOF
%>
<OPTION VALUE="<% Response.Write RSTypes("SuggestionType") %>"><% Response.Write RSTypes("SuggestionType") %></OPTION>
<%
RSTypes.MoveNext
Loop
%>
</SELECT>
</td></tr>
<td>請(qǐng)選擇您要提意見的內(nèi)容</td><td>
<TEXTAREA NAME="SuggestionText" ROWS=6 COLS=40 ></TEXTAREA
></td></tr>
<tr><td colspan=2 align=center>
<input type=submit name=OK value="提交我的意見" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
<input type=reset name=reset value="重設(shè)我的意見" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
<input type=submit name=review value="查看我的意見" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
</td></tr>
</table>
</form>
</td></tr></table>
<% if ReviewLabel=true then %>
<table WIDTH=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr><td colspan=6 height=1 ><font color=white><P ALIGN="left">您提交的意見建議目前處理結(jié)果如下</FONT></font></td></tr>
<tr bgcolor=white >
<td align=left>意見號(hào)</td>
<td align=left>發(fā)往部門</td>
<td align=left>意見類型</td>
<td width=30% align=left> 意見內(nèi)容</td>
<td align=left> 發(fā)送日期</FONT></td>
<td align=left> 目前狀態(tài)</FONT></td>
<td width=20% align=left> 回復(fù)意見</FONT></td>
</tr>
<%
Do Until RSReviewSuggestion.EOF
%>
<TR bgcolor=white VALIGN="top" ALIGN="left">
<TD ><font face=arial><% Response.write RSReviewSuggestion("SuggestionID") %></font></TD>
<TD ><font face=arial><% Response.write RSReviewSuggestion("ToDepartment") %></font></TD>
<TD ><font face=arial><% Response.write RSReviewSuggestion("SuggestionType") %></font></TD>
<TD ><font face=arial><% Response.write RSReviewSuggestion("SuggestionText") %></font></TD>
<TD ><font face=arial><% Response.write RSReviewSuggestion("WhenSent") %></font></TD>
<TD ><font face=arial><% Response.write RSReviewSuggestion("Status") %></font></TD>
<TD ><font face=arial><% Response.write RSReviewSuggestion("Comments") %></font></TD>
</TR>
<%
RSReviewSuggestion.MoveNext
Loop
%>
</table>
<% end if %>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -