videospeciallist.asp

来自「烈火之家整站程序 本程序集商业娱乐一体,本来是给自己用的但是我的国外空间支持不够」· ASP 代码 · 共 98 行

ASP
98
字号
<!--#include file="admin.asp"-->
<!--#include file="conn1.asp"-->
<!-- #include file="../Inc/Head.asp" -->
<%
maxperpage=10
if not isempty(request("page")) then
	currentPage=cint(request("page"))
else
	currentPage=1
end if
set rs=createobject("adodb.recordset")
sql="select * from VideoSpecial order by  SpecialId desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then 
	response.write "暂时没有收集"
else 
	PageUrl="Videospeciallist.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 
		showContent 
		showpage totalput,MaxPerPage,PageUrl
	else 
		if (currentPage-1)*MaxPerPage<totalPut then 
			rs.move  (currentPage-1)*MaxPerPage 
			dim bookmark 
			bookmark=rs.bookmark 
			showContent 
			showpage totalput,MaxPerPage,PageUrl
		else 
			currentPage=1 
			showContent 
			showpage totalput,MaxPerPage,PageUrl
		end if 
	end if 
end if 
rs.close 

sub showContent
Response.Write "<br><table width=""60%"" align=""center"" border=""0"" cellspacing=""1"" cellpadding=""3""  bgcolor=""#F0f0f0"">"
      
Admin_i=0
do while not rs.eof
Admin_i=Admin_i+1
 Response.Write "<tr bgcolor=""#FFFFFF"" align=""center"">"&_
      "<td align=""left""><li><a href=Videolist.asp?SpecialId="&rs("SpecialId")&">"&rs("SpecialName")&"</a></td>"&_
      "<td><a href=Videoadd.asp?SpecialID="&rs("SpecialID")&"&ClassID="&rs("ClassID")&">录入视频</a></td>"&_
      "<td><a href=VideoSpecialedit.asp?SpecialID="&rs("SpecialId")&"&ClassID="&rs("ClassId")&">编辑</a></td>"&_
	 "<td><a href=""javascript:newin('200', '150', 'Videospecialsave.asp?SpecialID="&rs("SpecialId")&"&action=del', 'del')"">删除</a></td>"&_
        "</tr>"
 if Admin_i>=maxperpage then exit do
 rs.movenext
 loop
     Response.Write " </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 "<div align=""center""><form method=Post action="&filename&">"&_
				"<font size=""2"">共找到<b>"&totalnumber&"</b>项记录" 
if CurrentPage<2 then
response.write "&nbsp;首页 上一页&nbsp;"
else
response.write "&nbsp<a href="&filename&"?page=1>首页</a>&nbsp;<a href="&filename&"?page="&CurrentPage-1&">上一页</a>&nbsp;" 
end if
if n-currentpage<1 then
response.write "下一页 末页 "
else
response.write "<a href="&filename&"?page="&CurrentPage+1&">下一页</a>&nbsp;"&_
                "<a href="&filename&"?page="&n&">末页</a>" 
end if
response.write "&nbsp;页次:<strong>"&CurrentPage&"/"&n&"</strong>页  转到:<select name='page' size='1' onchange='javascript:submit()'>"
               for i = 1 to n
response.write "<option value="&i
 				if cint(CurrentPage)=cint(i) then response.write " selected "
response.write ">第"&i&"页</option>"
                next
response.write "</select></font></form></div>"      
end function
%>
	</td>
  </tr>
</table>
<!-- #include file="../Inc/Foot.asp" -->

⌨️ 快捷键说明

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