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

📄 article.asp

📁 我勇 java 和access 做的一个网站
💻 ASP
字号:
<!--#include file="islogin.asp"-->
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/css.css" rel="stylesheet" type="text/css">
<title></title>
<style type="text/css">
<!--
@import url("../style/admin.css");
body {
	background-color: #FFFFFF;
}
-->
</style></head>

<body>
<br>
<script type="text/JavaScript">
<!--
function MM_jumpMenu(selObj,restore){ //v3.0
  eval("location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_1">
  <tr>
    <td height="30" class="header">
<%
class_id=request("class_id")
set rs=server.createobject("adodb.recordset")	
sql="select * from class"
rs.open sql,conn,1,1
%>
<select id="class_id" name="menu1" size="1" onChange="MM_jumpMenu(this,0)"style="FONT-face: 黑体; FONT-SIZE: 12px;text-align:center;">
  <% do while not rs.eof%>
  <option value="?class_id=<%=rs("id")%>" <%if class_id=rs("id") then%>selected<%end if%>><%=rs("name")%></option>
  <%
rs.movenext      
loop
%>
</select>
<a href="article_add.asp?class_id=<%=request("class_id")%>" style="color:red">添加文章</a>
<%
rs.close 
%>
&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">
	<table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" class="table_1_inc">
      <tr>
        <td width="14" align="center">&nbsp;</td>
        <td width="141"><strong>类别</strong></td>
        <td width="614"><strong>文件名</strong></td>
        <td width="55" align="center"><strong>修改</strong></td>
        <td width="55" align="center"><strong>删除</strong></td>
      </tr>
<%
set rs=server.createobject("adodb.recordset")
class_id=request("class_id")
page=request.querystring("page")
if class_id="" then
sql="select id,class_id,class_name,class_big,fname,oktime,title,up,hits from article order by id desc"
else
sql="select id,class_id,class_name,class_big,fname,oktime,title,up,hits from article where class_id="&class_id&" order by id desc"
end if
rs.open sql,conn,1,1
class_big=rs("class_big")
on error resume next
maxjilu=rs.recordcount
perpage=38 '每页显示记录数
t=page*perpage
rs.absoluteposition=t+1
f=t+perpage

ww=0
for i=t+1 to f
ww=ww+1
%>	  
      <tr <%if (ww mod 2)=1 then%>bgcolor="#F8F8FA"<%end if%> >
        <td align="center">&nbsp;</td>
        <td><%=rs("class_name")%></td>
        <td><a href="../html/<%=rs("class_id")%>/<%=rs("fname")%>" target="_blank"><%=rs("title")%></a></td>
        <td align="center"><a href="article_mod.asp?action=mod&path=<%=path%>&fname=<%=rs("fname")%>&id=<%=rs("id")%>">修改</a></td>
        <td align="center"><a href="article_do.asp?action=del&class_id=<%=class_id%>&id=<%=rs("id")%>"  onclick='javascript: return confirm("警告!!!删除&nbsp;[<%=rs("fname")%>]??&nbsp;,&nbsp;不建议删除") '>删除</a></td>
      </tr>
<%
rs.movenext 
if rs.eof then
exit for
rs.close 
set rs=nothing
end if
next
tt=page*perpage
    if page<0 then
   page=0
   end if
   if tt>=maxjilu then
   ttt=page-1
   end if
   if maxjilu-tt<perpage then
   ttt=page-1
      else
   ttt=page
   end if
   u=1
   do while u*perpage<maxjilu
   u=u+1
   loop
session("page")=ttt
set conn=nothing
%>    
</table></td>
  </tr>
  <tr>
    <td height="25" align="center" bgcolor="#FFFFFF">        <div style="text-align:left;background-color:#e6e6e6; height:20px;padding-top:2px;font-size:12px;">找到<font color="#FF0000"><%=maxjilu%></font>条| <a href="article.asp?class_id=<%=class_id%>&page=0">首页</a>-<a href="article.asp?class_id=<%=class_id%>&page=<%=(page-1)%>">上页</a>-<a href="article.asp?class_id=<%=class_id%>&page=<%=(page+1)%>" >下页</a>-<a href="article.asp?class_id=<%=class_id%>&page=<%=(u-1)%>" >末页</a>
            <% 
  if ttt<=5 then 
  uu=0 
  while uu<u  
   %>
            <a href="article.asp?class_id=<%=class_id%>&page=<%=(uu)%>"><%=(uu+1)%></a>
            <%uu=uu+1 
 wend 
  else%>
            <a style="color:blue" href="article.asp?class_id=<%=class_id%>&page=<%=(ttt-6)%>">[<%=(ttt-5)%>]</a> <a style="color:blue" href="article.asp?class_id=<%=class_id%>&page=<%=(ttt-5)%>">[<%=(ttt-4)%>]</a> <a style="color:blue" href="article.asp?class_id=<%=class_id%>&page=<%=(ttt-4)%>">[<%=(ttt-3)%>]</a> <a style="color:blue" href="article.asp?class_id=<%=class_id%>&page=<%=(ttt-3)%>">[<%=(ttt-2)%>]</a> <a style="color:blue" href="article.asp?class_id=<%=class_id%>&page=<%=(ttt-2)%>">[<%=(ttt-1)%>]</a> <a style="color:blue" href="article.asp?class_id=<%=class_id%>&page=<%=(ttt-1)%>" >[<%=(ttt)%>]</a> <a style="color:blue" href="article.asp?class_id=<%=class_id%>&page=<%=(ttt)%>">[<%=(ttt+1)%>]</a>
            <%end if%>
        </div></td>
  </tr>
</table>
<br>
</body>
</html>

⌨️ 快捷键说明

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