<!--#Include File="Connection.Asp"-->
<!--#Include File="JaClog.Asp"-->
<%
If Request.QueryString("action")="g" then
  Dim g
  g = Cint(Request.QueryString("Sn"))
  Conn.ExeCute("UPDATE [JaUser] SET JaMonery=JaMonery+"&g&"")
  Response.Write "<script language=javascript>alert('H币发送成功!');"
  Response.Write "window.document.location.href='JaMoneryList.Asp';</script>"
  Response.End()
End if

If Request.QueryString("action")="b" then
  Dim b,u,d,RsNeed
  b = Cint(Trim(Request.QueryString("Sn")))
  u = Trim(Request.QueryString("u"))
  d = Cint(Trim(Request.QueryString("id")))
  Set RsNeed=Conn.ExeCute("Select * From JaNeed WHERE ID="&d&" AND Stat<>1")
  If not RsNeed.eof then
  Conn.ExeCute("UPDATE [JaUser] SET JaMonery=JaMonery+"&b&" WHERE JaUid='"&u&"'")
  Conn.ExeCute("UPDATE [JaNeed] SET Stat=1 WHERE ID="&d)
  Response.Write "<script language=javascript>alert('充值成功!');"
  Response.Write "window.document.location.href='JaMoneryList.Asp';</script>"
  Response.End()
  Else
  Response.Write "<script language=javascript>alert('此请求已经冲值，不可再冲!');"
  Response.Write "window.document.location.href='JaMoneryList.Asp';</script>"
  Response.End()
  End If
  RsNeed.close
  Set RsNeed=Nothing
End if

If Request.QueryString("action")="d" then
  d = Cint(Trim(Request.QueryString("id")))
  Conn.ExeCute("DELETE FROM [JaNeed] WHERE ID="&d&"") 
  Response.Write "<script language=javascript>alert('删除充值请求成功!');"
  Response.Write "window.document.location.href='JaMoneryList.Asp';</script>"
  Response.End()
End If
Dim Rs,sqlstr,Img,MaxPerPage,text,checkpage,CurrentPage,i
sqlstr = "SELECT * FROM [JaNeed] Order By JaDate DESC"
Set Rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sqlstr,conn,1,1
MaxPerPage=30
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next

If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
i=0
%> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">



<title>无标题文档</title>
<link href="JaImg/css.css" rel="stylesheet" type="text/css">
</head>
<script src="../JsInc/AdminPages.js"></script>
<SCRIPT language=javascript>
function unselectall()
{
    if(document.del.chkAll.checked){
	document.del.chkAll.checked = document.del.chkAll.checked&0;
    } 	
}

function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll")
       e.checked = form.chkAll.checked;
    }
  }
function ConfirmDel()
{
   if(confirm("确定要删除选中的新闻吗？一旦删除将不能恢复！"))
     return true;
   else
     return false;	 
}

function Sname()
  {
   if(form1.Sn.value.length == 0)
   {
		alert("请您输入H币!");
                form1.Sn.focus();
		return false;
	}
  else
   {
   window.location.href ="?action=g&Sn=" + form1.Sn.value;
    }
  }

function cha(x,a,c,d)
{
 if(x==1)
  {
  window.location.href ="?action=b&Sn=" + a +"&u=" + c + "&id=" + d;
   }
 if(x==2)
  {
  window.location.href ="?action=d&id=" + d;
   }
}
</SCRIPT>
<body>
<form action="?action=del" method="post" id="form1" name="form1">
<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" class="itemhead">
  <tr>
    <td valign="bottom" bgcolor="#BCDBFE" class="itemheadtd"><table width="238" height="18" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="238" class="item">H币管理</td>
        </tr>
    </table></td>
  </tr>
</table>

  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF" style="margin-bottom:1px">
    <tr> 
      <td width="50%" height="22" bgcolor="#ACD2FD" style="padding-left:10px"><strong>充值申请列表</strong></td>
      <td width="50%" bgcolor="#ACD2FD" style="padding-left:10px"><strong>给所有用户添加H币</strong>： 
        <input name="Sn" type=text size="12" id="Sn" maxlength="30">
        <input name="SnA" type="button" class="button1" value="添 加 积 分" onClick="Sname()"> </td>
    </tr>
  </table>
	  
  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#164481">
    <tr bgcolor="#DAEBFE"> 
      <td width="55" align="center" bgcolor="#DAEBFE"><strong>ID</strong></td>
      <td width="105" align="center" bgcolor="#DAEBFE"><strong>申请充值号</strong></td>
      <td width="184" align="center" bgcolor="#DAEBFE"><strong>网上支付订单号</strong></td>
      <td width="141" align="center" bgcolor="#DAEBFE"><strong class="font6">要充值H币</strong></td>
      <td width="206" align="center" bgcolor="#DAEBFE"><strong>申请时间</strong></td>
      <td width="91" align="center" bgcolor="#DAEBFE"><strong>是否付款</strong></td>
      <td width="155" align="center" bgcolor="#DAEBFE">操作</td>
    </tr>
    <%Do While Not Rs.Eof%>
    <tr bgcolor="#FFFFFF"> 
      <td align="center"><a href="#>" title="ID号"><%=Rs(0)%></a>    </td>
      <td align="center"><a href="UserInfo.Asp?id=<%=Rs(1)%>"><%=Rs(1)%></a></td>
      <td align="center"><%=Rs(4)%></td>
      <td align="center"> <font color=blue class="font6"> <%=Rs(2)%></font></td>
      <td align="center">  <%=Rs(3)%></td>
      <td align="center"><%If Rs(5)=1 Then
	  Response.Write "<font color=blue class=""font6"">是</font>"
	  Else
	  Response.Write "<font>否</font>"
	  End If
	  %></td>
      <td align="center"><input name="SnA2" type="button" class="button1" value="通 过 充 值" onClick="cha(1,'<%=Rs(2)%>','<%=Rs(1)%>','<%=Rs(0)%>')">&nbsp;
        <input name="SnA22" type="button" class="button1" value="删除" onClick="cha(2,'<%=Rs(2)%>','<%=Rs(1)%>','<%=Rs(0)%>')""></td>
    </tr>
    <%
i=i+1 
If i >= MaxPerpage Then Exit do 
rs.MoveNext
Loop
%>
  </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="89%" height="34" align="center"><div align="right"></div></td>
          
      <td width="11%" align="right">&nbsp; </td>
        </tr>
</table></form>

<div align="center">
  <Script Language="JavaScript">Pages(<%=CurrentPage%>,<%=Rs.PageCount%>,<%=Rs.RecordCount%>,'page');</Script>
</div>
</body>
</html>
