?? messageboard.asp
字號:
<%@ Language=VBScript %>
<%
'判斷用戶是否登錄
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", "yourpassword"
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)行此項操作"
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 RSRoles = conn.Execute("select Name from PSLogins 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 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>
<font size="2"><br>
</font>
<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)部信息交流->通知公告牌 [當(dāng)前用戶-
<% response.write Session("Name") %>
] </font></font></td>
</tr>
<tr bgcolor=white >
<td><font size="2"><a href=".././html/home.asp"><font color="#104DAD">返回內(nèi)網(wǎng)主頁</font></a></font></td>
<td align=center> <font size="2">
<% if Warning=false then %>
<font color="#104DAD" >
<% response.write TheMessage %>
</FONT></font> <font size="2">
<% else %>
<font color=Red >
<% response.write TheMessage %>
</font></font> <font size="2">
<% end if %>
</font></td>
<td align=right><font size="2"><a href="Communication.asp"><font color="#104DAD">返回上一級網(wǎng)頁</font></a></font></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>
<font size="2"><table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="3" cellspacing="0"> <tr><td>
</font>
<FORM ACTION="MessageBoard.asp" METHOD=POST>
<font size="2"><br>
</font>
<table WIDTH=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr>
<td colspan=3 height=1 ><font color=white>
<P ALIGN="left"><font size="2">今日您有如下公共通知</font></FONT><font size="2"></font></font></td>
</tr>
<tr bgcolor=white >
<td width=30 align=left><font size="2">選中</font></td>
<td width=15% align=left><font size="2">通知發(fā)送日期</font></td>
<td width=50% align=left><font size="2">通知內(nèi)容</font></td>
<td width=10% align=left><font size="2"> 通知類型</FONT></font></td>
<td align=left><font size="2"> 通知發(fā)送者</FONT></font></td>
<td align=left><font size="2"> 有效天數(shù)</FONT></font></td>
</tr>
<%
Do Until RSPublicMessage.EOF
%>
<TR bgcolor=white VALIGN="top" ALIGN="left">
<td align=left><font size="2">
<input type=radio name=CheckMessage value=<% response.write RSPublicMessage("MessageID")%> >
</font></td>
<TD ><font size="2" face=arial>
<% Response.write RSPublicMessage("MessageSendDate") %>
</font></TD>
<TD ><font size="2" face=arial>
<% Response.write RSPublicMessage("MessageContent") %>
</font></TD>
<TD HEIGHT=21><font size="2" face=arial>
<% Response.write RSPublicMessage("MessageType") %>
</font></TD>
<TD HEIGHT=21><font size="2" face=arial>
<% Response.write RSPublicMessage("MessageSender") %>
</font></TD>
<TD HEIGHT=21><font size="2" face=arial>
<% Response.write RSPublicMessage("MessageValidTime") %>
</font></TD>
</TR>
<%
RSPublicMessage.MoveNext
Loop
%>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="13"> </td>
</tr>
</table>
<font size="2"><br>
</font>
<table WIDTH=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr>
<td colspan=3 height=1 ><font color=white>
<P ALIGN="left"><font size="2">今日
<% response.write Session("Department") %>
有如下部門通知</font></FONT><font size="2"></font></font></td>
</tr>
<tr bgcolor=white >
<td width=30 align=left><font size="2">選中</font></td>
<td width=15% align=left><font size="2">通知發(fā)送日期</font></td>
<td width=50% align=left><font size="2">通知內(nèi)容</font></td>
<td width=10% align=left><font size="2"> 通知類型</FONT></font></td>
<td align=left><font size="2"> 通知發(fā)送者</FONT></font></td>
<td align=left><font size="2"> 有效天數(shù)</FONT></font></td>
</tr>
<%
Do Until RSDepartmentMessage.EOF
%>
<TR bgcolor=white VALIGN="top" ALIGN="left">
<td align=left><font size="2">
<input type=radio name=CheckMessage value=<% response.write RSDepartmentMessage("MessageID")%> >
</font></td>
<TD ><font size="2" face=arial>
<% Response.write RSDepartmentMessage("MessageSendDate") %>
</font></TD>
<TD ><font size="2" face=arial>
<% Response.write RSDepartmentMessage("MessageContent") %>
</font></TD>
<TD HEIGHT=21><font size="2" face=arial>
<% Response.write RSDepartmentMessage("MessageType") %>
</font></TD>
<TD HEIGHT=21><font size="2" face=arial>
<% Response.write RSDepartmentMessage("MessageSender") %>
</font></TD>
<TD HEIGHT=21><font size="2" face=arial>
<% Response.write RSDepartmentMessage("MessageValidTime") %>
</font></TD>
</TR>
<%
RSDepartmentMessage.MoveNext
Loop
%>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="13"> </td>
</tr>
</table>
<font size="2"><br>
</font>
<table WIDTH=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr>
<td colspan=3 height=1 ><font color=white>
<P ALIGN="left"><font size="2">今日您有如下個人通知</font></FONT><font size="2"></font></font></td>
</tr>
<tr bgcolor=white >
<td width=30 align=left><font size="2">選中</font></td>
<td width=15% align=left><font size="2">通知發(fā)送日期</font></td>
<td width=50% align=left><font size="2">通知內(nèi)容</font></td>
<td width=10% align=left><font size="2"> 通知接收者</FONT></font></td>
<td align=left><font size="2"> 通知發(fā)送者</FONT></font></td>
<td align=left><font size="2"> 有效天數(shù)</FONT></font></td>
</tr>
<%
Do Until RSPrivateMessage.EOF
%>
<TR bgcolor=white VALIGN="top" ALIGN="left">
<td align=left><font size="2">
<input type=radio name=CheckMessage value=<% response.write RSPrivateMessage("MessageID")%> >
</font></td>
<TD ><font size="2" face=arial>
<% Response.write RSPrivateMessage("MessageSendDate") %>
</font></TD>
<TD ><font size="2" face=arial>
<% Response.write RSPrivateMessage("MessageContent") %>
</font></TD>
<TD HEIGHT=21><font size="2" face=arial>
<% Response.write RSPrivateMessage("MessageType") %>
</font></TD>
<TD HEIGHT=21><font size="2" face=arial>
<% Response.write RSPrivateMessage("MessageSender") %>
</font></TD>
<TD HEIGHT=21><font size="2" face=arial>
<% Response.write RSPrivateMessage("MessageValidTime") %>
</font></TD>
</TR>
<%
RSPrivateMessage.MoveNext
Loop
%>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="13"> </td>
</tr>
</table>
<table WIDTH=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<TR bgcolor=white VALIGN="top" ALIGN="center">
<td ><font size="2">
<input type=submit name="ModifyThisMessage" value="修改此條通知" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
<input type=submit name="DeleteThisMessage" value="刪除此條通知" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
<INPUT TYPE="submit" NAME="SendNewMessage" VALUE="發(fā)送新通知" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
<INPUT TYPE="submit" NAME="ClearMessage" VALUE="管理員清空過期通知" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
</font></td>
</tr>
<br>
<font size="2"></td></font> <font size="2"></tr></font>
</table>
</FORM>
<font size="2"></BODY></font> </HTML>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -