?? suggestionbox.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("Review")) then
SqlReview="select * from SuggestionRecords where SenderName='" & Session("Name") _
& "' and Status='已處理' order by Status"
set RSReviewSuggestion=conn.Execute(SqlReview)
ReviewLabel=true
TheMessage="您所提交的意見目前已經處理的結果如下"
'如果用戶提交新意見建議
elseif not isempty(Request.Form("OK")) then
CurrentTime = Now()
'將新意見建議插入數據庫
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)
'查出剛提交的意見建議的內容
set RSSuggestionID = conn.Execute("select SuggestionID from SuggestionRecords where WhenSent = #" _
& CurrentTime & "#")
'查出要意見建議發往對象的電子郵件地址
set RSEmails = conn.Execute("Select EmailAddress from PSLogins where Department='" _
& Request.Form("ToDepartment") & "' and Position='主管'")
'構造電子郵件的內容
EmailMessage = "意見建議來自: " & Session("Name") & chr(13)
EmailMessage = EmailMessage & "意見類型: " & Request.Form("SuggestionType") & chr(13)
EmailMessage = EmailMessage & "意見內容: " & Request.Form("SuggestionText") & chr(13)
EmailMessage = EmailMessage & "想要處理這條意見建議,請點擊下面的鏈接: " & chr(13)
EmailMessage = EmailMessage & "http://166.111.56.212/"
EmailMessage = EmailMessage & "MessageBoard/Analysis.asp?SuggestionID=" _
& RSSuggestionID("SuggestionID")
'向所有對象發送電子郵件
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 = "請在下面填寫您的建議意見"
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>公司內部意見箱-提交意見建議</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">公司內部辦公信息管理系統->內部信息交流系統->意見建議箱 [當前用戶-<% 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="SuggestionBox.asp" METHOD=POST>
<table width=100% border=1>
<tr height=30>
<td>請選擇您要提意見的部門</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>請選擇您要提意見的類型</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>請選擇您要提意見的內容</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="重設我的意見" 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">您提交的意見建議目前處理結果如下</FONT></font></td></tr>
<tr bgcolor=white >
<td align=left>意見號</td>
<td align=left>發往部門</td>
<td align=left>意見類型</td>
<td width=30% align=left> 意見內容</td>
<td align=left> 發送日期</FONT></td>
<td align=left> 目前狀態</FONT></td>
<td width=20% align=left> 回復意見</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>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -