<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../inc/charsetasp.asp"-->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%
Const dbpath = "../"
Const funpath = "../"
%>
<!--#include file="admin_fun.asp"-->
<!--#include file="../core/class/tr_page.asp"-->
<!--#include file="../inc/czcj170824f8ir85.asp"-->
<!--#include file="../crinc/ulevstr.asp"-->

<%
Set ctr_page = New tr_page
If InStr(","&adminlimitidrange&",", ",2,")<1 Then contrl_message "您没有访问权限，请尝试其他版块。", "", "", "", ""
isdel = request.querystring("isdel")
If isdel = 1 Then
  delstr = " isdel=1 "
Else
  delstr = " isdel=0 "
End If
propertys = request.querystring("property")
  Select Case propertys
    Case "ispass"
      andpropertys = " ispass=1 "
    Case "isclose"
      andpropertys = " ispass=0 "
    Case Else
      andpropertys = delstr
  End Select
  pageno = CInt(request.querystring("pageno"))
  If Not IsNumeric(pageno) Then pageno = 1
  If pageno<1 Then pageno = 1
  searchaction = request.querystring("searchaction")
  If searchaction = "search" Then
    words = request.querystring("words")
    types = request.querystring("types")
    If Not IsNumeric (columnid) Then columnid = 0
    If types<>"" And words<>"" Then str2 = " "&types&" like '%"&words&"%' "
    Str = str1&str2
  End If
  action = Trim(request.Form("action"))
  id = Trim(Request.Form("id"))
  If action<>"" And adminctrllimit = 1 Then Call contrl_message ("您只有查看权限，没有管理权限，请升级权限后继续操作。", "", "", "", "")
  Select Case action
    Case "del"
      Call changevalue("tr_orderlist170820", "isdel=1", "id in("&id&")")
      Call admin_log(adminname, adminid, adminname&" 删除充值订单至回收站成功，ID:"&id&"。")
      Call contrl_message ("删除充值订单至回收站成功。", "location.href", "", "", "parent")
    Case "dodel"
      Call delline("tr_orderlist170820", "id in("&id&")")
      Call admin_log(adminname, adminid, adminname&" 彻底删除充值订单成功，ID:"&id&"。")
      Call contrl_message ("彻底删除充值订单成功。", "location.href", "", "", "parent")
    Case "ispass"
	  sql="select * from tr_orderlist170820 where id in("&id&") and ispass=0 and isdel=0 "
	  rs.open sql,conn,0,1
	  if not rs.eof then
	  spuserjfstr=split(userjfstr,",")
	  unfpoints=clng(spuserjfstr(1))
	  do while not rs.eof
	  czusernamemd5=rs("usernamemd5")
	  cztruejf=rs("truejf")
	  set urs=server.createobject("adodb.recordset")
	  usql="select * from tr_user where safemd5='"&czusernamemd5&"'"
	  urs.open usql,conn,1,3
	  if not urs.eof then
	  uoldpoints=clng(urs("points"))
	  unewpoints=clng(urs("points")+cztruejf)
	  urs("points")=unewpoints
	  if uoldpoints<unfpoints and unewpoints>=unfpoints then
	  urs("upleveltime")=FormatDate(now(), 1)
	  urs("uplevelneedjf")=unfpoints
	  end if
	  urs.update
	  end if
	  urs.close
	  rs.movenext
	  loop
	  end if
	  rs.close
	  
      Call changevalue("tr_orderlist170820", "ispass=1", "id in("&id&")")
      Call admin_log(adminname, adminid, adminname&" 开通充值订单成功，ID:"&id&"。")
	  
    Call contrl_message ("开通充值订单成功。", "location.href", "", "", "parent")
    Case "unisdel"
      Call changevalue("tr_orderlist170820", "isdel=0", "id in("&id&")")
      Call admin_log(adminname, adminid, adminname&" 从回收站恢复充值订单成功，ID:"&id&"。")
      Call contrl_message ("从回收站恢复充值订单成功。", "location.href", "", "", "parent")
    Case "unpass"
      Call changevalue("tr_orderlist170820", "ispass=0", "id in("&id&")")
      Call admin_log(adminname, adminid, adminname&" 关闭充值订单成功，ID:"&id&"。")
    Call contrl_message ("关闭充值订单成功。", "location.href", "", "", "parent")
  End Select
%>
<title>充值订单列表<%=application(siternd & "55trsitename")%></title>
<link rel="stylesheet" type="text/css" href="./skin/default/style.css">
<base target="_self">
<script type="text/javascript" src="./js/js.js"></script>
<script type="text/javascript" src="./js/hover.js"></script>
<script type="text/javascript" src="../js/jtimer.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
<link rel="bookmark" type="image/x-icon" href="../favicon.ico">
</head>
<body style="background:#ffffff; " class="w1">
<table width="100%" align="center" border="0" cellpadding="3" cellspacing="1" id="mytable2" class="size3" >
<tr class="tr1" >
<td class="td_title" colspan="20"><!--#include file="incgoback.asp"-->■
<%if isdel=1 then%>
回收站
<%end if%>
充值订单列表
<%if isdel<>1 then%>
| <a href="uczlist170820.asp">全部</a> <a href="uczlist170820.asp?property=ispass">已通过</a> <a href="uczlist170820.asp?property=isclose">未通过</a>
<%end if%></td>
</tr>
<tr>
<td colspan="20" valign="middle"><form target="_self" name="form1" id="form1" method="get" >
<select name="types" id="types" class="size10">
<option value="ordernum" <%if types="ordernum" then%>selected<%end if%> >商户订单号
<option value="ordername" <%if types="ordername" then%>selected<%end if%> >订单名称
<option value="username" <%if types="username" then%>selected<%end if%> >用户名
<option value="alipayordernum" <%if types="alipayordernum" then%>selected<%end if%> >支付平台订单号
<option value="alipayid" <%if types="alipayid" then%>selected<%end if%> >支付平台用户ID
<option value="alipayuname" <%if types="alipayuname" then%>selected<%end if%> >支付平台用户名
</select>
<input type="text" name="words" id="words" value="<%=words%>" class="input2 size2">
<input type="hidden" value="search" name="searchaction" id="searchaction">
<input type="submit" value=" 搜索 " name="submit1" id="submit1" class="button4">
</form></td>
</tr>
<tr class="font1">
<td width="" align="center" onClick="checkAll()" onMouseOver="style.backgroundColor='#FFBD66'" onMouseOut="style.backgroundColor=''"><label>
<input type="checkbox" value="1" name="selectall" id="selectall">
</label>
全选</td>
<td width="" align="center">序号</td>
<td width="" align="center">订单名称</td>
<td width="" align="center">状态</td>
<td width="" align="center">实付金额</td>
<td width="" align="center">会员用户名/IP</td>
<td width="" align="center">下单时间/付款时间</td>
<td width="" align="center">商户订单号/支付平台订单号</td>
<td width="" align="center">支付平台用户名/ID</td>
</tr>
<form name="form2" id="form2" target="ifr1" method="post" onSubmit="return checkchose(this)">
<%
page_size = 20
pagei = 0
n = (pageno -1) * page_size
if trim(str)<>"" then
andstr=Str&" and "&andpropertys
else
andstr=andpropertys
end if
if trim(andstr)<>"" then
andstr=andstr&" and "&delstr
else
andstr=delstr
end if

sql = "select * from tr_orderlist170820 where "&andstr&" order by id desc "
Call ctr_page.create_rs(sql, rs, conn, page_size, pageno)
If Not rs.EOF And Not rs.bof Then
  Do While Not rs.EOF And pagei<page_size
    pagei = pagei + 1
    n = n + 1
	
id = Rs("id")
ordernum = Rs("ordernum")
truepay = Rs("truepay")
ordername = Rs("ordername")
username = Rs("username")
usernamemd5 = Rs("usernamemd5")
alipayordernum = Rs("alipayordernum")
alipayid = Rs("alipayid")
alipayuname = Rs("alipayuname")
paytype = Rs("paytype")
leaveword = Rs("leaveword")
ip = Rs("ip")
addtime = Rs("addtime")
ispass = Rs("ispass")
isdel = Rs("isdel")
buytime = Rs("buytime")	
%>
<tr class="" id="tr<%=id%>">
<td width="" align="center" onClick="checkOne('id<%=id%>')"onmouseover="style.backgroundColor='#FFBD66'" onMouseOut="style.backgroundColor=''" nowrap><input type="checkbox" value="<%=id%>" name="id" id="id<%=id%>" onClick="checkOne('id<%=id%>')">
ID:<%=id%></td>
<td width="" align="center"><%=n%></td>
<td width="" align="left" style="word-break:break-all;"><%=ordername%></td>
<td width="" align="center" nowrap><%if ispass=1 then%>
通过
<%else%>
<font color="#FF0000">未通过</font>
<%end if%></td>
<td width="" align="center" nowrap><%=formatnum2w170824(truepay)%> 元</td>
<td width="" align="center" nowrap><%=username%><br>
<%=ip%></td>
<td width="" align="center" nowrap>下：<%=FormatDate(addtime, 11) %>
<%if not isnull(buytime) and buytime<>"" then%>
<br>
付：<%=FormatDate(buytime, 11) %>
<%end if%></td>
<td width="" align="left" nowrap>商：<%=ordernum%>
<%if trim(alipayordernum)<>"" then%>
<br>
平：<%=alipayordernum%>
<%end if%></td>
<td width="" align="left" nowrap><%=alipayuname%>
<%if trim(alipayid)<>"" then%>
<br>
<%=alipayid%>
<%end if%></td>
</tr>
<%
rs.movenext
Loop
%>
<tr>
<td width="" align="center" onClick="checkAll()" onMouseOver="style.backgroundColor='#FFBD66'" onMouseOut="style.backgroundColor=''" nowrap><label>
<input type="checkbox" value="1" name="selectall2" id="selectall2">
</label>
全选</td>
<td align="center"><input type="hidden" value="del" name="action" id="action">
<input type="submit" value="删除" name="submit1" id="submit1" class="button6 " onClick="changev('<%if isdel=1 then%>dodel<%else%>del<%end if%>')"></td>
<td colspan="20" align="left"><%if isdel=1 then%>
<input type="submit" value="恢复" name="submit1" id="submit1" class="button5" onClick="changev('unisdel')">
<%end if%>
<input type="submit" value="开通" name="submit1" id="submit1" class="button5 " onClick="changev('ispass')">
<input type="submit" value="关闭" name="submit1" id="submit1" class="button6 " onClick="changev('unpass')"></td>
</tr>
</form>
<tr>
<%if ctr_page.page_count>1 then%>
<td colspan="20" align="left"><%= ctr_page.create_page("",ctr_page.page_count,pageno,"trpage")%></td>
<% end if%>
</tr>
<%
Else
%>
<tr>
<td colspan="20" align="center">暂无相关项目
<%if propertys<>"isdel" then%>
，请先添加。
<%end if%></td>
</tr>
<%end if%>
<tr>
<td colspan="20" align="left">小提示：在此页面手动开通订单后请手动给用户添加积分，在后台--会员管理--管理会员--选定会员名--总积分中。 </td>
</tr>
</table>
<script type="text/javascript" >
showtable("mytable2")
function changev(value){
document.getElementById("action").value	=value
}
</script> 
<!--#include file="../inc/ifr.asp"-->
</body>
</html>
<%
function getfor910221()
dim a
a = 0
for i = 1 to 10
    for j = 1 to 1
        a = a + 1
        if i = 5 then
            exit for
        end If
        Response.write a & "<br/>"
    next
next
end function
%>