www.gusucode.com > 星云DJ舞曲 4.5a源码程序 > admin/admin_softmana.asp

    <%CheckAdmin1%>
<!--#include file="const.asp"-->
<%
if not isempty(request("page")) then
	currentPage=cint(request("page"))
else
	currentPage=1
end if
%>
<%
id=request.QueryString("id")
set rs=server.createobject("adodb.recordset")
sql="select * from softdown where id="&cstr("id")
rs.open sql,conn,1,3
if rs.EOF then
	errmsg= "<li>服务器出错或暂无纪录!请联系管理员QQ:260477522或添加资源发布~!</li>"
	call error()
	Response.End 
else
	hits=rs("hits")
	name=rs("name")
	dateandtime=DateValue(rs("dateandtime"))
end if
rs.close
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<title>后台管理</title>
<link rel="stylesheet" type="text/css" href="Admin_Style.css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table cellpadding="0" cellspacing="1" border="0" width="100%" class="border" align=center>
<tr class="tdbg">
<td align=center valign=top width="80%" height="163">
<%
sql="select * from softdown order by id desc"
rs.open sql,conn,1,1
if rs.EOF then
	response.write "未收录歌曲"
else
	MaxPerPage=15
	PageUrl="下载.asp"
	totalPut=rs.recordcount 
	if currentpage<1 then currentpage=1
	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,PageUrl
		showContent 
		showpage totalput,MaxPerPage,PageUrl
	else 
		if (currentPage-1)*MaxPerPage<totalPut then 
			rs.move  (currentPage-1)*MaxPerPage 
			dim bookmark 
			bookmark=rs.bookmark 
			showpage totalput,MaxPerPage,PageUrl
			showContent 
			showpage totalput,MaxPerPage,PageUrl
		else 
			currentPage=1 
			showpage totalput,MaxPerPage,PageUrl
			showContent 
			showpage totalput,MaxPerPage,PageUrl
		end if 
	end if 
end if 
rs.close 
sub showContent 
%>
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="zt00" style="border-collapse: collapse" bordercolor="#55595A">
<tr class="tdbg">
<td width="5%" height=22 align=center class=TFColor>序号</td>
<td width="15%" height=22 align=center >软件名</td>
<td width="20%" height=22 align=center >更新日期</td>
<td width="5%" height=22 align=center >点击</td>
<td width="9%" height=22 align=center >修改</td>
<td width="5%" height=22 align=center >删除</td>
</tr>
<%
i=0
do while not rs.eof
	i=i+1
%>
<tr height=20 class="tdbg">
<td width="5%" align=center><%=totalPut-(i+MaxPerPage*(currentpage-1)-1)%> </td>
<td width="15%"><%=rs("name")%> </td>
<td width="20%" align=center><%=rs("dateandtime")%> </td>
<td width="5%" align=center><%=rs("hits")%> </td> 
<td width="5%" align=center><a href="admin_softmodify.asp?id=<%=rs("id")%>&page=<%=CurrentPage%>">修改</a></td> 
<td width="5%" align=center><a href="admin_softDel.asp?id=<%=rs("id")%>&page=<%=CurrentPage%>">删除</a></td> 
</tr>
<%
	if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</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
%>
<FORM class=zt00 name=form1 onsubmit="return checkdata2()" action=<%=filename%>?id=<%=id%> method=post>共<font color="<%=AlertFColor%>"><b><%=totalnumber%></b></font>首舞曲
<%if CurrentPage<2 then%>
&nbsp;首页 上一页&nbsp;
<%else%>
&nbsp;<a href="<%=filename%>?page=1"><font color="#FFFFFF">首页</font></a>&nbsp;<a href="<%=filename%>?page=<%=CurrentPage-1%>"><font color="#FFFFFF">上一页</font></a>&nbsp;
<%
end if
if n-currentpage<1 then
%>
下一页 末页
<%else%>
<a href="<%=filename%>?page=<%=CurrentPage+1%>"> <font color="#FFFFFF">下一页</font></a> <a href="<%=filename%>?page=<%=n%>"> <font color="#FFFFFF">末页</font></a>
<%end if%>
&nbsp;页次:<strong><font color="<%=AlertFColor%>"><%=CurrentPage%>/<%=n%></font></strong>页
转到:
<select name="page" size="1" onchange="javascript:submit()">
<%for i = 1 to n%>
<option value="<%=i%>" <%if cint(CurrentPage)=cint(i) then%> selected <%end if%>> 第<%=i%>页</option>
<%next%>
</select>
&nbsp;&nbsp; 
</FORM>      
<%end function%>
<%
sub showList
%>
<%end sub%>
</td>
</tr>
</table>
<%
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>