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

📄 managebulletin.asp

📁 办公自动化系统 适用于办公室的各种几本功能的操作 功能比较简单
💻 ASP
字号:
<%response.expires=-1%>
<!--#include file="../inc/Secure.asp"-->
<%dim ThisKey
ThisKey = "x"
%>
<!--#include file="../inc/permission.asp"-->
<!--#include file="../inc/connection.asp"-->
<%
LoginID=trim(session("LoginID"))
if LoginID="" then LoginID=0
UserName=GetTableValue ("tblUser","Name","ID",LoginID)
Department = GetTableValue ("tblUser","Department","ID",LoginID)

if trim(request("todo"))="delete" and trim(request("SelectID"))<>"" and isnumeric(trim(request("SelectID"))) then
	Conn.execute "delete tblBulletin where ID="& trim(request("SelectID"))
end if

maxmessage=20
currentpage=request("page")
if currentpage="" then 
currentpage=1
end if

set rs=Server.CreateObject("ADODB.RecordSet")
sql="select ID,ClassID,Title,KeyWords,FromName,Times from tblBulletin where ID>0 Order by ID desc"

rs.pagesize=maxmessage
rs.open sql,Conn,1,1
totalpage=rs.pagecount
totalmessage=rs.recordcount
if totalmessage<>0 then
	rs.AbsolutePage=currentpage
	msgArr=rs.getrows(maxmessage)
end if

rs.close
%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../CSS/main.css">
</HEAD>
<BODY BGCOLOR="#FFFFFF" leftmargin=20 topmargin=5>
<BR>
<div align=center>
<table width="80%" border="0" cellspacing="0" cellpadding="0">
  <tr align="center"> 
	<td width="25%"><a href="index.asp"><img src="../images/zxgg.gif" width="110" height="20" border=0></a></td>
	<td width="25%"><img src="../images/lsgg-2.gif" width="110" height="20" border=0></td>
	<td width="25%"><a href="NewBulletin.asp"><img src="../images/wyqfgg.gif" width="110" height="20" border=0></a></td>
	<td width="25%"><a href="myBulletin.asp"><img src="../images/wfbdgg.gif" width="110" height="20" border=0></a></td>
  </tr>
</table>
</div>
<BR>
<div align=center>
<table border=0 width="90%" cellpadding=0 cellspacing=0><tr><td>
<%
response.write "您接收到的公告 共" & totalmessage & "条/" & totalpage & "页,每页"& maxmessage &"条"
if totalpage>0 then
	response.write ",第" & currentpage & "页 "
end if

if totalpage>1 then
	if currentpage>1 then%>
		<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage-1%>">上页</a>  
		<%
	end if

	if currentpage+1<=totalpage then%>
		<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage+1%>">下页</a>
		<%
	end if
end if
%>
</td></tr></table>
<div align=center>
<table border=0 width="90%" cellspacing="1" cellpadding=3 bgcolor="#005AB5">
<tr bgcolor=#53A9FF>
<td>分类</td>
<td>标题</td>
<td>主题词</td>
<td>发布人</td>
<td>发布时间</td>
<td>操作</td>
</tr>
<%
if isempty(msgArr) then
	response.write "<tr><td colspan=7>暂时没有内容。</td></tr>"
else
for i = 0 to UBound(msgArr,2)
if i mod 2 =0 then
	strColor="#FFFFFF"
else
	strColor="#E6F2FF"
end if
%>
	<tr bgcolor=<%=strColor%>>
		<td nowrap width=50><%=GetTableValue("tblBulletinClass","Name","ID",trim(msgArr(1,i)))%></td>
		<td><a href="Detail.asp?ID=<%=trim(msgArr(0,i))%>"><%=trim(msgArr(2,i))%></a></td>
		<td><a href="Detail.asp?ID=<%=trim(msgArr(0,i))%>"><%=trim(msgArr(3,i))%></a></td>
		<td nowrap width=80><%=trim(msgArr(4,i))%></td>
		<td nowrap width=120><%=trim(msgArr(5,i))%></td>
		<td nowrap><a href="ManageBulletin.asp?todo=delete&selectID=<%=trim(msgArr(0,i))%>" onclick="return CheckDelete();">删除</a></td>
	</tr>
<%
next
end if
%>

</table>
</div>
<BR><BR>
</BODY>
</HTML>
<script language=javascript>
function CheckDelete()
{
//	document.NewsForm.cmdDelete.value !=""
	return confirm("确实删除吗?");
}
</script>
<%
Function GetTableValue(TableName,Field,ValueField,Value)
	if TableName<>"" and Value<>"" then
		Set RsTmp = Server.Createobject("Adodb.recordset")
		strSql = "Select "& Field &" from "& TableName &" where "& ValueField &"='"& Value &"'"
		Rstmp.open strSql,Conn,1,1
		If not Rstmp.eof then
			GetTableValue=trim(Rstmp(Field))
		else
			GetTableValue=""
		end if
		Rstmp.close
		'set RsTmp = Nothing
	else
		GetTableValue=""
	end if
End Function

%>
<!--#include file="../inc/connclose.asp"-->
<script language=javascript>
function CheckDelete()
{
	return confirm("确实删除吗?");
}
</script>

⌨️ 快捷键说明

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