📄 admin_list.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="../fn/cut.asp"-->
<!--#include file="../fn/f_han.asp"-->
<!--#include file="seeadmin.asp"-->
<%
call nadmin
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>可以网络在线www.koyee.com</title>
<STYLE type=text/css>A:link {
COLOR: #000000; FONT-FAMILY: 宋体; TEXT-DECORATION: none
}
A:visited {
COLOR: #000000; FONT-FAMILY: 宋体; TEXT-DECORATION: none
}
A:active {
FONT-FAMILY: 宋体; TEXT-DECORATION: underline
}
A:hover {
COLOR: #84bd6b; TEXT-DECORATION: underline overline
}
BODY {
COLOR: #000000; FONT-FAMILY: 宋体; FONT-SIZE: 9pt
}
TABLE {
COLOR: #000000; FONT-FAMILY: 宋体; FONT-SIZE: 9pt
}
.f24 {
COLOR: #ff0000; FONT-FAMILY: 宋体; FONT-SIZE: 9pt; TEXT-DECORATION: underline overline
}
.l17 {
LINE-HEIGHT: 170%
}
.f18 {
FONT-SIZE: 18px
}
</STYLE>
</head>
<% if session("step")=8 then %>
<!--#include file="mdel.asp"-->
<% end if %>
<body topmargin="0">
<table width="760" height="25" border="1" align="center" bordercolor="#CC99CC" bgcolor="#FFCCCC">
<%
strsql1="select count(*) from art_file"
cou=conn.execute(strsql1)(0)
if request.form("tname")<>"" then
ttname=request.form("tname")
sql2="select id from art_type where art_type='" &ttname& "'"
set sss1=conn.execute(sql2)
sss=cint(sss1("id"))
strsql2="select count(*) from art_file where type="&sss
cou1=conn.execute(strsql2)(0)
end if
%>
<tr><td align="center" width="370">本站共有新闻 <font color="red"><%=cou%></font> 条</td>
<td align="center">
<% if request.form("tname")<>"" then %>
<%=ttname%>版块有新闻 <font color="red"><%=cou1%></font> 条
<% else %>
<% end if %></td></tr>
</table>
<table width="760" height="" border="1" align="center" bordercolor="#D4BFFF" bgcolor="#CC99CC">
<tr>
<td width="15%" bgcolor="#FFFFFF" align="center" height="20">所属版面</td>
<td width="50%" bgcolor="#FFFFFF" align="center" height="20">文章</td>
<td width="15%" bgcolor="#FFFFFF" align="center" height="20">创建时间</td>
<td width="10%" bgcolor="#FFFFFF" align="center" height="20">删除</td>
<td width="10%" bgcolor="#FFFFFF" align="center" height="20">修改</td>
</tr>
<script language="javascript">
function pageii(i){
document.gopage.currentpage.value=i;
document.gopage.submit();
}
function pagei(tname){
document.gopage.tname.value=tname;
document.gopage.submit();
}
</script>
<%
if request.form("tname")<>"" then
tname=request.form("tname")
strsql="select * from art_file where 1=1"&getsql(tname)
else
strsql="select * from art_file order by id desc"
end if
set rs=Server.createObject("adodb.recordset")
rs.open strsql,conn,1,1
if rs.eof then
%>
<tr>
<td bgcolor="#FFFFFF" colspan="17">
<p align="center"><font color="#FF0000">暂时没有任何资料记录!</font></p>
</td>
</tr>
<%
else
const maxperpage=18 '定义每一页显示的数据记录的常量
dim currentpage '定义当前页的变量
rs.pagesize=maxperpage
currentpage=request.form("currentpage")
if currentpage="" or not Isnumeric(currentpage) then
currentpage=1
elseif currentpage<1 then
currentpage=1
else
currentpage=clng(currentpage)
if currentpage > rs.pagecount then
currentpage=rs.pagecount
end if
end if
'如果变量currentpage的数据类型不是数值型
'就1赋给变量currentpage
if not isnumeric(currentpage) then
currentpage=1
end if
dim totalput,n '定义变量
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then
n=1
end if
rs.move(currentpage-1)*maxperpage
i=0
%>
<% do while i< maxperpage and not rs.eof
%>
<tr>
<%
set rs0=conn.execute("select * from art_type where id="&rs("type") )%>
<td width="15%" bgcolor="#FFFFFF" align="center"><a href="javascript:pagei('<%=rs0("art_type")%>')"><%=rs0("art_type")%></a></td>
<td width="50%" bgcolor="#FFFFFF" align="center"><a href='../news/<%=rs("type")%>/<%=rs("filename")%>' target="_blank"><%=rs("title")%></a></td>
<td width="10%" bgcolor="#FFFFFF" align="center"><%=rs("arttime")%></td>
<td width="15%" bgcolor="#FFFFFF" align="center"><a href="delete.asp?id=<%=rs("id")%>">删除</a></td>
<td width="10%" bgcolor="#FFFFFF" align="center"><a href="admin_update.asp?id=<%=rs("id")%>" target="_blank">修改</a></td>
</tr>
<%
i=i+1
rs.movenext
loop
end if
%>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" width="540" cellspacing="0" cellpadding="0">
<tr>
<td width="497">页数:<font color="red"><%=currentpage%></font>/<% =n%>
<% k=currentpage
if k<>1 then%>
[<a class="link" href="javascript:pageii(1);">首页</a>]
[<a class="link" href="javascript:pageii(<%=k-1%>);">上一页</a>]
<%else%>
[首页] [上一页]
<%end if%>
<%if k<>n then%>
[<a class="link" href="javascript:pageii(<%=k+1%>);">下一页</a>]
[<a class="link" href="javascript:pageii(<%=n%>);">尾页</a>]
<%else%>
[下一页] [尾页]
<%end if%>
共有<font color="red"><%=totalput%></font>条记录
</td>
<form action="" method="post" name="pag">
<td height="23">
<p align="right">
<select onChange="javascript:pageii(document.pag.pag.value)" size="1" id="pag" name="pag" style="background-attachment: scroll; background-repeat: repeat; font-size: 9pt; height: 23; width: 96; background-color: #FFFFFF; border: 1 solid #000000; background-position: none 0%">
<%
i=1
do while not i > n
%>
<option value="<%=I%>" <%if i=currentpage then %>selected<%end if%>>第 <%=i%> 页</option>
<%
i=i+1
loop
%>
</select>
</td>
</form>
<TR>
</TR>
</table>
<form action="" method="post" name="gopage">
<input type="hidden" name="currentpage" value="">
<input type="hidden" name="tname" value="<%=tname%>">
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -