adminteach1_body.asp

来自「南鄂电子商务学校网: 学校概况、校园动态、师资力量、教学成果、师生论坛、友情链接」· ASP 代码 · 共 122 行

ASP
122
字号
<%sub adminteach1_body()
dim totalart,Currentpage,totalpages,i,colname

sql="select * from teach order by teach_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<!--#include file="admintop.asp"-->
<table width="<%=tablewidth%>" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td width="205" bgcolor="#FFFFFF" valign="top" class="line">
      <%call adminmenu()%>
    </td>
    <td width="565" bgcolor="#FFFFFF" valign="top" align="center" class="linee"> <table width="98%" border="0" cellpadding="0" cellspacing="1" background="images/dh.gif" class="linee">
        <tr align="center"> 
          <td width="50%" height="25"><a href="admin_teach1.asp">师资管理</a></td>
          <td width="50%"><a href="admin_teach2.asp?action=newteach">新增师资</a></td>
        </tr>
      </table>
      <table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="6"></td>
        </tr>
      </table>
      <table width="98%" border="1" cellspacing="0" cellpadding="4" bordercolor="#09DD77" style="border-collapse: collapse">
        <tr align="center"> 
          <td width="10%" background="images/dh.gif" bgcolor="#FFFFFF">编号</td>
          <td width="60%" background="images/dh.gif" bgcolor="#FFFFFF">宝典标题</td>
	  <td width="10%" background="images/dh.gif" bgcolor="#FFFFFF">浏览</td>
          <td width="20%" background="images/dh.gif" bgcolor="#FFFFFF">操作</td>
        </tr>
<%if not rs.eof then
rs.movefirst
rs.pagesize=teachperpage
if trim(request("page"))<>"" then
   currentpage=clng(request("page"))
   if currentpage>rs.pagecount then
      currentpage=rs.pagecount
   end if
else
   currentpage=1
end if
   totalart=rs.recordcount
   if currentpage<>1 then
      if(currentpage-1)*teachperpage<totalart then
	     rs.move(currentpage-1)*teachperpage
		 dim bookmark
		 bookmark=rs.bookmark
	  end if
   end if
   if (totalart mod teachperpage)=0 then
      totalpages=totalart\teachperpage
   else
      totalpages=totalart\teachperpage+1
   end if
   i=0
do while not rs.eof and i<teachperpage%>
        <tr> 
          <td bgcolor="#FFFFFF" align="center"><%=rs("teach_id")%></td>
          <td bgcolor="#FFFFFF"><a href="showteach.asp?teach_id=<%=rs("teach_id")%>" target="_blank"><%if len(rs("teach_title"))>26 then
 response.write ""&left(rs("teach_title"),24)&"..."
else
 response.write ""&rs("teach_title")
end if%></a></td>
          <td bgcolor="#FFFFFF" align="center"><%=rs("teach_count")%></td>
          <td bgcolor="#FFFFFF" align="center"><a href="admin_teach2.asp?teach_id=<%=rs("teach_id")%>&action=editteach">edit</a> 
            <a href="admin_teach2.asp?teach_id=<%=rs("teach_id")%>&action=delteach">del</a></td>
        </tr>
<%
i=i+1
rs.movenext
loop
else
if rs.eof and rs.bof then
%>
        <tr align="center"> 
          <td bgcolor="#FFFFFF" colspan="4">当前没有师资!</td>
        </tr>
<%end if
end if%>
      </table>
	  <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
        <form name="form1" method="post" action="admin_teach1.asp">
          <tr> 
            <td align="right"><%=currentpage%> /<%=totalpages%>页,<%=totalart%>条记录,<%=teachperpage%>篇/每页. 
              <%
i=1
showye=totalpages
if showye>10 then
showye=10
end if
for i=1 to showye
if i=currentpage then
%>
              <B><%=i%></B> 
              <%else%>
              <a href="admin_teach1.asp?page=<%=i%>"><%=i%></a> 
              <%end if
next
if totalpages>currentpage then
if request("page")="" then
page=1
else
page=request("page")+1
end if%>
              <a href="admin_teach1.asp?page=<%=page%>" title="下一页">>></a> 
              <%end if%>
              &nbsp;&nbsp;&nbsp;&nbsp; 
              <input type="text" name="page" class="input" style="width:30px;">
              <input type="submit" name="Submit" value="Go" class="button" style="width:24px;">
            </td>
          </tr>
        </form>
      </table>
      <br>
    </td>
  </tr>
</table>
<%
rs.close
set rs=nothing
end sub%>

⌨️ 快捷键说明

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