<!-- #Include File="Con_User.asp" -->
<!-- #Include File="../Include/Cls_pagecute.asp" -->
<%
'=======================================================
' 欢迎使用《阿赛大型门户网站系统V3.0》，简称“AsaiMHV3”
' 技术支持、商业版咨询、官方唯一指定联系QQ“4941172”
' 官方网站：http://77ya.com      程序负责人：阿赛
'=======================================================

dim nsnum,nsdim
nsnum=-1
select case action
case "pay"
  tit="购买记录"
case "query"
  tit="订单记录"
case "query2"
  tit="订单记录("&Cls.web_unit&")"
case "card"
  tit="会员卡记录"
case else
  action="consume"
  tit="消费记录"
end select
pageurl="?action="&action&"&"

call DoWebHead(2,0)
'----------------------------左边 开始----------------------------
'----------------------------左边 结束----------------------------
'----------------------------中间 开始----------------------------
call emoney_note_main()
if isarray(nsdim) then erase nsdim
'----------------------------中间 结束----------------------------
call DoWebEnd()

sub emoney_note_main()
dim sTmp
select case action
case "pay"
  sTmp=sTmp& emoney_note_pay()
case "query"
  sTmp=sTmp& emoney_note_query()
case "query2"
  sTmp=sTmp& emoney_note_query2()
case "card"
  sTmp=sTmp& emoney_note_card()
case else
  sTmp=sTmp& emoney_note_consume()
end select
    Cls.HtmlRcod "body",Cls.ReadTemplate("user_EmoneyNote")
	Cls.HtmlRcod "body",sTmp
	Cls.HtmlRcod "tit",tit
	Cls.HtmlRcod "dir_skin",Cls.web_skindir
	Cls.OutPage
End Sub

sub emoney_note_load()
  sql="select ChannelDir,ChannelTit from AsaiMHChannel where ChannelDir<>'' order by ChannelIDs"
  set rs=Cls.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

Function emoney_note_consume()
  call emoney_note_load()
  dim nsort,iid,tim,sTmp
sTmp= "<table cellspacing=1 cellpadding=4 class=table>" & _
vbcrlf&"<tr align=center>" & _
vbcrlf&"<td width='9%' class=td>序号</td>" & _
vbcrlf&"<td width='20%' class=td>消费类型</td>" & _
vbcrlf&"<td width='20%' class=td>消费代码</td>" & _
vbcrlf&"<td width='12%' class=td>数量</td>" & _
vbcrlf&"<td width='29%' class=td>&nbsp;消费时间&nbsp;</td>" & _
vbcrlf&"<td width='10%' class=td>浏览</td>" & _
vbcrlf&"</tr>"
	Dim obj_page
	Set obj_page=new Cls_PageCute
	obj_page.pageurl=pageurl		
	obj_page.nummer=20						
	obj_page.page_t=1									
	obj_page.page_p=5									
	obj_page.page_unit="条"
	obj_page.page_tit=tit
	obj_page.v_id="id"
	Call obj_page.p_init("*","AsaiMHNotes","username='"&login_username&"'","id desc")
	SQL = obj_page.sql_count
	Set rs=Cls.Exec(SQL,1)
	obj_page.rssum=rs(0)
	Rs.Close
	Call obj_page.p_main("*","AsaiMHNotes","username='"&login_username&"'","id desc")
	For i=1 To obj_page.page_num
    nsort=rs("nsort")
    iid=rs("iid")
    tim=rs("tim")
sTmp=sTmp&"<tr class=tr align=center>" & _
vbcrlf&"<td class=tims>"&i+obj_page.page_now&"</td>" & _
vbcrlf&"<td>"&note_nsort(nsort)&"</td>" & _
vbcrlf&"<td class=Gys>"&nsort&"</td>" & _
vbcrlf&"<td align=right><font class=red2><b>"&rs("emoney")&"</b></font>&nbsp;"&Cls.web_unit&"</td>" & _
vbcrlf&"<td><font title='"&Cls.time_type(tim,2)&"' class=tims>"&Cls.time_type(tim,1)&"</font></td>" & _
vbcrlf&"<td><a href='"&Cls.Web_Dir&""&nsort&"/View.asp?id="&iid&"' target=_blank title='栏目ID："&iid&"'>浏览</a></td>" & _
vbcrlf&"</tr>"
    rs.movenext
  next
  rs.close
sTmp=sTmp&"<tr><td class=trs colspan=6>" & _
vbcrlf&"<table border=0 cellspacing=0 cellpadding=2>" & _
vbcrlf&"<tr>" & _
vbcrlf&"<td>"&obj_page.page_var&"</td>" & _
vbcrlf&"<td width=3></td>" & _
vbcrlf&"<td>分页：</td>" & _
vbcrlf&"<td>"&obj_page.page_cute&obj_page.page_shortcut&"</td>" & _
vbcrlf&"</tr>" & _
vbcrlf&"</table>" & _
vbcrlf&"</td>" & _
vbcrlf&"</tr>" & _
vbcrlf&"</table>"
emoney_note_consume=sTmp
End Function

Function emoney_note_pay()
  dim tim,e_ispay,e_ptim,sTmp
sTmp= "<table cellspacing=1 cellpadding=4 class=table>" & _
vbcrlf&"<tr class=tr align=center>" & _
vbcrlf&"<td width='9%' class=td>序号</td>" & _
vbcrlf&"<td width='20%' class=td>购买订单号</td>" & _
vbcrlf&"<td width='16%' class=td>购买数量</td>" & _
vbcrlf&"<td width='16%' class=td>购买花费</td>" & _
vbcrlf&"<td width='26%' class=td>购买时间</td>" & _
vbcrlf&"<td width='13%' class=td>支付否</td>" & _
vbcrlf&"</tr>"
	Dim obj_page
	Set obj_page=new Cls_PageCute
	obj_page.pageurl=pageurl		
	obj_page.nummer=20						
	obj_page.page_t=1									
	obj_page.page_p=5									
	obj_page.page_unit="条"
	obj_page.page_tit=tit
	obj_page.v_id="e_id"
	Call obj_page.p_init("*","AsaiMHNotesEmoney","e_username='"&login_username&"'","e_id desc")
	SQL = obj_page.sql_count
	Set rs=Cls.Exec(SQL,1)
	obj_page.rssum=rs(0)
	Rs.Close
	Call obj_page.p_main("*","AsaiMHNotesEmoney","e_username='"&login_username&"'","e_id desc")
	For i=1 To obj_page.page_num
    tim=rs("e_tim")
    e_ispay=rs("e_ispay")
    e_ptim=rs("e_ptim")
sTmp=sTmp&"<tr align=center class=tr>" & _
vbcrlf&"<td class=tims>"&i+obj_page.page_now&"</td>" & _
vbcrlf&"<td>"
  if e_ispay then sTmp=sTmp&"<font class=blue>"
    sTmp=sTmp& rs("e_ordernum")
sTmp=sTmp&"</td>" & _
vbcrlf&"<td align=right><font class=red2>"&rs("e_emoney")&"</font>&nbsp;<img src='"&Cls.web_skindir&"sys/emoney.gIf' border=0 width=14 title='"&Cls.web_unit&"支付' align=absmiddle></td>" & _
vbcrlf&"<td align=right>"&rs("e_amount")&"&nbsp;<font class=Gys>元</font></td>" & _
vbcrlf&"<td>"
    if e_ispay then
      sTmp=sTmp&"<font class=red title='支付时间："&Cls.time_type(e_ptim,2)&"<br /><font class=Gys>购买时间："&Cls.time_type(tim,2)&"</font>'>"&Cls.time_type(e_ptim,3)&"</font>"
    else
      sTmp=sTmp&"<font title='购买时间："&Cls.time_type(tim,2)&"'>"&Cls.time_type(tim,3)&"</font>"
    End If
sTmp=sTmp&"</td><td>"
    if e_ispay then
      sTmp=sTmp&"<font class=red>已支付</font>"
    else
      sTmp=sTmp&"<font class=Gys>未支付</font>"
    End If
sTmp=sTmp&"</td></tr>"
    rs.movenext
  next
  rs.close
sTmp=sTmp&"<tr><td class=trs colspan=6>" & _
vbcrlf&"<table border=0 cellspacing=0 cellpadding=2>" & _
vbcrlf&"<tr>" & _
vbcrlf&"<td>"&obj_page.page_var&"</td>" & _
vbcrlf&"<td width=3></td>" & _
vbcrlf&"<td>分页：</td>" & _
vbcrlf&"<td>"&obj_page.page_cute&obj_page.page_shortcut&"</td>" & _
vbcrlf&"</tr>" & _
vbcrlf&"</table>" & _
vbcrlf&"</td>" & _
vbcrlf&"</tr>" & _
vbcrlf&"</table>"
emoney_note_pay=sTmp
End Function

Function emoney_note_query()
dim ordernum,tim,sTmp
sTmp= "<table cellspacing=1 cellpadding=4 class=table>" & _
vbcrlf&"<tr align=center>" & _
vbcrlf&"<td class=td width='8%'>序号</td>" & _
vbcrlf&"<td class=td width='22%'>订单号</td>" & _
vbcrlf&"<td class=td width='14%'>收货人</td>" & _
vbcrlf&"<td class=td width='8%'>金额</td>" & _
vbcrlf&"<td class=td width='12%'>订购时间</td>" & _
vbcrlf&"<td class=td width='12%'>支付否</td>" & _
vbcrlf&"<td class=td width='8%'>查看</td>" & _
vbcrlf&"</tr>"
	Dim obj_page
	Set obj_page=new Cls_PageCute
	obj_page.pageurl=pageurl		
	obj_page.nummer=20						
	obj_page.page_t=1									
	obj_page.page_p=5									
	obj_page.page_unit="条"
	obj_page.page_tit=tit
	obj_page.v_id="id"
	Call obj_page.p_init("*","AsaiMHShopOrders","username='"&login_username&"'","id desc")
	SQL = obj_page.sql_count
	Set rs=Cls.Exec(SQL,1)
	obj_page.rssum=rs(0)
	Rs.Close
	Call obj_page.p_main("*","AsaiMHShopOrders","username='"&login_username&"'","id desc")
	For i=1 To obj_page.page_num
    ordernum=rs("ordernum")
    tim=rs("tim")
sTmp=sTmp&"<tr class=tr align=center>" & _
vbcrlf&"<td>"&i+obj_page.page_now&"</td>" & _
vbcrlf&"<td align=left><a href='"&Cls.Web_Dir&"Shop/Order_View.asp?ordernum="&ordernum&"'>"&ordernum&"</a></td>" & _
vbcrlf&"<td align=left>"&rs("nname")&"</td>" & _
vbcrlf&"<td align=right>"&rs("prices")&"</td>" & _
vbcrlf&"<td><font title='"&Cls.time_type(tim,2)&"' class=tims>"&Cls.time_type(tim,3)&"</td>" & _
vbcrlf&"<td>"
if rs("ispay") then
sTmp=sTmp&"<font class=red>已支付</font>"
else
sTmp=sTmp&"<font class=Gys>未支付</font>"
end if
sTmp=sTmp&"</td>" & _
vbcrlf&"<td><a href='"&Cls.Web_Dir&"Shop/Order_View.asp?ordernum="&ordernum&"' target=_blank >详细</a></td>" & _
vbcrlf&"</tr>"
    rs.movenext
  next
  rs.close
sTmp=sTmp&"<tr><td class=trs colspan=7>" & _
vbcrlf&"<table border=0 cellspacing=0 cellpadding=2>" & _
vbcrlf&"<tr>" & _
vbcrlf&"<td>"&obj_page.page_var&"</td>" & _
vbcrlf&"<td width=3></td>" & _
vbcrlf&"<td>分页：</td>" & _
vbcrlf&"<td>"&obj_page.page_cute&obj_page.page_shortcut&"</td>" & _
vbcrlf&"</tr>" & _
vbcrlf&"</table>" & _
vbcrlf&"</td>" & _
vbcrlf&"</tr>" & _
vbcrlf&"</table>"
emoney_note_query=sTmp
end Function

Function emoney_note_query2()
dim ordernum,tim,sTmp
sTmp= "<table cellspacing=1 cellpadding=4 class=table>" & _
vbcrlf&"<td class=td width='8%'>序号</td>" & _
vbcrlf&"<td class=td width='22%'>订单号</td>" & _
vbcrlf&"<td class=td width='14%'>收货人</td>" & _
vbcrlf&"<td class=td width='8%'>金额</td>" & _
vbcrlf&"<td class=td width='12%'>订购时间</td>" & _
vbcrlf&"<td class=td width='12%'>支付否</td>" & _
vbcrlf&"<td class=td width='8%'>查看</td>" & _
vbcrlf&"</tr>"
	Dim obj_page
	Set obj_page=new Cls_PageCute
	obj_page.pageurl=pageurl		
	obj_page.nummer=20						
	obj_page.page_t=1									
	obj_page.page_p=5									
	obj_page.page_unit="条"
	obj_page.page_tit=tit
	obj_page.v_id="id"
	Call obj_page.p_init("*","AsaiMHShopEmoneyNotes","username='"&login_username&"'","id desc")
	SQL = obj_page.sql_count
	Set rs=Cls.Exec(SQL,1)
	obj_page.rssum=rs(0)
	Rs.Close
	Call obj_page.p_main("*","AsaiMHShopEmoneyNotes","username='"&login_username&"'","id desc")
	For i=1 To obj_page.page_num
    ordernum=rs("ordernum")
    tim=rs("tim")
sTmp=sTmp&"<tr class=tr align=center>" & _
vbcrlf&"<td>"&i+obj_page.page_now&"</td>" & _
vbcrlf&"<td align=left><a href='"&Cls.Web_Dir&"Shop/Order_View.asp?type=emoney&ordernum="&ordernum&"'>"&ordernum&"</a></td>" & _
vbcrlf&"<td align=left>"&rs("nname")&"</td>" & _
vbcrlf&"<td align=right>"&rs("emoneys")&"</td>" & _
vbcrlf&"<td><font title='"&Cls.time_type(tim,2)&"' class=tims>"&Cls.time_type(tim,3)&"</td>" & _
vbcrlf&"<td>"
'if rs("ispay") then
sTmp=sTmp&"<font class=red>已支付</font>"
'else
'sTmp=sTmp&"<font class=Gys>未支付</font>"
'end if
sTmp=sTmp&"</td>" & _
vbcrlf&"<td><a href='"&Cls.Web_Dir&"Shop/Order_View.asp?type=emoney&ordernum="&ordernum&"' target=_blank >详细</a></td>" & _
vbcrlf&"</tr>"
    rs.movenext
  next
  rs.close
sTmp=sTmp&"<tr><td class=trs colspan=7>" & _
vbcrlf&"<table border=0 cellspacing=0 cellpadding=2>" & _
vbcrlf&"<tr>" & _
vbcrlf&"<td>"&obj_page.page_var&"</td>" & _
vbcrlf&"<td width=3></td>" & _
vbcrlf&"<td>分页：</td>" & _
vbcrlf&"<td>"&obj_page.page_cute&obj_page.page_shortcut&"</td>" & _
vbcrlf&"</tr>" & _
vbcrlf&"</table>" & _
vbcrlf&"</td>" & _
vbcrlf&"</tr>" & _
vbcrlf&"</table>"
emoney_note_query2=sTmp
end Function

Function emoney_note_card()
dim tim,sTmp
sTmp= "<table cellspacing=1 cellpadding=4 class=table>" & _
vbcrlf&"<tr align=center>" & _
vbcrlf&"<td class=td width='7%'>序号</td>" & _
vbcrlf&"<td class=td width='25%'>卡号</td>" & _
vbcrlf&"<td class=td width='25%'>密码</td>" & _
vbcrlf&"<td class=td width='11%'>升级状态</td>" & _
vbcrlf&"<td class=td width='11%'>兑换时间</td>" & _
vbcrlf&"<td class=td width='8%'>有效期</td>" & _
vbcrlf&"<td class=td width='12%'>使用相关</td>" & _
vbcrlf&"</tr>"
	Dim obj_page
	Set obj_page=new Cls_PageCute
	obj_page.pageurl=pageurl		
	obj_page.nummer=20						
	obj_page.page_t=1									
	obj_page.page_p=5									
	obj_page.page_unit="条"
	obj_page.page_tit=tit
	obj_page.v_id="c_id"
	Call obj_page.p_init("*","AsaiMHCards","c_pay='"&login_username&"'","c_id desc")
	SQL = obj_page.sql_count
	Set rs=Cls.Exec(SQL,1)
	obj_page.rssum=rs(0)
	Rs.Close
	Call obj_page.p_main("*","AsaiMHCards","c_pay='"&login_username&"'","c_id desc")
	For i=1 To obj_page.page_num
sTmp=sTmp&"<tr class=tr align=center>" & _
vbcrlf&"<td>"&i+obj_page.page_now&"</td>" & _
vbcrlf&"<td align=left>"&rs("c_name")&"</a></td>" & _
vbcrlf&"<td align=left>"&rs("c_pass")&"</td>" & _
vbcrlf&"<td>"&format_power(rs("c_power"),1)&"</td>" & _
vbcrlf&"<td><font class=tims>"&Cls.time_type(rs("c_tim"),4)&"</td>" & _
vbcrlf&"<td>"&rs("c_day")&" 个月</td>" & _
vbcrlf&"<td>"
select case int(rs("c_hidden"))
    case 0
      sTmp=sTmp&"<font class=Gys>未使用</font>"
    case 1
      sTmp=sTmp&"<font class=red>(兑换)方式</font>"
    case 2
      sTmp=sTmp&"<font class=red>(冲值)方式</font>"
    case else
      sTmp=sTmp&"<font class=blue>锁定</font>"
    end select
sTmp=sTmp&"</td>" & _
vbcrlf&"</tr>"
    rs.movenext
  next
  rs.close
sTmp=sTmp&"<tr class=trs><td colspan=7>" & _
vbcrlf&"<table border=0 cellspacing=0 cellpadding=0>" & _
vbcrlf&"<tr>" & _
vbcrlf&"<td>"&obj_page.page_var&"</td>" & _
vbcrlf&"<td width=3></td>" & _
vbcrlf&"<td>分页：</td>" & _
vbcrlf&"<td>"&obj_page.page_cute&obj_page.page_shortcut&"</td>" & _
vbcrlf&"</tr>" & _
vbcrlf&"</table>" & _
vbcrlf&"</td>" & _
vbcrlf&"</tr>" & _
vbcrlf&"</table>"
emoney_note_card=sTmp
end Function
%>
