在线商城的订单定向查询


为了解决用户购物订单号遗忘的问题,在线商城可增加一个“订单记录查询”
在“用户中心”→“金融中心”的栏目里加一个“订单记录”

即在include/con_use.asp67行后面加上
   <tr>
    <td><img src='<%response.write joekoe_cms.web_dir_skin%>/main/user_jt_emoney.gif' border=0></td>
    <td><a href='user_emoney_note.asp?action=query'>订单记录</a></td>
    </tr>

并将user_emoney_note.asp改为(蓝色部分为添加部分)

<!-- #include file="include/con_user.asp" -->
<!-- #include file="include/jk_pagecute.asp" -->
<!-- #include file="include/jk_page_cute.asp" -->
<%
'****************************************************
' Joekoe CMS 1.2 Free      Power by Joekoe.com
' Email: cms@joekoe.com , service@joekoe.com
' Web: http://www.joekoe.com , http://www.topv.com
' Copyright (C) 2004 Joekoe.com All Rights Reserved.
'****************************************************

dim nummer,nums,rssum,page,viewpage,thepages,pageurl,nsdim,nsnum
nsnum=-1
nummer=dim_num(0)
nums=nummer
page=1
select case action
case "pay"
  tit="购买记录"
case "query"  
  tit="订单记录"
case else
  action="consume"
  tit="消费记录"
end select
pageurl="?action="&action&"&"
call web_head(2,0,0,0,0)
'----------------------------左边 开始----------------------------
call user_left("")
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------
%>
<table border=0 cellspacing=0 cellpadding=0 width='100%'>
<tr align=center valign=top>
<td width='80%'>
<%
select case action
case "pay"
  call emoney_note_pay()
case "query"  
  call emoney_note_query()
case else
  call emoney_note_consume()
end select
%>
</td>
<td>
  <table border=0>
  <tr><td height=50><a href='?action=consume'><img src='<%response.write joekoe_cms.web_dir_skin%>main/emoney_note_consume.gif' border=0></a></td></tr>
  <tr><td height=50><a href='?action=pay'><img src='<%response.write joekoe_cms.web_dir_skin%>main/emoney_note_pay.gif' border=0></a></td></tr>
  </tr>
  </table>
</td>
</tr>
<%
if isarray(nsdim) then erase nsdim
response.write ukong
'----------------------------中间 结束----------------------------
call web_end(0,0)

sub emoney_note_load()
  sql="select m_nsort,m_tit_fir from admin_menu where m_nsort<>'' order by m_id"
  set rs=joekoe_cms.exec(sql,1)
  if not rs.eof then
    nsdim=rs.getrows()
    nsnum=ubound(nsdim,2)
  end if
  rs.close
end sub

function note_nsort(nvar)
  dim ni,temp1
  temp1="未知"
  for ni=0 to nsnum
    if nsdim(0,ni)=nvar then
      temp1=nsdim(1,ni)
      exit for
    end if
  next
  note_nsort=temp1
end function

sub emoney_note_consume()
  call emoney_note_load()
  dim nsort,iid,tim,vurl
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr align=center>
<td width='9%' class=td0>序号</td>
<td width='20%' class=td0>消费类型</td>
<td width='20%' class=td0>消费代码</td>
<td width='12%' class=td0>数量</td>
<td width='29%' class=td0> 消费时间 </td>
<td width='10%' class=td0>浏览</td>
</tr>
<%
  sql="select count(id) from notes where username='"&login_username&"'"
  set rs=joekoe_cms.exec(sql,1)
  rssum=rs(0)
  rs.close
  call format_pagecute()
  sql="select top "&nummer*viewpage&" * from notes where username='"&login_username&"' order by id desc"
  call joekoe_cms.exec("",-1)
  rs.open sql,conn,1,1
  if int(viewpage)>1 then rs.move (viewpage-1)*nummer
  if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
  for i=1 to nums
    nsort=rs("nsort")
    iid=rs("iid")
    tim=rs("tim")
    select case nsort
    case "gall","paste","flash","film"
      vurl="gallery_view.asp?id="&iid
    case "art"
      vurl="article_view.asp?id="&iid      
    case else
      vurl=nsort&"_view.asp?id="&iid
    end select
%>
<tr class=bg_td align=center>
<td class=tims><%response.write (viewpage-1)*nummer+i%></td>
<td><%response.write note_nsort(nsort)%></td>
<td class=gray><%response.write nsort%></td>
<td align=right><font class=red2><b><%response.write rs("emoney")%></b></font> <%response.write img_emoney%></td>
<td><font alt='<%response.write joekoe_cms.time_type(tim,2)%>' class=tims><%response.write joekoe_cms.time_type(tim,1)%></font></td>
<td><a href='<%response.write vurl%>' target=_blank alt='栏目ID:<%response.write iid%>'>浏览</a></td>
</tr>
<%
    rs.movenext
  next
  rs.close
%>
<tr class=bg_tds height=30>
<td colspan=6>共有<font class=red><%response.write rssum%></font>条<%response.write tit%> 页次:<font class=red><%response.write viewpage&"</font>/<font class=red>"&thepages%></font> 分页:<% response.write jk_pagecute(nummer,thepages,viewpage,pageurl,3,"#ff0000") %></td></tr>
</table>
<%
end sub

sub emoney_note_query()
%>
  <table cellspacing=1 cellpadding=4 class=table>
  <tr align=center>
  <td class=td width='8%'>序号</td>
  <td class=td width='22%'>订单号</td>
  <td class=td width='14%'>收货人</td>
  <td class=td width='8%'>金额</td>
  <td class=td width='12%'>订购时间</td>
  <td class=td width='12%'>支付否</td>
  <td class=td width='8%'>查看</td>
  </tr>
<%
  dim tim,ordernum
  i=1
  sql="select id,ordernum,nname,tim,prices,ispayment,ispay from shop_orders where username='"&login_username&"' order by id desc"
  set rs=joekoe_cms.exec(sql,1)
  do while not rs.eof
    ordernum=rs("ordernum")
    tim=rs("tim")
%>
  <tr class=bg_td align=center>
  <td><%response.write i%></td>
  <td align=left><a href='shop_order_view.asp?ordernum=<%response.write ordernum%>'><%response.write ordernum%></a></td>
  <td align=left><%response.write rs("nname")%></td>
  <td align=right><%response.write rs("prices")%></td>
  <td><font alt='<%response.write joekoe_cms.time_type(tim,2)%>' class=tims><%response.write joekoe_cms.time_type(tim,3)%></td>
  <td>
<%
    if rs("ispay") then
      response.write "<font class=red>已支付</font>"
    else
      response.write "<font class=gray>未支付</font>"
    end if
%>
  </td>
  <td><a href='shop_order_view.asp?ordernum=<%response.write ordernum%>'>详细</a></td>
  </tr>
<%
    i=i+1
    rs.movenext
  loop
  rs.close
%>
  </table>
<%
end sub

sub emoney_note_pay()
  dim tim,e_ispay,e_ptim
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr align=center>
<td width='9%' class=td0>序号</td>
<td width='20%' class=td0>购买订单号</td>
<td width='16%' class=td0>购买数量</td>
<td width='16%' class=td0>购买花费</td>
<td width='26%' class=td0> 购买时间 </td>
<td width='13%' class=td0>支付否</td>
</tr>
<%
  sql="select count(e_id) from notes_emoney where e_username='"&login_username&"'"
  set rs=joekoe_cms.exec(sql,1)
  rssum=rs(0)
  rs.close
  call format_pagecute()
  sql="select top "&nummer*viewpage&" * from notes_emoney where e_username='"&login_username&"' order by e_id desc"
  call joekoe_cms.exec("",-1)
  rs.open sql,conn,1,1
  if int(viewpage)>1 then rs.move (viewpage-1)*nummer
  if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
  for i=1 to nums
    tim=rs("e_tim")
    e_ispay=rs("e_ispay")
    e_ptim=rs("e_ptim")
%>
<tr align=center class=bg_td>
<td class=tims><%response.write (viewpage-1)*nummer+i%></td>
<td><%
    if e_ispay then response.write "<font class=blue>"
    response.write rs("e_ordernum")
%></td>
<td align=right><font class=red2><%response.write rs("e_emoney")%></font> <%response.write img_emoney%></td>
<td align=right><%response.write rs("e_amount")%> <font class=gray>元</font></td>
<td><%
    if e_ispay then
      response.write "<font class=red alt='支付时间:"&joekoe_cms.time_type(e_ptim,2)&"<br><font class=gray>购买时间:"&joekoe_cms.time_type(tim,2)&"</font>'>"&joekoe_cms.time_type(e_ptim,3)&"</font>"
    else
      response.write "<font alt='购买时间:"&joekoe_cms.time_type(tim,2)&"'>"&joekoe_cms.time_type(tim,3)&"</font>"
    end if
%></td>
<td><%
    if e_ispay then
      response.write "<font class=red>已支付</font>"
    else
      response.write "<font class=gray>未支付</font>"
    end if
%></td>
</tr>
<%
    rs.movenext
  next
  rs.close
%>
<tr class=bg_tds height=30>
<td colspan=6>共有<font class=red><%response.write rssum%></font>条<%response.write tit%> 页次:<font class=red><%response.write viewpage&"</font>/<font class=red>"&thepages%></font> 分页:<% response.write jk_pagecute(nummer,thepages,viewpage,pageurl,3,"#ff0000") %></td></tr>
</table>
<%
end sub

'****************************************************
' Joekoe CMS 1.2 Free      Power by Joekoe.com
' Email: cms@joekoe.com , service@joekoe.com
' Web: http://www.joekoe.com , http://www.topv.com
' Copyright (C) 2004 Joekoe.com All Rights Reserved.
'****************************************************
%>

文章来自: Original
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 8 | 引用: 0 | 查看次数: 1078
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 20 字 | UBB代码 关闭 | [img]标签 关闭