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

📄 index.asp

📁 一个很好的班级同学录
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../public/conn.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>班级新闻</title>
<link href="../mycss.css" rel="stylesheet" type="text/css">
</head>

<body>
<!--#include file="../public/top.asp" -->
<table width="760"  border="1" align="center" cellpadding="0" cellspacing="1" class="font9Black">
  <tr>
    <td height="155" align="center" valign="top"><h3>班级新闻</h3>
      <%if session("quanxian")="master" then%>
          <a href="addnews.asp">添加新闻</a>
	  <%end if%>
	  <table width="80%"  border="0" cellspacing="1" cellpadding="5">
<% 
   if not isempty(request("page")) then
      Page=cint(request("page"))
   else
      Page=1
   end if

   set rs1=server.createobject("adodb.recordset")  
   sql1 ="select * from news" 
   rs1.open sql1,secondconn,1,1
   
   if rs1.eof and rs1.bof then  
      response.write "<p align='center'>【<a href='javascript:window.close()'>关闭窗口</a>】"
   else
      const maxperpage=10
      rs1.pagesize=maxperpage
      totalrecord=rs1.recordcount
      totalpage=rs1.pagecount
      if page>totalpage then page=totalpage
      rs1.absolutepage=page
      i=0
	  dim id(),newstitle(),newstime(),newsauthor()
      do while not rs1.eof and (i<rs1.pagesize)
        i=i+1
        redim preserve id(i),newstitle(i),newstime(i),newsauthor(i)
        id(i)=rs1("id")
		newstitle(i)=rs1("newstitle")
		newstime(i)=year(rs1("newstime"))&"年"&month(rs1("newstime"))&"月"&day(rs1("newstime"))&"日"
		newsauthor(i)=rs1("newsauthor")	
        rs1.movenext
      loop
  end if
  rs1.close
  set rs1=nothing
%>	
<%for i = 1 to totalrecord%> 
<tr>
          <td width="4%"><li></td>
          <td width="55%"><div align="left"><a href="view.asp?id=<%=id(i)%>" target="_blank"><%=newstitle(i)%></a></div></td>
          <td width="22%"><div align="left"><%=newstime(i)%></div></td>
          <td width="19%"><div align="left"><%=newsauthor(i)%></div></td>
</tr>
<%next%>
      </table>	  
	  <table width="80%"  border="0" cellspacing="1" cellpadding="5">
        <tr>
          <td>
            <div align="center"> 共有<%=totalrecord%>条记录, 每页<%=maxperpage%>条,共<font color=red><%=totalpage%></font>页 第<%=page%>页
                <%if page-1>0 then%>
                   <a href="index.asp?page=<%=page-1%>">上一页</a>
                <%else%>
                   上一页
                <%end if%>
                <%if page+1<=totalpage then%>
                   <a href="index.asp?page=<%=page+1%>">下一页</a>
                <%else%>
                   下一页
                <%end if%>
           </div>
		</td>
      </tr>
    </table>
	  </td>
  </tr>
</table>

<!--#include file="../public/bottom.asp" -->
</body>
</html>

⌨️ 快捷键说明

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