porder.asp
上传用户:syzzy1975
上传日期:2022-07-17
资源大小:670k
文件大小:10k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <%
  3. %><!--#include file="inc/config.asp"-->
  4. <!--#include file="inc/conn.asp"--> 
  5. <!--#include file="inc/chk.asp"--> 
  6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  7. <html>
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  10. <title>406网络书店</title>
  11. <link href="../style.css" rel="stylesheet" type="text/css">
  12. </head>
  13. <body>
  14. <!--#include file="head.htm"-->
  15. <table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  16.   <tr>
  17.     <td width="219" align="left" valign="top"><br>
  18.       <!--#include file="menu.htm"-->
  19.         <br></td><td width="561" align="left" valign="top">
  20.       <br>      <table border="0" cellpadding="0" cellspacing="0">
  21.         <tr>
  22.           <td><img src="../images/w.gif" width="18" height="18"></td>
  23.           <td style="color:#415373">商品订单</td>
  24.         </tr>
  25.       </table>      <br>      <%
  26.   dim state,namekey
  27. namekey=trim(request("namekey"))
  28. state=trim(request("state"))
  29. if state="" then state=request.QueryString("state")
  30. if namekey="" then namekey=request.querystring("namekey")
  31. %>      <table width="90%" border="0" align="center" cellpadding="2" cellspacing="1">
  32.         <tr>
  33.           <td align="right">
  34.             <select name="select" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" >
  35.               <base target=Right>
  36.               <option value="porder.asp?state=0" >全部订单状态</option>
  37.               <option value="porder.asp?state=1" >未作任何处理</option>
  38.               <option value="porder.asp?state=2" >用户已经划出款</option>
  39.               <option value="porder.asp?state=3" >服务商已经收到款</option>
  40.               <option value="porder.asp?state=4" >服务商已经发货</option>
  41.               <option value="porder.asp?state=5" >用户已经收到货</option>
  42.             </select>
  43.           </td>
  44.         </tr>
  45.       </table>      <%
  46. Const MaxPerPage=12 
  47.     dim totalPut   
  48.     dim CurrentPage
  49.     dim TotalPages
  50.     dim j
  51.     dim sql
  52.      if Not isempty(request("page")) then
  53.        currentPage=Cint(request("page"))
  54.     else
  55.        currentPage=1
  56.     end if 
  57. set rs=server.CreateObject("adodb.recordset")
  58. if namekey="" then
  59. if state=0 or state="" then
  60. select case state
  61. case "0"
  62.   rs.open "select distinct(goods),userid,realname,actiondate,deliverymethord,paymethord,state from orders where state<6 order by actiondate desc",conn,1,1
  63.   case ""
  64.   rs.open "select distinct(goods),userid,realname,actiondate,deliverymethord,paymethord,state from orders where state<5 order by actiondate desc",conn,1,1
  65.   end select
  66.   else
  67.   rs.open "select distinct(goods),userid,realname,actiondate,deliverymethord,paymethord,state from orders where  state="&state&" order by actiondate",conn,1,1
  68.   end if
  69.   else
  70.   '//按用户查询
  71.   if state=0 or state="" then
  72.   rs.open "select distinct(goods),userid,realname,actiondate,deliverymethord,paymethord,state from orders where state<5 and username='"&namekey&"' order by actiondate desc",conn,1,1
  73.   else
  74.   rs.open "select distinct(goods),userid,realname,actiondate,deliverymethord,paymethord,state from orders where  state="&state&" and username='"&namekey&"'  order by actiondate",conn,1,1
  75.   end if
  76.   end if
  77.   
  78. if err.number<>0 then
  79. response.write "数据库中无数据"
  80. end if
  81.    if rs.eof And rs.bof then
  82.         Response.Write "<p align='center' class='contents'> 对不起,您选择的状态目前还没有订单!</p>"
  83.     else
  84.    totalPut=rs.recordcount
  85.        if currentpage<1 then
  86.            currentpage=1
  87.        end if
  88.        if (currentpage-1)*MaxPerPage>totalput then
  89.     if (totalPut mod MaxPerPage)=0 then
  90.       currentpage= totalPut  MaxPerPage
  91.     else
  92.        currentpage= totalPut  MaxPerPage + 1
  93.     end if
  94.        end if
  95.         if currentPage=1 then
  96.              showContent
  97.              showpage totalput,MaxPerPage,"porder.asp"
  98.         else
  99.            if (currentPage-1)*MaxPerPage<totalPut then
  100.              rs.move  (currentPage-1)*MaxPerPage
  101.              dim bookmark
  102.              bookmark=rs.bookmark
  103.              showContent
  104.               showpage totalput,MaxPerPage,"porder.asp"
  105.          else
  106.          currentPage=1
  107.             showContent
  108.             showpage totalput,MaxPerPage,"porder.asp"
  109.        end if
  110.     end if
  111.         end if
  112.     sub showContent
  113.         dim i
  114.     i=0
  115. %>      <table width="100%" border="0" align="center" cellpadding="2" cellspacing="2">
  116.         <tr bgcolor="#FFFFFF" align="center">
  117.           <td>订单号</td>
  118.           <td>下单用户</td>
  119.           <td>订货人姓名</td>
  120.           <td> 付款方式</td>
  121.           <td> 收货方式</td>
  122.           <td > 订单状态</td>
  123.         </tr>
  124.         <%do while not rs.eof
  125. dim shop,username
  126.   set shop=server.CreateObject("adodb.recordset")
  127.   shop.open "select username from [user] where userid="&rs("userid"),conn,1,1
  128.   username=trim(shop("username"))
  129.   shop.close
  130.   set shop=nothing
  131.   %>
  132.         <tr bgcolor="#FFFFFF" align="center">
  133.           <td align="left">&nbsp;<a href="vorder.asp?dan=<%=trim(rs("goods"))%>&username=<%=username%>"><%=trim(rs("goods"))%></a></td>
  134.           <td><%=username%></td>
  135.           <td><%=trim(rs("realname"))%></td>
  136.           <td>
  137.             <%dim rs2
  138.           set rs2=server.CreateObject("adodb.recordset")
  139.           rs2.open "select * from delivery where deliveryid="&int(rs("paymethord")),conn,1,1
  140.   if rs2.eof and rs2.bof then
  141.   response.write "方式已被删除"
  142.   else
  143.           response.Write trim(rs2("subject"))
  144.           end if
  145.   rs2.Close
  146.           set rs2=nothing
  147.           %>
  148.           </td>
  149.           <td>
  150.             <%
  151.           set rs2=server.CreateObject("adodb.recordset")
  152.           rs2.Open "select * from delivery where deliveryid="&int(rs("deliverymethord")),conn,1,1
  153.   if rs2.eof and rs2.bof then
  154.   response.write "方式已被删除"
  155.   else
  156.           response.Write trim(rs2("subject"))
  157.           end if
  158.   rs2.close
  159.           set rs2=nothing%>
  160.           </td>
  161.           <td>
  162.             <%
  163.   select case rs("state")
  164. case "1"
  165. response.write "未作任何处理"
  166. case "2"
  167. response.write "用户已经划出款"
  168. case "3"
  169. response.write "服务商已经收到款"
  170. case "4"
  171. response.write "服务商已经发货"
  172. case "5"
  173. response.write "用户已经收到货"
  174. end select%>
  175.           </td>
  176.         </tr>
  177.         <%i=i+1
  178. if i>=MaxPerPage then Exit Do
  179. rs.movenext
  180. loop
  181. rs.close
  182. set rs=nothing%>
  183.       </table>      <%  
  184. End Sub   
  185.   
  186. Function showpage(totalnumber,maxperpage,filename)  
  187.    Dim n
  188.   
  189. If totalnumber Mod maxperpage=0 Then  
  190. n= totalnumber  maxperpage  
  191. Else
  192. n= totalnumber  maxperpage+1  
  193. End If
  194. if namekey="" then
  195. Response.Write "<form method=Post action="&filename&"?state="&state&">"  
  196. else
  197. Response.Write "<form method=Post action="&filename&"?state="&state&"&namekey="&namekey&">" 
  198. end if
  199. Response.Write "<p align='center' class='contents'> "  
  200. If CurrentPage<2 Then  
  201. Response.Write "<font class='contents'>首页 上一页</font> "  
  202. Else  
  203. if namekey="" then
  204. Response.Write "<a href="&filename&"?page=1&state="&state&" class='contents'>首页</a> "  
  205. Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&state="&state&" class='contents'>上一页</a> "  
  206. ELSE
  207. Response.Write "<a href="&filename&"?page=1&state="&state&"&namekey="&namekey&" class='contents'>首页</a> "  
  208. Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&state="&state&"&namekey="&namekey&" class='contents'>上一页</a> "
  209. end if  
  210. End If
  211. If n-currentpage<1 Then  
  212. Response.Write "<font class='contents'>下一页 尾页</font>"  
  213. Else 
  214. if namekey="" then
  215. Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&state="&state&" class='contents'>"  
  216. Response.Write "下一页</a> <a href="&filename&"?page="&n&"&state="&state&" class='contents'>尾页</a>"
  217. else
  218. Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&state="&state&"&namekey="&namekey&" class='contents'>"  
  219. Response.Write "下一页</a> <a href="&filename&"?page="&n&"&state="&state&"&namekey="&namekey&" class='contents'>尾页</a>" 
  220. end if 
  221. End If  
  222. Response.Write "<font class='contents'> 页次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "  
  223. Response.Write "<font class='contents'> 共有"&totalnumber&"笔订单 "&maxperpage&"笔订单/页</font> " 
  224. Response.Write "<font class='contents'>转到:</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="&currentpage&">"  
  225. Response.Write "&nbsp;<input type='submit'  class='contents' value='GO' name='cndok'></form>"  
  226. End Function  
  227. %>      <br>      <table border="0" align="left" cellpadding="0" cellspacing="0">
  228.         <tr>
  229.           <td><img src="../images/w.gif" width="18" height="18"></td>
  230.           <td style="color:#415373">订单查找</td>
  231.         </tr>
  232.       </table>      <br>      <br>   <form name="form1" method="post" action="">
  233.         <table width="80%" border="0" align="left" cellpadding="1" cellspacing="1">
  234.           <tr align="center">
  235.             
  236.             <td>按下单用户查询
  237.                 <input name="namekey" type="text" id="namekey" value="请输入用户名" size="14" onFocus="this.value=''">
  238.                 <select name="state" id="select2">
  239.                   <option value="0" >全部订单状态</option>
  240.                   <option value="1" >未作任何处理</option>
  241.                   <option value="2" >用户已经划出款</option>
  242.                   <option value="3" >服务商已经收到款</option>
  243.                   <option value="4" >服务商已经发货</option>
  244.                   <option value="5" >用户已经收到货</option>
  245.                 </select>
  246. &nbsp;
  247.           <input type="submit" name="Submit" value="查 询">
  248.             </td>
  249.             
  250.         </tr>
  251.         </table>
  252.     </form>   <br>
  253.       </td>
  254.   </tr>
  255. </table>
  256. <!--#include file="foot.htm"-->
  257. </body>
  258. </html>