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

📄 view.asp

📁 用户名、密码和权限存放在本案例数据库中的admin表
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!-- #include file="ubbcode.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>
<body leftmargin="0" topmargin="0">
<div align="center">
  <center>
    <table width="776" height="150" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#111111" bgcolor="#CCCCCC" style="border-collapse: collapse">
      <tr> 
        <td width="194" height="337" valign="top" bgcolor="#FFFFFF"><table border="0" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="123">
            <tr> 
              <td width="100%" height="30" bgcolor="eeeeee">  <strong>设计分类</strong></td>
            </tr>
            <%sql = "select * from designtype order by typeid"
set rs=conn.execute(sql)
%>
            <%do while not rs.eof%>
            <tr> 
              <td width="100%" height="16"> <div align="center"> 
                  <center>
                    <table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="90%">
                      <tr> 
                        <td width="100%"><a href="index.asp?leixing=<%=rs("typeid")%>"><%=rs("typename")%></a></td>
                      </tr>
                    </table>
                  </center>
                  <%  
rs.movenext  
loop  
rs.close
set rs=nothing%>
                </div></td>
            </tr>
            <tr> 
              <td width="100%" height="30" bgcolor="eeeeee"> <strong> 设计排行</strong></td>
            </tr>
            <%sql = "select top 10 id,filename from design order by id"
set rs=conn.execute(sql)
%>
            <%do while not rs.eof%>
            <tr> 
              <td width="100%" height="16"> <center>
                  <table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="90%">
                    <tr> 
                      <td width="100%"><%=rs("filename")%></td>
                    </tr>
                  </table>
                </center></td>
              <%  
	rs.movenext  
	loop  
	rs.close
    set rs=nothing
    %>
            </tr>
            <tr> 
              <td width="100%" height="16"> </td>
            </tr>
          </table> </td>
        <td width="560" height="337" valign="top" bgcolor="#FFFFFF"> <div align="center"> 
            <center>
              <table width="95%" height="271" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" style="border-collapse: collapse">
                <tr> 
                  <td width="100%" height="221"> <div align="center"> 
                      <center>
                        <table border="0" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
                          <tr> 
                            <td width="100%"> <p align="right"> 
                                <select onchange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}">
                                  <option selected>设计排序选择</option>
                                  <option value=index.asp?order=id&leixing=<%=request("leixing")%>>按加入时间排序</option>
                                  <option value=index.asp?order=hit&leixing=<%=request("leixing")%>>按点击次数排序</option>
                                  <option value=index.asp?order=filename&leixing=<%=request("leixing")%>>按设计名称排序</option>
                                  <option value=index.asp?order=typename&leixing=<%=request("leixing")%>>按设计名称排序</option>
                                </select>
                            </td>
                          </tr>
                          <tr> 
                            <%leixing=request("leixing")%>
                            <%order=request("order")%>
                            <%if order="" then%>
                            <%order="id"%>
                            <%else%>
                            <%end if%>
                            <%
dim rs
dim sql
msg_per_page = 5 '定义每页显示记录条数
set rs = server.createobject("adodb.recordset")
%>
                            <%if leixing="" then%>
                            <%sql = "select * from design,designtype where design.typeid=designtype.typeid order by "&order&" desc"%>
                            <%else%>
                            <%sql = "select * from design,designtype where design.typeid=designtype.typeid and design.typeid="&leixing&" order by "&order&" desc"%>
                            <%end if%>
                            <%rs.cursorlocation = 3 '使用客户端游标,可以使效率提高
rs.pagesize = msg_per_page '定义分页记录集每页显示记录数
rs.open sql,conn,0,1 

if err.number<>0 then '错误处理
response.write "数据库操作失败:" & err.description
err.clear
else
if not (rs.eof and rs.bof) then '检测记录集是否为空
totalrec = RS.RecordCount 'totalrec:总记录条数
if rs.recordcount mod msg_per_page = 0 then '计算总页数,recordcount:数据的总记录数
n = rs.recordcount\msg_per_page 'n:总页数
else 
n = rs.recordcount\msg_per_page+1 
end if 

currentpage = request("page") 'currentpage:当前页
If currentpage <> "" then
currentpage = cint(currentpage)
if currentpage < 1 then 
currentpage = 1
end if 
if err.number <> 0 then 
err.clear
currentpage = 1
end if
else
currentpage = 1
End if 
if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then 
currentPage=1
end if
rs.absolutepage = currentpage 'absolutepage:设置指针指向某页开头
rowcount = rs.pagesize 'pagesize:设置每一页的数据记录数

dim i
dim k
%>
                            <%   
do while not rs.eof and rowcount>0
%>
                            <td width="100%"> <table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" width="100%">
                                <tr> 
                                  <td width="100%"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bordercolor="#111111" bgcolor="#99CCFF" style="border-collapse: collapse">
                                      <tr> 
                                        <td width="50%" bgcolor="#99CCFF"> 
                                          <table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
                                            <tr bgcolor="#f1f1f1"> 
                                              <td width="100%" colspan="2"><font color="#000000"><b><%=rs("filename")%></b></font></td>
                                            </tr>
                                            <tr bgcolor="#FFFFFF"> 
                                              <td width="60%" class="small">类型:<%=rs("typename")%></td>
                                              <td width="40%" class="small">点击数: 
                                                <%if rs("hit")=0 then%>
                                                N/A 
                                                <%else%>
                                                <%=rs("hit")%> 
                                                <%end if%>
                                              </td>
                                            </tr>
                                            <tr bgcolor="#FFFFFF"> 
                                              <td width="60%" class="small">网址: 
                                                <%if rs("url")="" then%>
                                                N/A 
                                                <%else%>
                                                <a target="_blank" style="font-family: Arial" href="<%=rs("url")%>"><%=rs("url")%></a> 
                                                <%end if%>
                                              </td>
                                              <td width="40%" class="small">时间:<%=rs("time")%></td>
                                            </tr>
                                            <tr bgcolor="#FFFFFF"> 
                                              <td width="100%" colspan="2" class="small"> 
                                                属于: 
                                                <%if rs("hit")>1000 then%>
                                                <font color="#FF0000">cool</font> 
                                                <%else%>
                                                <%if rs("hit")>500 then%>
                                                <font color="#FF0000">hot</font> 
                                                <%else%>
                                                <%end if%>
                                                <%end if%>
                                                <%if rs("time")=date() then%>
                                                <font color="#FF0000">today</font> 
                                                <%else%>
                                                <%if year(rs("time"))=year(Now()) then%>
                                                <%if month(rs("time"))=month(Now()) then%>
                                                <font color="#FF0000">new</font> 
                                                <%else%>
                                                <%end if%>
                                                <%else%>
                                                <%end if%>
                                                <%end if%>
                                              </td>
                                            </tr>
                                            <tr bgcolor="#99CCFF"> 
                                              <td width="100%" colspan="2"> 
                                                <%content=rs("content")%>
                                                <% response.write UBBCode(content)%>
                                              </td>
                                            </tr>
                                          </table>
                                        </td>
                                        <td width="35%" bgcolor="#FFFFFF"> 
                                          <!--			  <%if rs("piclink")="" then%><img border="0" src="<%=rs("pic")%>" width="160" height="120"><%else%><a href="<%=rs("piclink")%>" target="_blank"><img border="0" src="<%=rs("pic")%>" width="160" height="120"></a><%end if%>
	 -->
                                        </td>
                                      </tr>
                                    </table></td>
                                </tr>
                              </table></td>
                          </tr>
                          <%
rowcount=rowcount-1
rs.movenext   
loop
end if
end if     
rs.close
conn.close
set rs=nothing
set coon=nothing
%>
                          <tr> 
                            <td width="100%" class="small"> </td>
                          </tr>
                          <tr> 
                            <td width="100%" class="small"> </td>
                          </tr>
                        </table>
                      </center>
                    </div>
                    <%call listPages()%>
                    <%
sub listPages() 
if n <= 1 then exit sub 
%>
                    <p> 
                      <%if currentpage = 1 then%>
                      首页- 
                      <%else%>
                      <a href="<%=request.ServerVariables("script_name")%>?page=1&order=<%=order%>"> 
                      第一页</a> 
                      <a href="<%=request.ServerVariables("script_name")%>?page=<%=currentpage-1%>&order=<%=order%>"> 
                      第二页</a> 
                      <%end if%>
                      <%if currentpage = n then%>
                      没有后页了
                      <%else%>
                      <b> <a href="<%=request.ServerVariables("script_name")%>?page=<%=currentpage+1%>&order=<%=order%>"> 
                      下一页</a></b> 
                      <b> <a href="<%=request.ServerVariables("script_name")%>?page=<%=n%>&order=<%=order%>"> 
                      最后一页</a></b> 
                      <%end if%>
                      总:<%=currentpage%>/<%=n%>页 <%=msg_per_page%>开发项目/页 共:<%=totalrec%>开发项目</p>
                    <%end sub%>
                  </td>
                </tr>
              </table>
            </center>
          </div></td>
        <td width="12" height="337"> </td>
      </tr>
    </table>
  </center>
</div>

<div align="center">
  <center>
  </center>
</div>

</BODY>

</HTML>

⌨️ 快捷键说明

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