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

📄 spzs.asp

📁 仿阿里巴巴系统用ASP开发的系统。代码精简
💻 ASP
字号:
<%
const MaxPerPage=3
dim totalPut   
dim CurrentPage
dim TotalPages
dim i
if not isempty(request("page")) then
   currentPage=cint(request("page"))
else
   currentPage=1
end if
sql="select * from spzs where gsid="+cstr(id)+" order by ID desc"
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1 
  if rs.eof and rs.bof then 
     response.write"<SCRIPT language=JavaScript>alert('产品展厅里还没有任何产品,请您与我公司联系!');"
     response.write"this.location.href='company.asp?id="&id&"'</SCRIPT>"
  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
       else 
          if (currentPage-1)*MaxPerPage<totalPut then 
            rs.move  (currentPage-1)*MaxPerPage 
            dim bookmark 
            bookmark=rs.bookmark 
            showContent
          else 
            currentPage=1 
            showContent
          end if 
       end if
   end if 
   myrs.close     
   set myrs=nothing
   conn.close
   set conn=nothing
   sub showContent    
%>  
<TABLE cellSpacing=0 cellPadding=0 width="100%" bgcolor=#ffffff> 
  <TBODY> 
  <TR> 
    <TD height=483 valign=top bgcolor="#FFFFFF" align=center><BR>
      <TABLE border=0 cellPadding=0 cellSpacing=0 width="95%">
        <TBODY>
        <TR>
          <TD class=M><B><IMG align=absMiddle src="images/i.gif" width=18>所有产品</B>
          </TD>
          <TD align=right><%showpage totalput,MaxPerPage,"product.asp"%></TD>
        </TR>
        </TBODY>
      </TABLE>
      <TABLE border=0 cellPadding=0 cellSpacing=0 width="95%">
        <TR><TD height="20" colspan="2" background="images/line_gr.gif"></TD></TR>
      </TABLE> 
      <%do while not rs.eof%> 
      <TABLE border=0 cellPadding=0 cellSpacing=0 width="95%">
        <TBODY>
        <TR>
          <TD align=middle width="29%"><IMG border=1 height=75 src="../../../uploadpic/<%=rs("picture")%>" width=75></A></TD>
          <TD vAlign=top><SPAN class=m><B><A href="show_product.asp?product_id=<%=rs("id")%>&id=<%=id%>"><font color="#ff6600"><%=rs("cpmc")%></font> 
            </A></B></SPAN><BR><B>产品描述:</B><%=rs("jysm")%>...(<A href="show_product.asp?id=<%=rs("id")%>" target="_blank"><font color="#ff6600">详细信息</A></font>)<BR></TD>
        </TR>
        <TR><TD height="20" colspan="2"></TD></TR>
        <TR><TD height="20" colspan="2" background="images/line_gr.gif"></TD></TR>
        <BR>
        </TBODY>
      </TABLE>
        <% i=i+1 
           if i>=MaxPerPage then exit do  
           rs.movenext 
           loop 
           rs.close    
           set rs=nothing   
%> 
    <TABLE border=0 cellPadding=0 cellSpacing=0 width="95%">
      <TR><TD colspan="2"><%showpage totalput,MaxPerPage,"product.asp"%></TD></TR>
    </table></TD></TR></TABLE>
<%
end sub  
function showpage(totalnumber,maxperpage,filename) 
    dim n 
    if totalnumber mod maxperpage=0 then 
       n= totalnumber \ maxperpage 
    else 
       n= totalnumber \ maxperpage+1 
    end if 
       response.write "<form method=Post action="&filename&">" 
    if CurrentPage<2 then 
       response.write "<table border=0 width=100% cellspacing=0 cellpadding=0>"
       response.write "<tr height=20><td  colspan=2></td></tr>"
       response.write "<tr height=20>"
       response.write "<td align=left valign=top>"
       response.write "<font color=red><b>共"&n&"页&nbsp;第"&CurrentPage&"页 " 
       response.write "共查询到"&totalnumber&"&nbsp;种产品</b></font>"   
       response.write "</td>"
       response.write "<td VALIGN=middle align=right >"
       response.write "【最前页】【上一页】" 
  else 
       response.write "<table border=0 width=100% cellspacing=0 cellpadding=0>"
       response.write "<tr height=20><td  colspan=2></td></tr>"
       response.write "<tr height=30>"
       response.write "<td align=left VALIGN=top>"
       response.write "<font color=red><b>共"&n&"页&nbsp;第"&CurrentPage&"页 " 
       response.write "共查询到"&totalnumber&"&nbsp种产品</b></font>"   
       response.write "</td>"
       response.write "<td VALIGN=center align=right >"
       response.write "【<a href="&filename&"?page=1&id="&gsid&">最前页</a>】" 
       response.write "【<a href="&filename&"?page="&CurrentPage-1&"&id="&gsid&">上一页</a>】" 
 end if 
  if n-currentpage<1 then 
      response.write "【下一页】【最后页】" 
  else 
      response.write "【<a href="&filename&"?page="&(CurrentPage+1)&"&id="&gsid&">" 
      response.write "下一页</a>】【 <a href="&filename&"?page="&n&"&id="&gsid&">最后页</a>】" 
  end if 
  response.write "</form>"      
  response.write "</td>"
  response.write "</tr>"
  response.write "</table>"
end function
%>

⌨️ 快捷键说明

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