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

📄 class.asp

📁 基于asp的网上图书管理系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<%dim nclassid
nclassid=request.querystring("nid")%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><%=webname%>--图书分类</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>
.pad {
	PADDING-LEFT: 2px
}
</style>
<link href="images/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	color: #9900FF;
	font-weight: bold;
}
.style2 {
	color: #990000;
	font-weight: bold;
	font-size: 14px;
}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="webtop.asp"-->
<table width="10" height="7" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td height=7></td>
  </tr>
</table>
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="162" valign="top" bgcolor="#bed3f4"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td bgcolor="#99CCFF">&nbsp;</td>
        </tr>
        <tr> 
          <td bgcolor="#99CCFF" height="6"></td>
        </tr>
        <tr> 
          <td bgcolor="#99CCFF">&nbsp;</td>
        </tr>
        <tr>
          <td height="6" bgcolor="#99CCFF"></td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td bgcolor="#FFCCFF"><div align="center" class="style2">图书分类</div></td>
        </tr>
        <tr> 
          <td height="180" valign="top" bgcolor="#FFCCFF">
		  <%set rs=server.CreateObject("adodb.recordset")
				rs.open "select anclassid,anclass,changyong from shop_anclass where changyong=1 order by anclassidorder",conn,1,1
				do while not rs.eof
				response.write "<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td colspan=3><div align=center>"
				response.write "【"&trim(rs("anclass"))&"】"
				response.write "</div></td></tr>"
set rs2=server.CreateObject("adodb.recordset")
rs2.open "select nclassid,nclass,changyong,anclassid from shop_nclass where changyong=1 and anclassid="&rs("anclassid")&" order by nclassidorder",conn,1,1
do while not rs2.eof
Dim num1 '//判断数字奇偶
num1 = Num1+1
If num1 Mod 2 = 0 Then
response.write "<td width=80><div align=left><a href=class.asp?aid="&rs2("anclassid")&"&nid="&rs2("nclassid")&">"&trim(rs2("nclass"))&"</a></div></td></tr>"
else
response.write "<tr><td width=70><div align=right><a href=class.asp?aid="&rs2("anclassid")&"&nid="&rs2("nclassid")&">"&trim(rs2("nclass"))&"</a></div></td>"
response.write "<td width=12><div align=center><FONT color=#ff6600>|</FONT></div></td>"
end if
rs2.movenext
loop
rs2.close
set rs2=nothing
response.write "</table>"
rs.movenext
loop
rs.close
set rs=nothing%>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td colspan="3"><div align="center">【其它】</div></td>
              <%set rs=server.CreateObject("adodb.recordset")
			  rs.open "select shop_nclass.anclassid,shop_nclass.nclassid,shop_nclass.nclass from shop_nclass inner join shop_anclass on shop_anclass.anclassid=shop_nclass.anclassid where shop_anclass.changyong=0 and shop_nclass.changyong=1 order by shop_nclass.nclassid",conn,1,1 
			  do while not rs.eof
			  dim num2
			  num2 = Num2+1
If num2 Mod 2 = 0 Then
response.write "<td width=80><div align=left><a href=class.asp?aid="&rs("anclassid")&"&nid="&rs("nclassid")&">"&trim(rs("nclass"))&"</a></div></td></tr>"
else
response.write "<tr><td width=70><div align=right><a href=class.asp?aid="&rs("anclassid")&"&nid="&rs("nclassid")&">"&trim(rs("nclass"))&"</a></div></td>"
response.write "<td width=12><div align=center><FONT color=#ff6600>|</FONT></div></td>"
end if
rs.movenext
loop
rs.close
set rs=nothing%>
          </table></td>
        </tr>
        <tr> 
          <td>&nbsp;</td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="6"></td>
        </tr>
        <tr>
          <td valign="top"><div align="center">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td>&nbsp;</td>
                </tr>
                <tr> 
                  <td height="6"></td>
                </tr>
                <tr> 
                  <td>&nbsp;</td>
                </tr>
                <tr> 
                  <td height="6">&nbsp;</td>
                </tr>
              </table>
            </div></td>
        </tr>
      </table></td>
    <td width="7" valign="top">&nbsp;</td>
    <td width="440" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          
          <td width="100%" valign="middle" bgcolor="#BDD3F7"><span class="style2">图书分类</span></td>
        </tr>
        <TR> 
          <TD colspan="2"><%'//这个页面最耗服务器资源的地方就在这里了,搜索了三次数据库才将这个功能实现,如果您有更好的方法,请将这段话改的高效点,发到我的信箱ck168@vip.sina.com,谢谢!
		  '//大类查询
		  'dim ii,jj
		  'ii=1
		  set rs=server.CreateObject("adodb.recordset")
		  rs.open "select anclass,anclassid from shop_anclass",conn,1,1
		  'jj=rs.recordcount
		  do while not rs.eof
		  response.write "<A href=javascript:turnX('r"&rs("anclassid")&"')>"&trim(rs("anclass"))&"</A> | "
		  'if ii=jj then
			'response.Write "<br>"
			'end if
		  rs.movenext
		  loop
		  rs.close
		  set rs=nothing
		  response.write "<BR>"
		  '二次查询大类
		  set rs=server.CreateObject("adodb.recordset")
		  rs.open "select anclass,anclassid from shop_anclass",conn,1,1
		  do while not rs.eof
		   response.write "<DIV id=r"&rs("anclassid")&" style='DISPLAY: none'><font color=red>"&trim(rs("anclass"))&"--&gt;</font>"
			'//查询小类
			dim rs2
			set rs2=server.CreateObject("adodb.recordset")
			rs2.open "select nclass,nclassid from shop_nclass where anclassid="&rs("anclassid")&" order by nclassidorder",conn,1,1
			do while not rs2.eof
			response.write "<A href=class.asp?aid="&rs("anclassid")&"&nid="&rs2("nclassid")&">"&trim(rs2("nclass"))&"</A> | " 
             rs2.movenext
			 loop
			 rs2.close
			 set rs2=nothing
			 response.write "</DIV><DIV id=r0101 style='DISPLAY: none'></DIV>"
			rs.movenext
			'ii=ii+1
			loop
				rs.close
				set rs=nothing%>
                
            <DIV id=currentLocation></DIV></TD>
        </TR>
        <tr> 
          <td colspan="2"><hr width="100%" size="1" color=#6B8FC8></td>
        </tr>
      </table><%'开始分页
				Const MaxPerPage=8 
   				dim totalPut   
   				dim CurrentPage
   				dim TotalPages
   				dim j
   				dim sql
    				if Not isempty(request("page")) then
      				currentPage=Cint(request("page"))
   				else
      				currentPage=1
   				end if 
		  if nclassid="" then
		  set rs=server.CreateObject("adodb.recordset")
		  rs.open "select top 20 bookid,bookname,bookzz,bookchuban,shichangjia,huiyuanjia,dazhe,bookdate,bookpic from shop_books order by adddate desc",conn,1,1
		  else
		  set rs=server.CreateObject("adodb.recordset")
		   rs.open "select bookid,bookname,bookzz,bookchuban,shichangjia,huiyuanjia,dazhe,bookdate,bookpic from shop_books where nclassid="&nclassid&" order by adddate desc",conn,1,1 
		  end if
		  
				if err.number<>0 then
				response.write "数据库中无数据"
				end if
				
  				if rs.eof And rs.bof then
       				Response.Write "<p align='center' class='contents'> 对不起,此分类暂时还没有图书!</p>"
   				else
	  				totalPut=rs.recordcount

      				if currentpage<1 then
          				currentpage=1
      				end if

      				if (currentpage-1)*MaxPerPage>totalput then
	   					if (totalPut mod MaxPerPage)=0 then
	     					currentpage= totalPut \ MaxPerPage
	   					else
	      					currentpage= totalPut \ MaxPerPage + 1
	   					end if
      				end if

       				if currentPage=1 then
            			showContent
            			showpage totalput,MaxPerPage,"class.asp"

⌨️ 快捷键说明

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