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

📄 admin_list.asp

📁 网站代码
💻 ASP
字号:
<!--#include file="Include/conn.asp"-->
<!--#include file="include/char.asp" -->
<!--#include file="Include/check.asp"-->
<!--#include FILE="Include/Admin_Function.asp"-->
<%
'* 个人版价格:500元 商业版价格:700元
'* 演示:http://Demo.wenday.com
'* 版本:Engine_WenDay网站信息系统 Ver 2.0 演示版
'* 版权所有: 一奔网络工作室(Wenday.Com)
'* 联系QQ: 42367091
'* Email :wenday@21cn.com
'* 程序开发: Wenday
%>
<%CheckAdmin1%>
<%
const MaxPerPage=15
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
dim title

title=request("txtitle")
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
  if not isempty(request("selAnnounce")) then
  idlist=request("selAnnounce")
  if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
 id=clng(idarr(i))
 call deleteannounce(id)
next
  else
call deleteannounce(clng(idlist))
  end if
  end if 
dim sql
dim rs
%>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
return " 不 选 "; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
return " 全 选 "; }
}
//  End -->
</script>

<link href="Img/admin.css" rel="stylesheet" type="text/css">
<body leftmargin="2" topmargin="8">
<table border="0" width="590" cellspacing="0" cellpadding="0" align="center">
  <tr>
  
 <td width="100%" align="center"> 
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <form name="searchsoft" method="POST" action="Admin_List.asp"><tr>
 <td>
  &nbsp;&nbsp;查找文章: 
  <input name="txtitle" type="text" class=smallInput size="13">
  &nbsp; 
  <input type="submit" value="查 询" name="title" class="buttonface">
  </td>
  </tr> </form>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<%
SqlSort = "Select * from Sort  where B_id=0 and setting<4 order by S_Order"
Set RsSort = Conn.Execute(SqlSort )
if RsSort.eof and RsSort.bof then
Response.write("<div align=center>还没有设置分类.......</div>")
response.end
else
%>
<tr>
<td height="30" align="center"><a href="Admin_list.asp">全部信息</a></td>
<%
do while not RsSort.eof
%>
<td align="center"><a href="Admin_list.asp?SortID=<%=RsSort("ID")%>"><%=RsSort("Names")%></a></td>
<%
RsSort.movenext
loop
end if
RsSort.close
set RsSort=nothing
%>
</tr>
</table>
<table width="590" border="0" cellspacing="0" cellpadding="0">
<form method=Post action="Admin_List.asp"><tr>
<td>
<%
SortID=Request("SortId")
 if SortID<>"" then
 
if session("KEY")="input" then
sql="select * from Info where Sort1="&SortID&" and author='"&Session("WendaySys_User")&"' order by ID desc"
else
sql="select * from Info where Sort1="&SortID&" order by ID desc"
end if

end if
if title<>"" then

if session("KEY")="input" then
sql="select * from Info where (title like '%"&trim(title)&"%' or content like '%"&trim(title)&"%') and author='"&Session("WendaySys_User")&"' order by ID desc"
else
sql="select * from Info where title like '%"&trim(title)&"%' or content like '%"&trim(title)&"%' order by ID desc"
end if

end if
if SortID="" and title="" then

if session("KEY")="input" then
sql="select * from Info where author='"&Session("WendaySys_User")&"' order by ID desc"
else
sql="select * from Info order by ID desc"
end if

end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1

  if rs.eof and rs.bof then
 response.write "<p align='center'> 还 没 有 任 何 文 章 </p>"
else
totalPut=rs.recordcount
if currentpage<1 then
 currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
  currentpage= totalPut \ MaxPerPage
  else
currentpage= totalPut \ MaxPerPage + 1
end if

end if
 if currentPage=1 then
  showpage totalput,MaxPerPage,"Admin_list.asp"
showContent
showpage totalput,MaxPerPage,"Admin_list.asp"
 else
 if (currentPage-1)*MaxPerPage<totalPut then
rs.move  (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
  showpage totalput,MaxPerPage,"Admin_list.asp"
showContent
 showpage totalput,MaxPerPage,"Admin_list.asp"
  else
  currentPage=1
  showpage totalput,MaxPerPage,"Admin_list.asp"
  showContent
  showpage totalput,MaxPerPage,"Admin_list.asp"
end if
end if
rs.close
end if
  
set rs=nothing  
conn.close
set conn=nothing
  
sub showContent
 dim i
i=0
%>
  <table width="590" border="0" align="center" cellpadding="0" cellspacing="1" bordercolorlight="#cccccc" bordercolordark="#FFFFFF" bgcolor="#CCCCCC">
 <tr bgcolor="#EAEAEA"> 
<td width="41" height="22" align="center">ID</td>
<td width="380" align="center">信 息 标 题</td>
<td colspan="3" align="center">操作</td>
 </tr>
 <%do while not rs.eof%>
 <tr bgcolor="#FFFFFF"> 
<td width="41" height="23"> <p align="center"><%=rs("ID")%></td>
<td width="380">&nbsp;&nbsp;<%=rs("title")%></td>
<td width="47"> <div align="center"><a href="ViewInfo.asp?id=<%=rs("ID")%>" target="_blank">查看</a></div></td>
<td width="47"> <div align="center"><a href="Admin_Edit.asp?id=<%=rs("ID")%>">修改</a></div></td>
<%
if session("KEY")="input" then
else
%>
<td width="79"> <p align="center"> 
 <input type='checkbox' name='selAnnounce' value='<%=cstr(rs("ID"))%>' style="border:0px">
</td>
<% end if %>
 </tr>
 <%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
 <tr bgcolor="#EAEAEA"> 
<td colspan="5"align="right">&nbsp;
<%
if session("KEY")="input" then
else
%>
 <input name="button" type=button onClick="this.value=check(this.form.selAnnounce)" value=" 全 选 ">
 <input name="submit" type='submit' class=buttonface value=' 删 除 '>
<% end if %>
</td>
 </tr>
  </table>
<%
end sub 

function showpage(totalnumber,maxperpage,filename)
  dim n
  if totalnumber mod maxperpage=0 then
  n= totalnumber \ maxperpage
  else
  n= totalnumber \ maxperpage+1
  end if
  response.write "<p align='center'>&nbsp;"
  if CurrentPage<2 then
 response.write "首页 上一页&nbsp;"
  else
 response.write "<a href="&filename&"?SortID="&SortID&"&page=1>首页</a>&nbsp;"
 response.write "<a href="&filename&"?SortID="&SortID&"&page="&CurrentPage-1&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
 response.write "下一页 尾页"
  else
 response.write "<a href="&filename&"?SortID="&SortID&"&page="&(CurrentPage+1)&">"
 response.write "下一页</a> <a href="&filename&"?SortID="&SortID&"&page="&n&">尾页</a>"
  end if
response.write "&nbsp;页次:<strong>"&CurrentPage&"/"&n&"</strong>页"
response.write "&nbsp;共<b>"&totalnumber&"</b>篇文章 <b>"&maxperpage&"</b>篇文章/页"
 
end function

  sub deleteannounce(id)
 CheckAdmin2
 sql="delete from Info where ID="&cstr(id)
 conn.execute sql
 if err.Number<>0 then
err.clear
response.write "删 除 失 败 !<br>"
 else
 'response.write "操作成功!<br>"
 end if
  End sub
%>
</td>
  </tr></form>
</table> </td>
  </tr>
</table>
<!--#include file="Include/Foot.asp" -->

⌨️ 快捷键说明

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