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

📄 stock.asp

📁 亿众购物系统 一套设计完善、高效的web商城解决方案
💻 ASP
字号:
<!--#include file="../Session.asp"-->
<html>
<head>
<title>库存报表</title>
<link href="../../css/site.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr align="center"> 
    <td height="50" colspan="4" class="tdstyle"><strong><font color="#000000" size="3">库存报表</font></strong></td>
  </tr>
  <%
	Set rs = Server.CreateObject("ADODB.Recordset")
	sql="Select * from Merchandise where Stock>0 Order By Stock Desc"
	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		Response.Write("<tr><td height=30 colspan=4 class=text  align=center>暂无库存</td></tr>")
		response.end
	else
	  For I = 1 To rs.RecordCount
		Stock = Stock + rs("Stock")
		rs.MoveNext
	  Next
	  rs.MoveFirst
	end if
	%>
	<%
	rs.pagesize = 20
	if request("page")="" or IsNumeric(request("page"))=False then
		page = 1
	else
		page=int(request("page"))
	end if
	if page>rs.pagecount then
		page=rs.pagecount
	end if
	if not rs.BOF then
		Rs.Move Rs.PageSize*(page-1)
	end if%>
  <tr> 
    <td width="8%" align="center" class="tdstyle"><strong>产品编号</strong></td>
    <td width="50%" align="center" class="tdstyle"><strong>产品名称</strong></td>
    <td width="8%" align="center" class="tdstyle"><strong>库存量</strong></td>
    <td width="34%" align="center" class="tdstyle"><strong>直方图</strong></td>
  </tr>
  <%
  i=1
  while not rs.eof and i<=rs.pagesize
  Percent = Round((rs("Stock")/Stock)*100,2)
  %>
  <tr> 
    <td align="center" class="tdstyle"><%=rs("id")%></td>
    <td class="tdstyle"><% =rs("TradeName")%></td>
    <td align="center" class="tdstyle"><% =rs("Stock")%></td>
    <td class="tdstyle"><img src="../../images/poll.gif" width="<%= Percent * 3 %>" height="10"><% = Percent %>%</td>
  </tr>
  <%
  i=i+1
 rs.MoveNext                                              
 wend 
%>
  <tr> 
    <td colspan="4" align="right" class="tdstyle"><b>总库存量:<font color="#FF3333"><% = formatNumber(Stock,0)%></font></b>&nbsp;&nbsp;</td>
  </tr>
  <tr> 
    <form name=form method=get action=?>
      <td colspan="4" align="center" class="tdstyle"> 
        <%
		if rs.recordcount<>0 then
		if page-1 mod 10=0 then
				p=(page-1) \ 10
			else
				p=(page-1) \ 10
			end if
		
			response.write "页次:"& page &"/"& rs.pagecount &"页 每页"& rs.pagesize &" 共"& rs.recordcount &"条记录"&_
							" 分页:"
		
			if p*10>0 then response.write "<a href='?page="&p*10&"' title=上十页>[&lt;&lt;]</a>   "
			uming_i=1
			for ii=p*10+1 to P*10+10
				   if ii=page then
					  response.write "<font color=#ff0000>["+Cstr(ii)+"]</font> "
				   else
					  response.write "<a href='?page="&ii&"'>["+Cstr(ii)+"]</a>   "
				   end if
				if ii=rs.pagecount then exit for
				 uming_i=uming_i+1
			next
			if ii<=rs.pagecount and uming_i=11 then response.write "<a href='?page="&ii&"' title=下十页>[&gt;&gt;]</a>   "
		response.write("  跳页:<input type=text name=page size=2 maxlength=3 class=input1> <input type=submit name=Submit value=Go class=button>")
		end if
		rs.close
		conn.close
		set rs = nothing
		set conn = nothing%>
      </td>
    </form>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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