📄 today_jinchu.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../common/status.html"-->
<!--#include file="../common/conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>当日进出库数量</title>
<style type="text/css">
<!--
.style2 {font-size: x-small}
-->
</style>
<% if session("admin_id")="" then %>
您还没有登录或者您的权限不够,五秒钟后自动返回登录,如果您的浏览器没有自动返回,请<a href="../admin/login.html">点击登录</a>。
<meta http-equiv="refresh" content="5;url=login.html">
<% else %>
</head>
<body background="../img/searchBG.gif">
<%
Const MaxPerPage=5
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql,sql1,rs,rs1,innum,outnum,sdate
innum=0
outnum=0
sdate=request.QueryString("date")
%>
<div align="center"><center>
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" colspan="4"><%=sdate%>各种商品进出库数量:</td>
</tr>
<tr align="center">
<td width="25%" height="30">产品</td>
<td width="25%">入库数量</td>
<td width="25%">出库数量</td>
<td width="25%">产品详细信息</td>
<%
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
set rs=server.CreateObject("adodb.recordset")
set rs1=server.CreateObject("adodb.recordset")
sql="select product_id, product_num from scott.product_info order by product_id"
rs.open sql,connstr,3,3
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,"today_jinchu.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"today_jinchu.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"today_jinchu.asp"
end if
end if
sub showContent
dim i
i=0
do while not rs.eof
sql1="select sm_id, sm_innum from scott.stock_management where sm_inpid<>' ' and sm_inpid='"&rs("product_num")&"' and sm_indate like '"&sdate&"%' order by sm_id"
rs1.open sql1,connstr,3,3
if rs1.eof And rs1.bof then
innum=0
else
do while not rs1.eof
innum=innum+cint(rs1("sm_innum"))
rs1.movenext
loop
end if
rs1.close
sql1="select sm_id, sm_outnum from scott.stock_management where sm_outpid<>' ' and sm_outpid='"&rs("product_num")&"' and sm_outdate like '"&sdate&"%' order by sm_id"
rs1.open sql1,connstr,3,3
if rs1.eof And rs1.bof then
outnum=0
else
do while not rs1.eof
outnum=outnum+cint(rs1("sm_outnum"))
rs1.movenext
loop
end if
rs1.close
%>
<tr align="center">
<td height="30"><%=rs("product_num") %></td>
<td><%=innum%></td>
<td><%=outnum%></td>
<td><a href="sj_detail.asp?id=<%=rs("product_id")%>" target="_blank">浏览详细信息</a></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.MoveNext
loop
rs.Close
set rs=nothing
%>
</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 %>
<form method="Post" action="<%=filename%>?date=<%=sdate%>">
<table width="700" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<% If CurrentPage<2 Then %>
<td width="8%" height="25"><span class="style2">首页</span></td>
<td width="8%"><span class="style2">上一页</span></td>
<% Else %>
<td width="8%"><a href=<%=filename%>?date=<%=sdate%>&page=1 class="style2">首页</a></td>
<td width="8%"><a href=<%=filename%>?date=<%=sdate%>&page=<%=CurrentPage-1%> class="style2">上一页</a></td>
<% end if %>
<% If n-currentpage<1 Then %>
<td width="8%"><span class="style2">下一页</span></td>
<td width="8%"><span class="style2">末页</span></td>
<% Else %>
<td width="8%"><a href=<%=filename%>?date=<%=sdate%>&page=<%=(CurrentPage+1)%>><span class="style2">下一页</span></a></td>
<td width="8%"><a href=<%=filename%>?date=<%=sdate%>&page=<%=n%> class="style2">末页</a></td>
<% end if %>
<td width="8%"><span class="style2">第<%=CurrentPage%>页</span></td>
<td width="8%" class="style2">共<%=n%>页</td>
<td width="16%" height="25" colspan="2" align="center" class="style2">共<%=totalnumber%>条记录</td>
<td width="16%" colspan="2" align="center" class="style2">每页<%=maxperpage%>条记录</td>
<td colspan="2" align="center" width="20%"><span class="style2">转到第
<input type="text" name="page" size="2" maxlength="10" value="<%=currentpage%>">
页</span> <input type="submit" value="跳转" name="cndok"></td>
</tr>
<tr><td height="20" colspan="13" align="right"><a href="javascript:history.go(-1)" class="style2">返回上一页</a> <a href="index.asp" class="style2">返回主页</a></td>
</table>
</form>
<%
End Function
%>
</center>
</div>
</body>
<% end if %>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -