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

📄 stockpile.asp

📁 ASP数据库系统开发案例精选(光盘)中的客户关系管理系统 用户名/密码:admin/admin
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file=DataBase/conn.asp-->
<!--#include file=config.asp-->
<%
set rsr=server.CreateObject("adodb.recordset")
sqlr="select * from tb_User where username='"&session("admin_name")&"'"
rsr.open sqlr,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="css/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
body {
	background-color: #DFEEFF;
}
.style3 {color: #FFFFFF}
-->
</style></head>
<script language="javascript">
function HLItem(obj){
	obj.oldClassName=obj.className;
	obj.className="List";
}
function Re(obj){
 obj.className=obj.oldClassName
}

</script>

<body>
<table width="100%"  border="0" >
  <tr>
    <td valign="top">	<fieldset class="fiedset">
  <legend>
  <input name="radiobutton" type="radio" value="radiobutton" checked>
  库存管理
  <input name="radiobutton" type="radio" value="radiobutton" onClick="location='Stockpile_Product.asp'"> 
  产品管理
  </legend>
  <form name="form1" method="post" action="">
    <table width="90%" height="27"  border="0" align="center" cellspacing="0" class="table">
      <tr align="center">
        <td width="14%" height="27">快速查询:
          <input name="post" type="hidden" id="post" value="true"></td>
        <td width="16%"><span class="style3">
          <select name="tiao" id="tiao">
            <option value="模糊查询" <%if request("tiao")="模糊查询" then%>selected<%end if%>>模糊查询</option>
            <option value="精确查询" <%if request("tiao")="精确查询" then%>selected<%end if%>>精确查询</option>
          </select>
        </span></td>
        <td width="7%">字段:</td>
        <td width="17%"><span class="style3">
          <select name="sel" id="sel">
            <option value="ProductNumber">产品编号</option>
            <option value="ProductName">产品名称</option>
            <option value="ProductProvider">供 应 商</option>
          </select>
        </span></td>
        <td width="7%" >关键字:</td>
        <td width="23%"><input name="search" type="text" id="search" value="<%=request("search")%>"></td>
        <td width="16%"><input name="Submit" type="submit" class="input" value=" 查 询 " #invalidattr_id="1px groove"></td>
      </tr>
    </table>
  </form>  
  <form name="form2" method="post" action="Stockpile_Product_del.asp?p=<%=request("p")%>">
    <table width="90%"  border="0" align="center" cellspacing="0">
      <tr>
    
        <td width="97%"><table width="100%"  border="0" align="center" cellspacing="0" bordercolor="#FFFFFF" class="table">
          <tr bordercolor="#ffffff" cellpadding="0">
            <td width="19%" align="center"  class="listTitle">产品编号              </td>
            <td width="19%" align="center"  class="listTitle">产品名称</td>
            <td width="19%" align="center"  class="listTitle">入库</td>
            <td width="19%" align="center"  class="listTitle">出库</td>
			<td width="19%" align="center"  class="listTitle">目前库存</td>
          </tr>
		  <%
if request("post")<>"" then
	if request("tiao")="模糊查询" then'条件输入为模糊查询时获得相应的记录集
		set rs=server.CreateObject("adodb.recordset")
		sql="select * from tb_Product where "&request("sel")&" like '%"&request("search")&"%' order by id desc"
		rs.open sql,conn,1,1
	else                             '条件输入为精确查询时获得相应的记录集
		set rs=server.CreateObject("adodb.recordset")
		sql="select * from tb_Product where "&request("sel")&"='"&request("search")&"' order by id desc"
		rs.open sql,conn,1,1
	end if
else                                '没有输入条件时获得相应的记录集
	set rs=server.CreateObject("adodb.recordset")
	sql="select * from tb_Product order by id desc"
	rs.open sql,conn,1,1
end if
if not rs.eof then
	tol=rs.recordcount                '总记录数
	rs.pagesize=15                    '每页显示的条数
	maxpage=rs.pagecount              '最大页码
	requestpage=clng(request("p"))    '获取当前页
	if requestpage="" or requestpage=0 then
		requestpage=1
	end if
	if requestpage>maxpage then
		requestpage=maxpage
	end if
	if requestpage<>1 then
		rs.move (requestpage-1)*rs.pagesize
	end if
	for i=1 to rs.pagesize and not rs.eof 
	'改变交叉记录表格的背景色
	if i mod 2=1 then
		bg="#FFFFFF"
	else
		bg="#efefef"
	end if
%>
          <tr align="center" bgcolor=<%=bg%> style="cursor:hand" onClick="window.parent.frames('bo').window.location = 'Stockpile_List.asp?id=<%=rs("id")%>'" onMouseOver="HLItem(this)" onMouseOut="Re(this)">
            <td height="22"><%=rs("ProductNumber")%></td>
            <td><%=rs("ProductName")%></td>
            <td>
<% 
	'计算入库数量
	set rsru=server.CreateObject("adodb.recordset")
	rsru.open "select sum(StockpileProductNumber) as ru from tb_Stockpile where StockpileType='入库' and StockpileProductName="&rs("id") ,conn,1,1
	ru=rsru("ru")
	if isnull(ru) then
		ru=0
	end if
	response.Write(ru)
%>
			</td>
            <td>
<% 
	'计算出库数量
	set rschu=server.CreateObject("adodb.recordset")
	rschu.open "select sum(StockpileProductNumber) as chu from tb_Stockpile where StockpileType='出库' and StockpileProductName="&rs("id") ,conn,1,1
	chu=rschu("chu")
	if isnull(chu) then
		chu=0
	end if
	response.Write(chu)
%>
			</td>
			<td>
			<%=(ru-chu)%><!--取得库存-->
			</td>
          </tr>
<%
	rs.movenext
	if rs.eof then exit for
	next
else
	response.Write("没有客户信息,请<a href='Stockpile_add.asp' target='bo'>添加</a>")'没有信息时提示添加产品
end if
%>
        </table></td>
      </tr>
    </table>
    <table width="90%"  border="0" align="center">
      <tr>
        <td width="37%">          
          <input name="Submit2" type="button" class="input" value=" 添 加 " onClick="window.parent.frames('bo').window.location = 'Stockpile_add.asp'">
          <input name="Submit23" type="button" class="input" value=" 刷 新 " onClick="location='Stockpile.asp'">
        </td>
        <td width="63%" align="right">
		<%if request("post")="" then%>
		<a href="Stockpile.asp?p=1">首页</a> <a href="Stockpile.asp?p=<%=requestpage-1%>">上一页</a> <a href="Stockpile.asp?p=<%=requestpage+1%>">下一页</a> <a href="Stockpile.asp?p=<%=maxpage%>">最后一页</a> 当前页:<%=requestpage%> 总页数:<%=maxpage%> 总客户数:<%=tol%> 
		<%else%>
		<a href="Stockpile.asp?p=1&tiao=<%=request("tiao")%>&sel=<%=request("sel")%>&search=<%=request("search")%>&post=true">首页</a> <a href="Stockpile.asp?p=<%=requestpage-1%>&tiao=<%=request("tiao")%>&sel=<%=request("sel")%>&search=<%=request("search")%>&post=true">上一页</a> <a href="Stockpile.asp?p=<%=requestpage+1%>&tiao=<%=request("tiao")%>&sel=<%=request("sel")%>&search=<%=request("search")%>&post=true">下一页</a> <a href="Stockpile.asp?p=<%=maxpage%>&tiao=<%=request("tiao")%>&sel=<%=request("sel")%>&search=<%=request("search")%>&post=true">最后一页</a> 当前页:<%=requestpage%> 总页数:<%=maxpage%> 总客户数:<%=tol%> 
		<%end if%>		
		
		&nbsp;每页显示15条信息</td>
      </tr>
    </table>
  </form>
  <p><br>
      </p>
	 </fieldset></td>
  </tr>
</table>

</body>
</html>

⌨️ 快捷键说明

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