?? messageboard.asp
字號(hào):
<%@ Language=VBScript %>
<!--#include file="../conn.asp"-->
<%
'判斷用戶是否登錄
if isempty(Session("ID")) then
Response.Redirect "../login.asp"
end if
'連接系統(tǒng)數(shù)據(jù)庫
'set conn = server.createobject ("adodb.connection")
'conn.open "ASPData", "sa", ""
Warning=false
'用戶選擇發(fā)送新通知
if not IsEmpty(Request.Form("SendNewMessage")) then
Response.Redirect "SendNewMessage.asp"
'用戶選擇刪除某條通知
elseif not IsEmpty(Request.Form("DeleteThisMessage")) then
if not IsEmpty(Request.Form("CheckMessage")) then
set RSThisMessage=conn.Execute("select * from MessageBoard where MessageID=" _
& Request.Form("CheckMessage"))
if Session("IsSystemManager") then
conn.Execute "delete from MessageBoard where MessageID = " & Request.Form("CheckMessage")
TheMessage ="此條通知已刪除"
elseif RSThisMessage("MessageSender") = Session("Name") then
conn.Execute "delete from MessageBoard where MessageID = '" _
& Request.Form("CheckMessage") & "' "
TheMessage ="此條通知已刪除"
elseif RSThisMessage("MessageType")=Session("Name") then
conn.Execute "delete from MessageBoard where MessageID = '" _
& Request.Form("CheckMessage") & "' "
TheMessage ="此條通知已刪除"
else
TheMessage ="您不是系統(tǒng)管理員,也不是此條通知的發(fā)送者,無權(quán)刪除此條通知"
Warning=true
end if
else
TheMessage= "日程通知看板 "
end if
'用戶選擇修改某條通知
elseif not IsEmpty(Request.Form("ModifyThisMessage")) then
if not IsEmpty(Request.Form("CheckMessage")) then
set RSThisMessage=conn.Execute("select * from MessageBoard where MessageID=" _
& Request.Form("CheckMessage"))
if RSThisMessage("MessageSender")=Session("Name") then
Session("MessageID")=RSThisMessage("MessageID")
Response.Redirect "ModifyMessage.asp"
else
TheMessage ="您不是此條通知的發(fā)送者,無權(quán)修改此條通知"
Warning=true
end if
else
TheMessage= "日程通知看板 "
end if
'系統(tǒng)管理員清除過期通知
elseif not IsEmpty(Request.Form("ClearMessage")) then
if Session("IsSystemManager") then
conn.Execute "delete from MessageBoard where Date() -MessageSendDate> MessageValidTime"
else
TheMessage="您不是系統(tǒng)管理員,不能進(jìn)行此項(xiàng)操作"
Warning=true
end if
else
TheMessage = "日程通知看板"
end if
'
'set RSPublicMessage= conn.Execute(" select * from MessageBoard where MessageType = '公共通知' " _
'& " and Date()-MessageSendDate <= MessageValidTime")
'set RSDepartmentMessage= conn.Execute(" select * from MessageBoard where MessageType = '" _
'& Session("Department") &"' and " & "Date()-MessageSendDate<= MessageValidTime")
'set RSPrivateMessage= conn.Execute(" select * from MessageBoard where MessageType= '" _
'& Session("Name") &"' and " & "Date()-MessageSendDate<= MessageValidTime")
'set RSDepartments = conn.Execute("select DepartmentName from Departments " _
'& "order by DepartmentName")
set RSPublicMessage= conn.Execute(" select * from MessageBoard where MessageType = '公共通知' " _
& "")
set RSDepartmentMessage= conn.Execute(" select * from MessageBoard where MessageType = '" _
& Session("Department") &"'")
set RSPrivateMessage= conn.Execute(" select * from MessageBoard where MessageType= '" _
& Session("Name") &"'")
set RSDepartments = conn.Execute("select DepartmentName from Departments " _
& "order by DepartmentName")
'
set RSRoles = conn.Execute("select Name from UserInfo order by Name")
%>
<HTML>
<HEAD>
<TITLE>內(nèi)部信息交流系統(tǒng)</TITLE>
<META NAME="Generator" CONTENT="NetObjects Fusion 2.0.2 for Windows">
</HEAD>
<table width=800 border=0 bgcolor=#16A84D 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="#16A84D" 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=#16A84D cellspacing=1 cellpadding=2 align=center>
<tr><td colspan=3>
<font color=white>
<P ALIGN="CENTER">公司內(nèi)部辦公信息管理系統(tǒng)->內(nèi)部信息交流->通知公告牌 [當(dāng)前用戶-<% response.write Session("Name") %>]
</font></td></tr>
<tr bgcolor=white >
<td><a href=".././html/home.asp"><font color="#10AD4D">返回內(nèi)網(wǎng)主頁</font></a></td>
<td align=center>
<% if Warning=false then %>
<font color="#10AD4D" ><% response.write TheMessage %></FONT>
<% else %>
<font color=Red ><% response.write TheMessage %></font>
<% end if %>
</td>
<td align=right><a href="Communication.asp"><font color="#10AD4D">返回上一級(jí)網(wǎng)頁</font></a></td>
</tr>
</table>
<table width="800" border="0" bordercolor="#16A84D" 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>
<table width="800" border="0" bordercolor="#16A84D" align="center" cellpadding="3" cellspacing="0">
<Form ACTION="MessageBoard.asp" METHOD=POST>
<br>
<table WIDTH=800 border=0 bgcolor=#16A84D cellspacing=1 cellpadding=2 align=center>
<tr><td colspan=3 height=1 ><font color=white><P ALIGN="left">今日您有如下公共通知</FONT></font></td></tr>
<tr bgcolor=white >
<td width=30 align=left>選中</td>
<td width=15% align=left>通知發(fā)送日期</td>
<td width=50% align=left>通知內(nèi)容</td>
<td width=10% align=left> 通知類型</FONT></td>
<td align=left> 通知發(fā)送者</FONT></td>
<td align=left> 有效天數(shù)</FONT></td>
</tr>
<%
Do Until RSPublicMessage.EOF
%>
<TR bgcolor=white VALIGN="top" ALIGN="left">
<td align=left><input type=radio name=CheckMessage value=<% response.write RSPublicMessage("MessageID")%> ></td>
<TD ><font face=arial><% Response.write RSPublicMessage("MessageSendDate") %></font></TD>
<TD ><font face=arial><% Response.write RSPublicMessage("MessageContent") %></font></TD>
<TD HEIGHT=21><font face=arial><% Response.write RSPublicMessage("MessageType") %></font></TD>
<TD HEIGHT=21><font face=arial><% Response.write RSPublicMessage("MessageSender") %></font></TD>
<TD HEIGHT=21><font face=arial><% Response.write RSPublicMessage("MessageValidTime") %></font></TD>
</TR>
<%
RSPublicMessage.MoveNext
Loop
%>
</table>
<table width="800" border="0" bordercolor="#16A84D" 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=#16A84D cellspacing=1 cellpadding=2 align=center>
<tr><td colspan=3 height=1 ><font color=white><P ALIGN="left">今日<% response.write Session("Department") %>有如下部門通知</FONT></font></td></tr>
<tr bgcolor=white >
<td width=30 align=left>選中</td>
<td width=15% align=left>通知發(fā)送日期</td>
<td width=50% align=left>通知內(nèi)容</td>
<td width=10% align=left> 通知類型</FONT></td>
<td align=left> 通知發(fā)送者</FONT></td>
<td align=left> 有效天數(shù)</FONT></td>
</tr>
<%
Do Until RSDepartmentMessage.EOF
%>
<TR bgcolor=white VALIGN="top" ALIGN="left">
<td align=left><input type=radio name=CheckMessage value=<% response.write RSDepartmentMessage("MessageID")%> ></td>
<TD ><font face=arial><% Response.write RSDepartmentMessage("MessageSendDate") %></font></TD>
<TD ><font face=arial><% Response.write RSDepartmentMessage("MessageContent") %></font></TD>
<TD HEIGHT=21><font face=arial><% Response.write RSDepartmentMessage("MessageType") %></font></TD>
<TD HEIGHT=21><font face=arial><% Response.write RSDepartmentMessage("MessageSender") %></font></TD>
<TD HEIGHT=21><font face=arial><% Response.write RSDepartmentMessage("MessageValidTime") %></font></TD>
</TR>
<%
RSDepartmentMessage.MoveNext
Loop
%>
</table>
<table width="800" border="0" bordercolor="#16A84D" 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=#16A84D cellspacing=1 cellpadding=2 align=center>
<tr><td colspan=3 height=1 ><font color=white><P ALIGN="left">今日您有如下個(gè)人通知</FONT></font></td></tr>
<tr bgcolor=white >
<td width=30 align=left>選中</td>
<td width=15% align=left>通知發(fā)送日期</td>
<td width=50% align=left>通知內(nèi)容</td>
<td align=left> 通知發(fā)送者</FONT></td>
<td align=left> 有效天數(shù)</FONT></td>
</tr>
<%
Do Until RSPrivateMessage.EOF
%>
<TR bgcolor=white VALIGN="top" ALIGN="left">
<td align=left><input type=radio name=CheckMessage value=<% response.write RSPrivateMessage("MessageID")%> ></td>
<TD ><font face=arial><% Response.write RSPrivateMessage("MessageSendDate") %></font></TD>
<TD ><font face=arial><% Response.write RSPrivateMessage("MessageContent") %></font></TD>
<TD HEIGHT=21><font face=arial><% Response.write RSPrivateMessage("MessageType") %></font></TD>
<TD HEIGHT=21><font face=arial><% Response.write RSPrivateMessage("MessageSender") %></font></TD>
<TD HEIGHT=21><font face=arial><% Response.write RSPrivateMessage("MessageValidTime") %></font></TD>
</TR>
<%
RSPrivateMessage.MoveNext
Loop
%>
</table>
<table width="800" border="0" bordercolor="#16A84D" align="center" cellpadding="0" cellspacing="0">
<tr><td height="13"><img src=".././image/banner2.jpg" width="800" height="12"></td></tr>
</table>
<table WIDTH=800 border=0 bgcolor=#16A84D cellspacing=1 cellpadding=2 align=center>
<TR bgcolor=white VALIGN="top" ALIGN="center">
<td ><input type=submit name="ModifyThisMessage" value="修改此條通知" style="border: 1px solid #34BB66; background-color: #B6EBCA; color: #34BB66">
<input type=submit name="DeleteThisMessage" value="刪除此條通知" style="border: 1px solid #34BB66; background-color: #B6EBCA; color: #34BB66">
<INPUT TYPE="submit" NAME="SendNewMessage" VALUE="發(fā)送新通知" style="border: 1px solid #34BB66; background-color: #B6EBCA; color: #34BB66">
<INPUT TYPE="submit" NAME="ClearMessage" VALUE="管理員清空過期通知" style="border: 1px solid #34BB66; background-color: #B6EBCA; color: #34BB66">
</td>
</tr>
<br>
</td>
</tr>
</table>
</Form>
</BODY>
</HTML>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -