<!-- #include file="include/con_user.asp" -->
<!-- #include file="include/jk_pagecute.asp" -->
<!-- #include file="include/jk_page_cute.asp" -->
<%

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 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 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>&nbsp;消费时间&nbsp;</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>&nbsp;<%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%>&nbsp;页次：<font class=red><%response.write viewpage&"</font>/<font class=red>"&thepages%></font>&nbsp;分页：<% response.write jk_pagecute(nummer,thepages,viewpage,pageurl,3,"#ff0000") %></td></tr>
</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>&nbsp;购买时间&nbsp;</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>&nbsp;<%response.write img_emoney%></td>
<td align=right><%response.write rs("e_amount")%>&nbsp;<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%>&nbsp;页次：<font class=red><%response.write viewpage&"</font>/<font class=red>"&thepages%></font>&nbsp;分页：<% response.write jk_pagecute(nummer,thepages,viewpage,pageurl,3,"#ff0000") %></td></tr>
</table>
<%
end sub
%>