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

📄 excel_produit.asp

📁 不错的进销存管理系统。功能比较全
💻 ASP
字号:
<!--#include file="../conn2.asp" --> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<% 
nowfilename=replace(replace(replace(now,":","")," ",""),"/","")
Response.Buffer = True 
Response.ContentType = "application/vnd.ms-excel" 
Response.AddHeader "content-disposition", "inline; filename = "&nowfilename&".xls"
%> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<title>Untitled Document</title> 
</head> 
<body>
<%
'取得当前页码
currentpage=request("page")
'response.write currentpage
'response.end
if currentpage<1 or currentpage="" then
  currentpage="1"
end if

'取得搜索关键字  
nowku=request("ku")
nowbigclass=request("bigclass")
nowsmallclass=request("smallclass")
if nowbigclass="" then nowsmallclass=""
nowkeyword=request("keyword")

	if session("shiwei_id")="1" or fla88="1" then
	  sql="select * from ku order by id"
	  set rs_ku=conn.execute(sql)
	else
	  sql="select * from ku where instr(login,'"&session("shiwei_id")&",')>0 order by id"
	  set rs_ku=conn.execute(sql)
	  if rs_ku.eof then
	    nowku="0"
	  elseif request("ku")="" then
	    nowku=rs_ku("id")
	  end if	  
	end if 

  sql="select * from produit where 1=1"
  if nowkeyword<>"" then
	sql=sql&" and (title like '%"&nowkeyword&"%' or huohao like '%"&nowkeyword&"%')"
  end if
  if nowku<>"" then
	sql=sql&" and id_ku="&nowku
  end if  
  if nowbigclass<>"" then
	sql=sql&" and id_bigclass="&nowbigclass
  end if
  if nowsmallclass<>"" then
	sql=sql&" and id_smallclass="&nowsmallclass
  end if  
  
  if request("order1")<>"" then
    sql=sql&" order by photo "&request("order1")
  elseif request("order2")<>"" then
    sql=sql&" order by huohao "&request("order2")
  elseif request("order3")<>"" then
    sql=sql&" order by title "&request("order3") 
  elseif request("order4")<>"" then
    sql=sql&" order by guige "&request("order4") 
  elseif request("order5")<>"" then
    sql=sql&" order by danwei "&request("order5") 
  elseif request("order6")<>"" then
    sql=sql&" order by shulian "&request("order6")
  elseif request("order7")<>"" then
    sql=sql&" order by price2 "&request("order7")
  elseif request("order8")<>"" then
    sql=sql&" order by shulian*price2 "&request("order8")		        
  else
    sql=sql&" order by id desc"  
  end if
  
  set rs_produit =server.createobject("ADODB.RecordSet")	
  rs_produit.open sql,conn,1,3
%>
<table width="100%" border="1" align="center" cellpadding="2" cellspacing="0">
<tr>
  <th>序号</th>
  <th>货号</th>
  <th>产品名称</th>
  <th>规格</th>
  <th>单位</th>
  <th>库存数量</th>
  <%if session("shiwei_id")="1" or fla87="1" then%>
  <th>进货单价</th>
  <th>金额</th>
  <%end if%>
</tr>
<%
i=0
do while rs_produit.eof=false
i=i+1
%>
<tr class="TD2">
<td align="center"><%=i%></td>
<td align="center"><%=rs_produit("huohao")%></td>
<td align="center"><%=rs_produit("title")%></td>
<td align="center"><%=rs_produit("guige")%></td>
<td align="center"><%=rs_produit("danwei")%></td>
<td align="center">
	  <%
	  sql="select * from ku where id="&rs_produit("id_ku")
	  set rs_ku=conn.execute(sql)
	  sql="select * from produit where huohao='"&rs_produit("huohao")&"'"
	  set rs_shulian=conn.execute(sql)
	  nowshulian=0
	  do while rs_shulian.eof=false
	    nowshulian=nowshulian+rs_shulian("shulian")
	    rs_shulian.movenext
	  loop
      nowshulian7=nowshulian
	  'if request("ku")<>"" then
	  '  nowshulian=rs_produit("shulian")	
	  'end if
	  %>
	  <b><%if nowshulian7<rs_produit("baojin") then%><font color="#ff0000"><%=formatnumber(nowshulian,2)%></font><%else%><%=formatnumber(nowshulian,2)%><%end if%></b>,<%=rs_ku("ku")%>【<%=formatnumber(rs_produit("shulian"),2)%>】
</td>
<%if session("shiwei_id")="1" or fla87="1" then%>  
<td align="center"><%=formatnumber(rs_produit("price2"),2)%></td>
<td align="center"><%=formatnumber(rs_produit("price2")*rs_produit("shulian"),2)%></td>
<%end if%>
</tr>
<%
rs_produit.movenext
loop
%>
</table>
</body>
</html>

⌨️ 快捷键说明

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