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

📄 checkorder.asp

📁 asp入门之进销存管理系统,进销存管理系统网页例程,ASP源码,SQL Server2000,欢迎使用本进销存管理系统!
💻 ASP
字号:
<!-- #include virtual="protect.inc" -->
<!-- #include file="opendb.inc" -->
<!-- #include virtual="adovbs.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")
Set Rs=Server.CreateObject("ADODB.RecordSet")
Conn.Open(sqlOpenDB)	 	'打开数据库

Choise=0
If Request.QueryString.Count>0 Then Choise=Request.QueryString("select")
If Request.Form.Count>0 Then	Choise=Request.Form("Select")
Sql="Select OrderID,OrderDate From OrderFromCustomer Where CustomerName = '" & Session("User") & "' And Done = '" & Choise & "' Order By OrderDate Desc"	'取订单信息
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")
%>
<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.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>"	
	Rs.Close
	Set Rs=Nothing
	Conn.Close
	Set Conn=Nothing
	Response.End
End If
%>
    <%If Session("CurrentPage")>1 Then%>
    <a href="checkorder.asp?move=pre&select=<%=choise%>">上一页</a> 
    <%Else%>
    上一页 
    <%End If%>
    &nbsp; 
    <%If Session("CurrentPage")<Rs.PageCount  Then%>
    <a href="checkorder.asp?move=next&select=<%=choise%>">下一页</a> 
    <%Else%>
    下一页
    <%End If%>
    &nbsp; <%=Session("CurrentPage")%>/<%=Rs.PageCount%> </p>
  <table border="2" cellspacing="0" cellpadding="0" bordercolor="#666666">
    <tr bordercolor="#FFFFFF"> 
      <td colspan="5" nowrap height="20"> 
        <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" nowrap><%=Rs("OrderID")%></td>
              <td width="92" nowrap><b>提交时间:</b></td>
              <td width="171" nowrap><%=Rs("OrderDate")%></td>
            </tr>
          </table>
        </div>
      </td>
    </tr>
    <tr bgcolor="#CCCCCC"> 
      <td width="80" nowrap height="20"> 
        <div align="center"><b>货物号码</b></div>
      </td>
      <td width="200" nowrap height="20"> 
        <div align="center"><b>货物名称</b></div>
      </td>
      <td width="70" nowrap height="20"> 
        <div align="center"><b>单价</b></div>
      </td>
      <td width="80" nowrap height="20"> 
        <div align="center"><b>定购数量</b></div>
      </td>
      <td width="70" nowrap height="20"> 
        <div align="center"><b>小计</b></div>
      </td>
    </tr>
<%
Sql="Select ProductID,UnitsOrdered From OrderLine Where OrderID='" & rs("OrderID") & "'"
Set rsOrder=Conn.Execute(Sql)
Total=0
While Not rsOrder.Eof 
	Sql="Select Name,UnitPrice From Product Where ProductID='" & rsOrder("ProductID") & "'"
	Set rsProduct=Conn.Execute(Sql)
%>
    <tr> 
      <td width="80" nowrap height="20"> 
        <div align="center"><%=rsOrder("ProductID")%></div>
      </td>
      <td width="200" nowrap height="20"> 
        <div align="center"><%=rsProduct("Name")%></div>
      </td>
      <td width="70" nowrap height="20"> 
        <div align="center"><%=FormatCurrency(rsProduct("UnitPrice"))%></div>
      </td>
      <td width="80" nowrap height="20"> 
        <div align="center"><%=rsOrder("UnitsOrdered")%></div>
      </td>
      <td width="70" nowrap height="20" align="right"> 
        <div align="right"><%=FormatCurrency(rsProduct("UnitPrice")*rsOrder("UnitsOrdered"))%> </div>
      </td>
    </tr>
    <%
Total=Total+rsProduct("UnitPrice")*rsOrder("UnitsOrdered")
RsOrder.MoveNext
Wend
rsProduct.Close
Set rsProduct=Nothing
rsOrder.Close
Set rsOrder=Nothing
%>
    <tr bgcolor="#CCCCCC"> 
      <td width="100" nowrap height="20"> 
        <div align="center"><b>共计:</b></div>
      </td>
      <td colspan="4" nowrap height="20"><b><%=FormatCurrency(total)%></b></td>
    </tr>
  </table>
 <p><%If Session("CurrentPage")>1 Then%>
 <A HREF="checkorder.asp?move=pre&select=<%=choise%>">上一页</A>	<%Else%>上一页	<%End If%>&nbsp;
<%If Session("CurrentPage")<Rs.PageCount  Then%>
<A HREF="checkorder.asp?move=next&select=<%=choise%>">下一页</A>	 <%Else%>下一页 <%End If%>&nbsp;
<%=Session("CurrentPage")%>/<%=Rs.PageCount%>  <br>
</p></div>
</body>
<%
Rs.Close
Set Rs=Nothing
Conn.Close
Set Conn=Nothing
%>
</html>

⌨️ 快捷键说明

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