<!--#include file="../conn.asp"-->
<%
dim Page '页码
Const Page_RecordCount=15 '每页记录数
dim Total_RecordCount '总记录数
dim Page_Number '页数
%>
<html>
<head>
<title>入库卷烟统计</title>
<meta http-equiv="Content-Type"
content="text/html;
charset=gb2312">
<link rel="stylesheet"
href="../splitspace/css.css"
type="text/css">
<!--#include file='../calendar.js'-->
</head>
<body bgcolor="EAF4FE"
text="#000000">
<OBJECT Classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WB width=0></OBJECT>
<script language=javascript>
functiondo
PrintSetup(){
WB.ExecWB(8,1)
}
functiondo
PrintPreview(){
WB.ExecWB(7,1)
}
</script>
<table width="95%"
border="0"
cellspacing="0"
cellpadding="0"
align="center">
<tr>
<td height="145">
<form name="form1"
method="post"
action="input_anasis.asp?type=1">
<table width="100%"
border="0"
cellspacing="0"
cellpadding="0">
<tr>
<td height="30">您现在所在的位置:>><font color="#990000">入库卷烟统计</font></td>
</tr>
<tr>
<td height="22">
<div align="center">
<p><a href="input_check.asp"><b><font color="#993300">入库卷烟查询</font></b></a> <a href="input_anasis.asp"><b><font color="#993300">入库卷烟统计</font></b></a></p>
</div>
</td>
</tr>
<tr>
<td height="15">
<table width="100%"
border="0"
cellspacing="0"
cellpadding="0">
<tr>
<td height="30">
<table width="100%"
border="0"
cellspacing="0"
cellpadding="0">
<tr>
<td width="9%"
class="ptd1"
height="36">
<div align="center"></div>
<div align="center">入库日期:</div>
</td>
<td width="33%"
class="ptd1"
height="36">
<input type="text"
name="from_date"
size="15"
style="border-color: #006600;
border-style:groove;
border-width: 1px">
<input type="button"
name="d1"
value="..."
onClick="fPopCalendar(from_date,from_date);return false"
class="CommonButton">
</td>
<td width="6%"
class="ptd1"
height="36">
<div align="center">至</div>
</td>
<td width="52%"
class="ptd3"
height="36">
<input type="text"
name="to_date"
size="15"
style="border-color: #006600;
border-style:groove;
border-width: 1px">
<input type="button"
name="d2"
value="..."
onClick="fPopCalendar(to_date,to_date);return false"
class="CommonButton">
</td>
</tr>
</table>
<table width="100%"
border="0"
cellspacing="0"
cellpadding="0">
<tr>
<td width="9%"
class="ptd3"
height="36">
<div align="center">经办人:</div>
</td>
<td width="18%"
height="36"
class="ptd2">
<select name="transcator">
<option value="">请选择经办人</option>
<%
set rsSofteng=server.CreateObject("adodb.recordset"
sqlSofteng="select Distinct I_Name from employee "
rsSofteng.open sqlSofteng,conn,1,1
do while not rsSofteng.eof
%>
<option value="<%=Trim(rsSofteng("I_Name"
)%>"><%=Trim(rsSofteng("I_Name"
)%></option>
<%
rsSofteng.movenext
loop
rsSofteng.close
set rsSofteng=nothing
%>
</select>
</td>
<td width="7%"
class="ptd3">
<div align="center">供货商:</div>
</td>
<td width="24%"
class="ptd3"
height="38">
<select name="manufacture">
<option value=""
selected>请选择供应商</option>
<%
set rsSofteng=server.CreateObject("adodb.recordset"
SqlSofteng="select Distinct M_Name from Manufacturer "
rsSofteng.open sqlSofteng,conn,1,1
do while not rsSofteng.eof
%>
<option value="<%=rsSofteng("M_Name"
%>"><%=rsSofteng("M_Name"
%></option>
<%
rsSofteng.movenext
loop
rsSofteng.close
set rsSofteng=nothing
%>
</select>
</td>
<td width="7%"
class="ptd3">
<div align="center">接货员:</div>
</td>
<td width="35%"
class="ptd4">
<select name="Accepter">
<option value="">请选择接货员</option>
<%
set rsSofteng=server.CreateObject("adodb.recordset"
sqlSofteng="select Distinct I_Name from employee "
rsSofteng.open sqlSofteng,conn,1,1
do while not rsSofteng.eof
%>
<option value="<%=rsSofteng("I_Name"
%>"><%=rsSofteng("I_Name"
%></option>
<%
rsSofteng.movenext
loop
rsSofteng.close
set rsSofteng=nothing
%>
</select>
<input type="submit"
name="Submit"
value="
"
class="check">
<input type="button"
name="Print"
OnClick="javascript
rint()"
Class="print"
value="
">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<table width="95%"
border="0"
cellspacing="1"
cellpadding="0"
bgcolor="A7B6C1"
align="center">
<tr bgcolor="D7EAEA">
<td width="34%">
<div align="center">卷烟编号</div>
</td>
<td width="35%">
<div align="center">卷烟名称</div>
</td>
<td width="31%">
<div align="center">入库数量(万支)</div>
</td>
</tr>
<%'查询开始
dim rs
dim strsql
dim qfrom_date,qto_date '接收上一页传递的条件参数
dim qTranscator
dim qmanufacture
dim qAccepter
if request.QueryString("Type"
<>""
then
set rs=server.createobject("adodb.recordset"
strSql="Select I_Task_Detail.D_SmokeID,I_Task_Detail.SmokeName,SUM(I_Task_Detail.D_Smoke_Amount) AS Num "
& _
"From I_Task_Detail Inner Join I_Task On I_Task.T_ID=I_Task_Detail.D_ID Where I_Task.T_Complete=2 "
if request.QueryString("Type"
="1" then
'直接查询
if trim(request.form("from_date"
)<>""
then
qfrom_date = Trim(request.form("from_date"
) '即将要进行下一页传递的参数
strSql=strSql & "
And I_Task.T_Date >'"
& trim(request.form("from_date"
) & "'"
end if
if trim(request.form("to_date"
)<>""
then
qto_date = Trim(request.form("to_date"
)
strSql=strSql & "
And I_Task.T_Date <'"
& trim(request.form("to_date"
) & "'"
end if
if trim(request.form("Transcator"
)<>""
then
qTranscator = Trim(request.form("Transcator"
)
strSql=strSql & "
And I_Task.T_Transcator='"
& trim(request.form("Transcator"
) & "'"
end if
if trim(request.form("manufacture"
)<>""
then
qmanufacture = Trim(request.form("manufacture"
)
strSql=strSql & "
And I_Task.T_Manufacturer='"
& trim(request.form("manufacture"
) & "'"
end if
if trim(request.form("Accepter"
)<>""
then
qAccepter = Trim(request.form("Accepter"
)
strSql=strSql & "
And I_Task.T_Accepter='"
& trim(request.form("Accepter"
) & "'"
end if
page=1
else
'分页显示
if trim(request.QueryString("qfrom_date"
)<>""
then
qfrom_date = Trim(request.QueryString("qfrom_date"
) '即将要进行下一页传递的参数
strSql=strSql & "
And I_Task.T_Date >'"
& trim(request.QueryString("qfrom_date"
) & "'"
end if
if trim(request.QueryString("qto_date"
)<>""
then
qto_date = Trim(request.QueryString("qto_date"
)
strSql=strSql & "
And I_Task.T_Date <'"
& trim(request.QueryString("qto_date"
) & "'"
end if
if trim(request.QueryString("qTranscator"
)<>""
then
qTranscator = Trim(request.QueryString("qTranscator"
)
strSql=strSql & "
And I_Task.T_Transcator='"
& trim(request.QueryString("qTranscator"
) & "'"
end if
if trim(request.QueryString("qmanufacture"
)<>""
then
qmanufacture = Trim(request.QueryString("qmanufacture"
)
strSql=strSql & "
And I_Task.T_Manufacturer='"
& trim(request.QueryString("qmanufacture"
) & "'"
end if
if trim(request.QueryString("qAccepter"
)<>""
then
qAccepter = Trim(request.QueryString("qAccepter"
)
strSql=strSql & "
And I_Task.T_Accepter='"
& trim(request.QueryString("qAccepter"
) & "'"
end if
if Request("Page"
<>""
then
Page = Cint(request.QueryString("Page"
)
else
Page =1
end if
end if
strSql=strSql & "
GROUP BY I_Task_Detail.D_SmokeID, I_Task_Detail.SmokeName "
strSql=StrSql & "
Order By Num Desc "
'显示SQL语句:response.write strSql
rs.open strSql,conn,1,1
if rs.recordCount <=0 then
response.write "没有找到数据!"
else
Total_RecordCount=rs.recordCount
rs.PageSize = Page_RecordCount
'判断页码
Page_Number=Int(Total_RecordCount / Page_RecordCount)
if (Total_RecordCount Mod Page_RecordCount) >0 then
Page_Number=Page_Number +1
else
Page_Number=Page_Number
end if
if Page >rs.PageCount then
'如果接收的页数大于总页数
rs.AbsolutePage =rs.PageCount '设置当前显示页等于最后页
else
if Page <= 0 then
'如果page小于等于0
Page = 1 '设置PAGE等于第一页
else
Rs.AbsolutePage = Page '如果大于零,显示当前页等于接收的页数
end if
For i = 1 to rs.PageSize
%>
<tr>
<td bgcolor="F8FEFD"
width="34%">
<div align="center"><%=trim(rs("D_SmokeID"
)%></div>
</td>
<td bgcolor="F8FEFD"
width="35%">
<div align="center"><%=trim(rs("SmokeName"
)%></div>
</td>
<td bgcolor="F8FEFD"
width="31%">
<div align="center"><%=trim(rs("Num"
)%></div>
</td>
</tr>
<%
Rs.MoveNext
if rs.EOF then
Exit For
Next
%>
</Table>
<%
if Cint(Page)>1 then
Response.Write "<a Href=Input_anasis.asp?Type=2&qfrom_date="
& qfrom_date & "&qto_date="
&qto_date& "&qTranscator="
& qTranscator & "&qmanufacture="
&qmanufacture& "&qAccepter="
&qAccepter& "&Page=1 Title=首页>首页</a>"
Response.Write "<a Href=Input_anasis.asp?Type=2&qfrom_date="
& qfrom_date & "&qto_date="
&qto_date& "&qTranscator="
& qTranscator & "&qmanufacture="
&qmanufacture& "&qAccepter="
&qAccepter& "&Page="
& Cint(Page)-1 & ">上一页</A>"
end if
if Cint(Page)<rs.pagecount then
Response.Write "<a Href=Input_anasis.asp?Type=2&qfrom_date="
& qfrom_date & "&qto_date="
&qto_date& "&qTranscator="
& qTranscator & "&qmanufacture="
&qmanufacture& "&qAccepter="
&qAccepter& "&Page="
& cint(Page)+1 & ">下一页</a>"
Response.Write "<a Href=Input_anasis.asp?Type=2&qfrom_date="
& qfrom_date & "&qto_date="
&qto_date& "&qTranscator="
& qTranscator & "&qmanufacture="
&qmanufacture& "&qAccepter="
&qAccepter& "&Page="
& rs.PageCount & ">尾页</a> "
end if
End if
rs.Close
Set rs=nothing
end if
end if
%>
<a> <div align="center"><font color="#990000">查询到数据记录共
<%Response.Write Total_RecordCount%>条,
共<%Response.Write Page_Number%>页!
当前是第<%Response.Write Page%>页!</font></div></a>
</body>
</html>