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

📄 messageboard.asp

📁 企业内部办公管理信息系统 (一个用ASP开发的基于B/S方式的毕业设计)
💻 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 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>公司内部办公信息管理系统</strong></font></div></td>
  </tr>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="13">&nbsp;</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">公司内部办公信息管理系统->内部信息交流->通知公告牌&nbsp[当前用户- 
        <% response.write Session("Name") %>
        ] </font></font></td>
  </tr>
  <tr bgcolor=white > 
    <td><font size="2"><a href=".././html/home.asp"><font color="#104DAD">返回内网主页</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">返回上一级网页</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">&nbsp;</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">通知发送日期</font></td>
      <td width=50% align=left><font size="2">通知内容</font></td>
      <td width=10% align=left><font size="2"> 通知类型</FONT></font></td>
      <td  align=left><font size="2"> 通知发送者</FONT></font></td>
      <td  align=left><font size="2"> 有效天数</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">&nbsp;</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">通知发送日期</font></td>
      <td width=50% align=left><font size="2">通知内容</font></td>
      <td width=10% align=left><font size="2"> 通知类型</FONT></font></td>
      <td  align=left><font size="2"> 通知发送者</FONT></font></td>
      <td  align=left><font size="2"> 有效天数</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">&nbsp;</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">通知发送日期</font></td>
      <td width=50% align=left><font size="2">通知内容</font></td>
      <td width=10%  align=left><font size="2"> 通知接收者</FONT></font></td>
      <td  align=left><font size="2"> 通知发送者</FONT></font></td>
      <td  align=left><font size="2"> 有效天数</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">&nbsp;</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="发送新通知"  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>

⌨️ 快捷键说明

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