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

📄 show.asp

📁 用户名、密码和权限存放在本案例数据库中的admin表
💻 ASP
字号:
<%
if session("longin")<>1 then  '判断是否登录
   response.Redirect("login.asp")  '转移到登录页面
end if
%>
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
<title>后台管理——管理资料</title>
</head>

<%
action=request("action")                            '获得操作命令
%>
<%
if action="del" and request("id")<>"" then          '判断操作命令和操作数是否为空
   Dim StrSQL
   StrSQL="delete from design where id="&request("id")
   conn.Execute StrSQL                              '执行删除命令
end if
%>  

<%
dim rs
dim sql
pmcount = 5                               '定义每页显示记录条数
set rs = server.createobject("adodb.recordset")
sql = "select typeid,id,filename from design order by id desc"
rs.pagesize = pmcount                    '定义分页记录集每页显示记录数
rs.open sql,conn,1,1 
if not (rs.eof and rs.bof) then          '检测记录集是否为空
totalrec = RS.RecordCount                'totalrec:总记录条数
mpage=rs.pagecount                       'mpage:总记录页数
currentpage = request("page")            'currentpage:从提交的page中得到当前页
If currentpage <> "" then
  currentpage = cint(currentpage)        '将currentpage转换为数值型的
  if currentpage < 1 then 
     currentpage = 1
  end if 
else
currentpage = 1
end if 
if currentpage*pmcount > totalrec and not((currentpage-1)*pmcount < totalrec)then 
currentPage=1
end if
rs.absolutepage = currentpage                 'absolutepage:设置指针指向某页开头
rowcount = rs.pagesize                        'pagesize:设置每一页的数据记录数
%>

<table width="80%" border="0"  cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
   <tr bgcolor="#FFFFFF"> 
      <td align="center">类型编号</td>
      <td align="center">客户名称</td>
      <td colspan="2" align="center">管理</td>
   </tr>
<%   
do while not rs.eof and rowcount>0              '循环生成每条已增加的设计产品的信息
%>
   <tr bgcolor="#FFFFFF"> 
      <td align="center" ><%=rs("typeid")%></td>
      <td align="center" ><%=rs("filename")%></td>
      <td align="center"><a href="edit.asp?action=modify&id=<%=rs("id")%>" style="text-decoration: none">修改</a></td>
      <td  align="center"><a href="show.asp?action=del&id=<%=rs("id")%>" style="text-decoration: none">删除</a></td>
   </tr>
<%
rowcount=rowcount-1
rs.movenext   
loop
end if 
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
</table>
<br>
<%call listPages()%>
<%
sub listPages() 
if mpage <= 1 then exit sub                        '如果总记录页数不够一页则跳出
%>
<table border="0">
 <tr>
   <td >
     <%if currentpage = 1 then%>
        <font color=darkgray>首页</font>
     <%else%> 
        <a href="<%=request.ServerVariables("script_name")%>?page=1">首页</font></a>
        <a href="<%=request.ServerVariables("script_name")%>?page=<%=currentpage-1%>">
前页</a></font>                               
     <%end if%>
     <%if currentpage = mpage then%> 
        <font color=darkgray face="arial" >后页</font>
     <%else%> 
         <a href="<%=request.ServerVariables("script_name")%>?page=<%=currentpage+1%>">下页</a>
                                               
         <a href="<%=request.ServerVariables("script_name")%>?page=<%=mpage%>">末页</a></font>                                       
     <%end if%>
      总:<%=currentpage%>/<%=mpage%>页  <%=pmcount%>设计作品/页   共:<%=totalrec%>设计作品</font>
    </td>
 </tr>
</table>
<%end sub%>    


</BODY>
</HTML>

⌨️ 快捷键说明

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