📄 checkorder_admin.asp
字号:
<!-- #include file="admin_protect.inc" -->
<!-- #include file="../adovbs.inc" -->
<!-- #include file="../opendb.inc" -->
<html>
<head>
<title>查看订单</title>
<meta http-equiv="Content-Type" content="text/html; chaRset=gb2312">
<script language="JavaScript">
<!--
function swapform()
{
document.form.submit();
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open(sqlOpenDB) '打开数据库
Set Rs=Server.CreateObject("ADODB.RecordSet")
Choise=0
If Request.QueryString.Count>0 Then Choise=Request.QueryString("select")
If Request.Form.Count>0 Then
Choise=Request.Form("select")
response.write choise
end if
If Choise=0 Then
Sql="Select OrderID,OrderDate From OrderToSupplier Where ReceivedDate Is Null" '取订单信息
Else
Sql="Select OrderID,OrderDate From OrderToSupplier Where ReceivedDate Is Not Null" '取订单信息
End If
Rs.Open Sql,Conn,adOpenStatic
Rs.PageSize=1
If Request.QueryString("Move")="" Then Session("CurrentPage")=1
If Request.QueryString("Move")="pre" Then Session("CurrentPage")=Session("CurrentPage")-1
If Request.QueryString("Move")="next" Then Session("CurrentPage")=Session("CurrentPage")+1
If Not Rs.Eof Then Rs.AbsolutePage=Session("CurrentPage")
%>
<%
If Request("Action")="send_order" Then
Date_Admin=Now
Conn.Execute "Update OrderToSupplier Set ReceivedDate='"&Date_Admin&"' Where OrderID='"&Rs("OrderID")&"' "
'
Number=Request("Number")
For i=0 To Number
ProductID=Request.Form("Product_Id"&i)
Num=Request.Form("Num"&i)
Conn.Execute "Update supplyOrderLine Set UnitsReceived='"&Num&"' Where OrderID='"&Rs("OrderID")&"'and ProductID='"&ProductID&"'"
Sql="Select * From Product Where ProductID='" & ProductID &"'"
Set Rs_Product=Conn.Execute(Sql)
Units=Rs_Product("UnitsInStock")
Units=Units+Num
Sql="Update Product Set UnitsInStock='" & Units & "' Where ProductID='" & ProductID & "'"
Conn.Execute(Sql)
Next
Response.Redirect "Success.Asp?Success=014"
End If
%>
<div align="center">
<table width="600" border="0" cellspacing="0">
<tr>
<td width="150"> </td>
<td>
<h2 align="center"><font face="华文彩云">订单情况 </font></h2>
</td>
<td width="150">
<form Name="form" method="post" action="checkorder_admin.asp" >
<select Name="select" onChange="swapform()">
<option value="0"<%If choise=0 Then%>selected<%End If%>>尚未处理的订单</option>
<option value="1"<%If choise=1 Then%>selected<%End If%>>已经发货的订单</option>
</select>
</form>
</td>
</tr>
</table>
<p><br>
<%
If Rs.Eof Then
Response.Write "<p><Center><B>此类订单为空</B></Center></p>"
Response.End
End If
%>
<%If Session("CurrentPage")>1 Then%>
<A Href="Checkorder_Admin.Asp?Move=pre&select=<%=choise%>">上一页</A>
<%Else%>
上一页
<%End If%>
<%If Session("CurrentPage")<Rs.PageCount Then%>
<A HREF="checkorder_admin.asp?Move=next&select=<%=choise%>">下一页</A>
<%else%>
下一页
<%End If%>
<%=Session("CurrentPage")%>/<%=Rs.PageCount%> </p>
<form method="POST" action="checkorder_admin.asp" Name="form1">
<table border="2" cellspacing="0" cellpadding="0" bordercolor="#666666" width="712">
<tr bordercolor="#FFFFFF">
<td colspan="5" nowrap height="20" width="561">
<div align="center">
<table width="500" border="0" cellspacing="0" cellpadding="0" height="20">
<tr>
<td width="95" nowrap><b>订单编号:</b></td>
<td width="132"><%=Rs("OrderID")%></td>
<td width="92" nowrap><b>提交时间:</b></td>
<td width="171"><%=Rs("OrderDate")%></td>
</tr>
</table>
</div>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="98" nowrap height="20">
<div align="center"><b>货物号码</b></div>
</td>
<td width="198" nowrap height="20">
<div align="center"><b>货物名称</b></div>
</td>
<td width="68" nowrap height="20">
<div align="center"><b>单价</b></div>
</td>
<td width="117" nowrap height="20">
<div align="center"><b>定购数量</b></div>
</td>
<td width="107" nowrap height="20">
<b>实际到货</b></td>
<td width="108" nowrap height="20">
<div align="center"><b>小计</b></div>
</td>
</tr>
<%
Sql="Select * From supplyOrderLine Where OrderID='" & Rs("OrderID") & "'"
Set RsOrder=Conn.Execute(Sql)
Total=0
i=0
%>
<input type="hidden" Name="number" value="<%=i%>">
<%
While Not RsOrder.Eof
Sql="Select Name,UnitPrice From Product Where ProductID='" & RsOrder("ProductID") & "'"
Set RsProduct=Conn.Execute(Sql)
%>
<tr>
<td width="98" nowrap height="20">
<div align="center"><%=RsOrder("ProductID")%></div>
<input type="hidden" Name="product_id<%=i%>" value="<%=RsOrder("ProductID")%>">
</td>
<td width="198" nowrap height="20">
<div align="center"><%=RsProduct("Name")%></div>
</td>
<td width="68" nowrap height="20">
<div align="center"><%=FormatCurrency(RsProduct("UnitPrice"))%></div>
</td>
<td width="117" nowrap height="20">
<div align="center"><%=RsOrder("UnitsOrdered")%></div>
</td>
<td width="107" nowrap height="20" align="right">
<input type="text" Name="num<%=i%>" size="20" value="<%=Rsorder("unitsreceived")%>"></td>
<td width="108" nowrap height="20" align="right">
<div align="right"><%=FormatCurrency(RsProduct("UnitPrice")*RsOrder("UnitsOrdered"))%> </div>
</td>
</tr>
<%
i=i+1
Total=Total+RsProduct("UnitPrice")*RsOrder("UnitsOrdered")
RsOrder.MoveNext
Wend
%>
<tr bgcolor="#CCCCCC">
<td width="98" nowrap height="20">
<div align="center"><b>共计:</b></div>
</td>
<td colspan="4" nowrap height="20" width="461"><b><%=FormatCurrency(total)%></b></td>
</tr>
</table>
<p><input type="submit" value="提交" Name="B1"></p>
<input type="hidden" Name="action" value="send_order">
</form>
<p> </p>
<p><%If Session("CurrentPage")>1 Then%>
<A HREF="checkorder_admin.asp?move=pre&select=<%=choise%>">上一页</A> <%else%>上一页 <%End If%>
<%If Session("CurrentPage")<Rs.PageCount Then%>
<A HREF="checkorder_admin.asp?move=next&select=<%=choise%>">下一页</A> <%else%>下一页<%End If%>
<%=Session("CurrentPage")%>/<%=Rs.PageCount%> <br>
</p></div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -