📄 admin_msgmanage.asp
字号:
<!-- #include file="setup.asp" -->
<!-- #include file="CheckAdmin.asp" -->
<!--#include file="../WoLib/Function.asp"-->
<%
if RequestCookies("Userpass")="" or RequestCookies("Userpass")<>session("pass") then Response.Write ("<script>top.location.href='login.asp';</script>")
if UserRoleID <> 1 then Alert("您没有权限进入后台")
sub showpage(sfilename,totalnumber,maxperpage,ShowTotal,ShowAllPages,strUnit)
dim n, i,strTemp,strUrl
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
strTemp= "<table align='center' class='font_3'><tr><td>"
if ShowTotal=true then
strTemp=strTemp & "共 <b>" & totalnumber & "</b> " & strUnit & " "
end if
strUrl=JoinChar(sfilename)
if CurrentPage<2 then
strTemp=strTemp & "首页 上一页 "
else
strTemp=strTemp & "<a href='" & strUrl & "page=1'>首页</a> "
strTemp=strTemp & "<a href='" & strUrl & "page=" & (CurrentPage-1) & "'>上一页</a> "
end if
if n-currentpage<1 then
strTemp=strTemp & "下一页 尾页"
else
strTemp=strTemp & "<a href='" & strUrl & "page=" & (CurrentPage+1) & "'>下一页</a> "
strTemp=strTemp & "<a href='" & strUrl & "page=" & n & "'>尾页</a>"
end if
strTemp=strTemp & " 页次:<strong><font color=red>" & CurrentPage & "</font>/" & n & "</strong>页 "
strTemp=strTemp & " <b>" & maxperpage & "</b>" & strUnit & "/页"
if ShowAllPages=True then
strTemp=strTemp & " 转到:<select class='input' name='page' size='1' onchange=""javascript:window.location='" & strUrl & "page=" & "'+this.options[this.selectedIndex].value;"">"
for i = 1 to n
strTemp=strTemp & "<option value='" & i & "'"
if cint(CurrentPage)=cint(i) then strTemp=strTemp & " selected "
strTemp=strTemp & ">第" & i & "页</option>"
next
strTemp=strTemp & "</select>"
end if
strTemp=strTemp & "</td></tr></table>"
response.write strTemp
end sub
function JoinChar(strUrl) '分页附属函数
if strUrl="" then
JoinChar=""
exit function
end if
if InStr(strUrl,"?")<len(strUrl) then
if InStr(strUrl,"?")>1 then
if InStr(strUrl,"&")<len(strUrl) then
JoinChar=strUrl & "&"
else
JoinChar=strUrl
end if
else
JoinChar=strUrl & "?"
end if
else
JoinChar=strUrl
end if
end function
action = request("action")
Msg_ID = Request("Msg_ID")
havving = Request("havving")
a = havving
dim action,id
response.expires = 0
currentpage = request("page")
if currentpage = "" then
currentpage=1
end if
maxperpage = 25
totalrecords = 0
totalpage = 1
Set Rs = Server.CreateObject("ADODB.Recordset")
if action = "del" then
Sql = "Delete From Wo_Message Where Msg_ID="&Msg_ID
Conn.execute(Sql)
Response.Redirect("Admin_MsgManage.asp")
end if
%>
<script language="javascript">
<!--
function frm_onsubmit(){
return true;
}
function isDel(id){
if(confirm("您确定要删除此消息吗?")){
location.href="Admin_MsgManage.asp?Action=del&Msg_ID="+id+"&link_type2=<%=link_type2%>";
}
}
-->
</script>
<link href="Img/Admin.css" rel="stylesheet" type="text/css">
<table cellspacing=1 cellpadding=0 width=100% id=CommonListArea>
<tr id=CommonListTitle3>
<td><a href="Admin_msgadd.asp" target="main">添加新的公告</a></td>
</tr>
</table>
<br>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<table cellspacing=1 cellpadding=0 width=100% id=CommonListArea>
<tr id=CommonListTitle3>
<td align="center">编号</td>
<td width="60%" align="center"> 文章标题</td>
<td align="center">显示</td>
<td align="center">添加时间</td>
<td align="center"> 排序</td>
<td align="center">操作</td>
</tr>
<%
Set Rs = Server.CreateObject("Adodb.recordset")
sql = "SELECT * From Wo_Message Where 1=1"
if havving <> "" then
sql = sql & " and Msg_Title like '%" & havving & "%'"
end if
sql = sql & " order by Msg_OrderBy"
Rs.open Sql,conn,1,2
if not Rs.eof then
rs.pagesize = maxperpage
rs.absolutepage = currentpage
totalpage = rs.pagecount
totalrecords = rs.recordcount
end if
j = 0
While not rs.eof and j < maxperpage
j = j + 1
%>
<tr<%= Tr_MouseOver %> bgcolor="#FFFFFF">
<td height="25" align="center"><%=Rs("Msg_ID")%></td>
<td align="left"> <%=rs("Msg_Title")%></td>
<td align="center">
<%
if Rs("Msg_IsOver") = false then
Response.write("显示")
else
Response.write("<font color=#ff0000>不显示</font>")
end if
%>
</td>
<td align="center"> <%= FormatDateTime(rs("Msg_AddDate"),2) %></td>
<td align="center"><%= Rs("Msg_OrderBy") %></td>
<td align="center">
<a href="Admin_MsgEdit.asp?Msg_ID=<%=Rs("Msg_ID")%>">编辑</a>
<a href="javascript:isDel(<%=Rs("Msg_ID")%>);">删除</a>
</td>
</tr>
<%
Rs.MoveNext
Wend
%>
</table>
<br>
<table cellspacing=1 cellpadding=0 width=100% id=CommonListArea>
<tr id=CommonListTitle3>
<td>
<% Call showpage("Admin_MsgManage.asp?havving="&a,totalrecords,maxperpage,true,true,"篇文章") %>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="22"> </td>
</tr>
</table>
<%
Set Rs = Nothing
Set Conn = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -