<%
'乘风多用户计数器 Sql版
'作者QQ：178575
'作者EMail：yliangcf@163.com
'作者网站：http://www.qqcf.com
'详细简介：http://www.qqcf.com/cfcount.htm
'上面有程序在线演示，安装演示，使用疑难解答，最新版本下载等内容
'因为这些内容可能时常更新，就没有放在程序里，请自己上网站上查看
'有完整版本的演示
%>



  <form name="form4" method="post" action="?Action=enoughcardadd">
<table class="tb_1">
<tr class="tr_1">
    <TD colspan="2">用充值卡给账号充值增加VIP天数</TD>
  </TR>
  <TR> 
      <TD width="14%">充值卡号：</TD>
      <TD><input name="CardCode" type="text" value="" size="30"></TD>
    </TR>
    <TR> 
      <TD>充值卡密码：</TD>
      <TD><input name="CardPassword" type="text" value="" size="30"></TD>
    </TR>
    <TR>
      <TD>给哪个用户充值：</TD>
      <TD><input name="UserName_PayTo" type="text" value="<%=UserName%>" size="30"></TD>
    </TR>
    <TR> 
      <TD>&nbsp; </TD>
      <TD><input type="submit" name="Submit3" value="充值">
      </TD>
    </TR>  
</Table></form>


<%
Set Rs= Server.CreateObject("Adodb.RecordSet")
Sql="Select * From CFCount_User Where UserName='"&UserName&"'"
Rs.Open Sql,Conn,1,1

If Session("CFCountUser_View")<>"" Then'为独立查看者时
 Call AlertBack("独立查看者无法对此操作",1)
End If

ZCJ="你的代理折扣价是"&Rs("AgentLevel")&"/100"
%>
<%
CardCode=ChkStr(Request("CardCode"),1)
Px=ChkStr(Request("Px"),1)

If Px="" Then Px="ID"

Call PxFilter(Px,"ID,CardCode,CardPassword,CardMoney,LastDate,EnoughOk,AgentUserName,UserName,EnoughTime,PayOk")

Sql="Select * From CFCount_EnoughCard Where (AgentUserName='"&UserName&"' Or UserName='"&UserName&"')"
If CardCode<>"" Then
 Sql=Sql&" And CardCode Like '%"&CardCode&"%'"
End If
Sql=Sql&" Order By "&Px&" Desc"


Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.open Sql,Conn,1,1

If Not Rs.Eof Then
 If ChkStr(Request("Page"),2) = "" Then
  Page = 1
 Else 
  Page = CInt(ChkStr(Request("Page"),2))
 End If

Rs.pagesize=10
TotalRs=Rs.RecordCount
TotalPage=Rs.PageCount
MyPageSize=Rs.PageSize
Rs.AbsolutePage=Page
End If
%>
  
<table class="tb_1">
<tr>
    <td height="18" colspan="9">
<a href="?Action=enoughcardbuy" class="t_button">购买充值卡</a>

      (<%=ZCJ%>)</td>
  </tr>
  <tr class="tr_2"> 
    <td><a href="?Action=<%=Action%>&CardCode=<%=CardCode%>&Px=CardCode">卡号</a></td>
    <td><a href="?Action=<%=Action%>&CardCode=<%=CardCode%>&Px=CardPassword">密码</a></td>
    <td><a href="?Action=<%=Action%>&CardCode=<%=CardCode%>&Px=CardMoney">卡面金额</a></td>
    <td><a href="?Action=<%=Action%>&CardCode=<%=CardCode%>&Px=LastDate">最晚充值日期</a></td>
    <td><a href="?Action=<%=Action%>&CardCode=<%=CardCode%>&Px=AgentUserName">代理商</a></td>
    <td><a href="?Action=<%=Action%>&CardCode=<%=CardCode%>&Px=EnoughOk">已被充入</a></td>
    <td><a href="?Action=<%=Action%>&CardCode=<%=CardCode%>&Px=UserName">已充入用户名</a></td>
    <td><a href="?Action=<%=Action%>&CardCode=<%=CardCode%>&Px=EnoughTime">充值时间</a></td>
    <td><a href="?Action=<%=Action%>&CardCode=<%=CardCode%>&Px=PayOk">已支付</a></td>
  </tr>
  <%
While Not Rs.Eof And MyPageSize>0
I=I+1
%>

    <tr class="tr_2"> 
      <td><%
If Rs("PayOk")=-1 And Rs("EnoughOk")=0 Then
 Response.write Rs("CardCode")
Else
 Response.write "<font color='#D4D4D4'>"&Rs("CardCode")&"</font>"
End If
%></td>
      <td><%=Rs("CardPassword")%></td>
      <td><%=Rs("CardMoney")%>元</td>
      <td><%=Rs("LastDate")%></td>
      <td><%=Rs("AgentUserName")%></td>
      <td><%
If Rs("EnoughOk")=0 Then
 Response.write "否"
Else
 Response.write "是"
End if
%></td>
      <td><%=Rs("UserName")%></td>
      <td><%=Rs("EnoughTime")%></td>
      <td><%
If Rs("PayOk")=0 Then
 Response.write "否"
Else
 Response.write "是"
End if
%></td>
    </tr>

  <%
Rs.MoveNext
mypagesize=mypagesize-1
Wend
%>
</table>

<table class="tb_3">
    <tr> 
      <td><a href="?Action=<%=Action%>&CardCode=<%=CardCode%>&Px=<%=Px%>&Page=1">第一页</a> 
          <%
if page>1 then%>
          <a href='?Action=<%=Action%>&CardCode=<%=CardCode%>&Px=<%=Px%>&Page=<%=Page-1%>'>上一页</a> 
          <%
end if
%>
          <%
if page<rs.pagecount   then%>
          <a href='?Action=<%=Action%>&CardCode=<%=CardCode%>&Px=<%=Px%>&Page=<%=Page+1%>'>下一页</a> 
          <%
end if
%>
          <a href="?Action=<%=Action%>&CardCode=<%=CardCode%>&Px=<%=Px%>&Page=<%=TotalPage%>">最后一页</a> 
          页次：<font color="#ff0000"><%=page%></font>/<%=totalpage%>页&nbsp;&nbsp;共<%=UserTotal%>条记录&nbsp;&nbsp;每页显示<%=rs.pagesize%>条
		  
<%
Response.write "&nbsp;&nbsp;转到第<select id='page' onChange=""window.location=document.getElementById('page').options[document.getElementById('page').selectedIndex].value"">"
For I=1 To TotalPage
    Response.Write "<option value=?Action="&Action&"&CardCode="&CardCode&"&Px="&Px&"&Page="&I    
 If Page=I Then Response.Write " selected"
 Response.Write ">"& I &"</option>"
Next
Response.write "</select>页"
%>
</td>

    </tr>
  </table>


	      <form name="form2" method="post" action="?action=enoughcardsearch">
<table class="tb_3"><tr>
        <td>搜索：卡号
<input name="CardCode" type="text" id="CardCode" size="10">
            <input type="submit" name="Submit" value="查找">
          </td>
      </tr>
</table></form>
  


