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

📄 messageboard.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"
Warning=false
'用户选择发送新通知
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 ="您不是系统管理员,也不是此条通知的发送者,无权删除此条通知"
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 ="您不是此条通知的发送者,无权修改此条通知"
Warning=true
end if
else
TheMessage= "日程通知看板 "
end if
'系统管理员清除过期通知
elseif not IsEmpty(Request.Form("ClearMessage")) then
if Session("IsSystemManager") then
conn.Execute "delete from MessageBoard where Date() -MessageSendDate> MessageValidTime"
else
TheMessage="您不是系统管理员,不能进行此项操作"
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>内部信息交流系统</TITLE>
<META NAME="Generator" CONTENT="NetObjects Fusion 2.0.2 for Windows">

</HEAD>


<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> 
<% if Warning=false then %>
<font color="#104DAD" ><% response.write TheMessage %></FONT>
<% else %>
<font color=Red ><% response.write TheMessage %></font>
<% end if %>
</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>

<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="3" cellspacing="0">
<tr><td>

<FORM ACTION="MessageBoard.asp"  METHOD=POST>




 

<br>
        <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></font></td></tr>
        <tr bgcolor=white >
        <td width=30 align=left>选中</td>
        <td width=15% align=left>通知发送日期</td>
        <td width=50% align=left>通知内容</td>
        <td width=10% align=left> 通知类型</FONT></td>
        <td  align=left> 通知发送者</FONT></td>
        <td  align=left> 有效天数</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="#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 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>通知发送日期</td>
        <td width=50% align=left>通知内容</td>
        <td width=10% align=left> 通知类型</FONT></td>
        <td  align=left> 通知发送者</FONT></td>
        <td  align=left> 有效天数</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="#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 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>通知发送日期</td>
        <td width=50% align=left>通知内容</td>
        <td width=10%  align=left> 通知接收者</FONT></td>
        <td  align=left> 通知发送者</FONT></td>
        <td  align=left> 有效天数</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="#164DA8" 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=#164DA8 cellspacing=1 cellpadding=2 align=center> 
        <TR  bgcolor=white VALIGN="top" ALIGN="center">
       
        <td ><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="发送新通知"  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">
        </td>
        </tr>    

<br>        


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

 </FORM>

 </BODY>
</HTML>

⌨️ 快捷键说明

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