📄 ship.asp
字号:
<!--#include file="check.asp"-->
<%
dim action
action=request.QueryString("action")
upline=request.QueryString("upline")
Nowpage=cint(request.QueryString("page"))
id=cint(request.QueryString("id"))
upline=request.QueryString("upline")
call ConnectionDatabase
set Rs=GrateRs("select * from config",1)
jg=Rs("jg")
Function count_mobile(upline)
dim gRs,i,preNumber
Set gRs=Server.CreateObject("ADODB.Recordset")
gRs.Open "select * from mobile where state=0 and value='有效' and upline='"&upline&"' order by number", Conn, 1, 1
if not gRs.eof then
preNumber=""
i=0
do while not gRs.eof
if not gRs("number")=preNumber then
i=i+1
preNumber=gRs("number")
end if
gRs.movenext
loop
else
i=0
end if
gRs.close
set gRs=nothing
count_mobile=i
End Function
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>支付结算</title>
<link href="css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style4 {font-weight: bold}
-->
</style>
</head>
<body>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" class="tablegg">
<tr>
<td><table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#F1F1F1">
<tr bgcolor="#E3E2C3">
<td height="23" bgcolor="#E3E2C3"><div align="center" class="style4"><strong> 支付结算管理 </strong></div></td>
</tr>
<tr>
<td valign="top">
<%
select case action
case "list"
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr bgcolor="#EDEDE1">
<td height="26" colspan="6"><span class="forumRow"> <strong> : : 站长列表 : :</strong></span></td>
</tr>
<tr align="center" bgcolor="#E3E2C3">
<td width="16%" height="20">站长</td>
<td width="15%" height="20">已支付金额</td>
<td width="13%" height="20">未支付金额</td>
<td width="14%" height="20">已结算金额</td>
<td width="14%" height="20">可结算金额</td>
<td width="28%" height="20">操作</td>
</tr>
<%
set Rs=GrateRs("select * from member where state=1 order by moneyTotal desc",1)
i=0
do while not Rs.eof
cMobile=count_mobile(Rs("username"))
if cMobile>=1 then
%>
<tr align="center" bgcolor="#F1F1F1">
<td width="16%" height="20" align="left"> <%=Rs("username")%></td>
<td width="15%" height="20"><%=Rs("removeMoney")%></td>
<td width="13%" height="20"><%=Rs("moneyTotal")-Rs("removeMoney")%></td>
<td width="14%" height="20"><%=Rs("moneyTotal")%></td>
<td width="14%" height="20" align="left"> <%=jg&" × "&cMobile&" = <font color=red>"&cMobile*jg&"</font>"%></td>
<td width="28%" height="20"><a href="ship.asp?action=ship&upline=<%=Rs("username")%>" target="YeShip">结算</a> / <a href="ship.asp?action=show&upline=<%=Rs("username")%>">详单</a> / <a href="siter.asp?action=show&id=<%=Rs("id")%>">资料</a> / <a href="meber.asp?upline=<%=Rs("username")%>">手机会员</a></td>
</tr>
<%
i=i+1
end if
Rs.movenext
loop
%>
<tr bgcolor="#E3E2C3">
<td height="26" colspan="6"> <strong> 统计: :</strong>
<%
response.write("共:"&i&"条记录.")
%> </td>
</tr>
</table>
<%
case "show"
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr bgcolor="#EDEDE1">
<td height="26" colspan="5"><span class="forumRow"> <strong> : : 结算记录 : :</strong></span></td>
</tr>
<tr align="center" bgcolor="#E3E2C3">
<td width="20%" height="20">站长ID</td>
<td width="18%" height="20">结算手机个数</td>
<td width="17%" height="20">结算金额</td>
<td width="17%" height="20">结算时间</td>
<td width="28%" height="20">操作</td>
</tr>
<%
if upline="" then upline=request.form("upline")
startdate=request.form("startdate")
enddate=request.form("enddate")
if enddate="" then enddate=date()
searchstr=""
if upline<>"" then searchstr="upline='"&upline&"'"
if isdate(startdate) then
if not searchstr="" then searchstr=searchstr+" and "
searchstr=searchstr+"shipdate >= #"&startdate&"#"
end if
if isdate(enddate) then
if not searchstr="" then searchstr=searchstr+" and "
searchstr=searchstr+"shipdate <= #"&enddate&"#"
end if
if not searchstr="" then searchstr=" where "+searchstr
set Rs=GrateRs("select * from ship"&searchstr&" order by id desc",1)
Rs.PageSize=30
if not Rs.eof then
If Nowpage=0 then Nowpage=1
Rs.AbsolutePage=Nowpage
i=1
do while not Rs.eof and i<=Rs.pagesize
%>
<tr align="center" bgcolor="#F1F1F1">
<td width="20%" height="20" align="left"> <%=Rs("upline")%></td>
<td width="18%" height="20"><%=Rs("count")%></td>
<td height="20"><%=Rs("total")%> </td>
<td height="20"><%=Rs("shipdate")%></td>
<td width="28%" height="20"><a href="pay.asp?action=pay&upline=<%=Rs("upline")%>">支付该用户</a> / <a href="ship.asp?action=show&upline=<%=Rs("upline")%>">只显示<%=Rs("upline")%>详单</a> </td>
</tr>
<%
i=i+1
Rs.movenext
loop
else
%> <tr align="center" bgcolor="#F1F1F1">
<td height="20" colspan="5">对不起,该站长还尚无结算记录</td>
</tr>
<%
end if
%>
<tr bgcolor="#E3E2C3">
<td height="26" colspan="5"> <strong> 翻页: :</strong>
<%
myurl="ship.asp?action=show&"
response.write("共:"&Rs.recordcount&"条记录,共:"&Rs.PageCount&"页,"&Rs.PageSize&"条/页,第"&NowPage&"页 ")
response.write("<a href='"&myurl&"page=1'>"&"第一页</a> ")
if NowPage>1 then response.write("<a href='"&myurl&"page="&Nowpage-1&"'>前一页</a> ")
if NowPage<Rs.PageCount then response.write("<a href='"&myurl&"page="&Nowpage+1&"'>后一页</a> ")
response.write("<a href='"&myurl&"page="&Rs.PageCount&"'>最后页</a> ")
%>
</td>
</tr>
<tr align="center" bgcolor="#F1F1F1">
<form name="form1" method="post" action="ship.asp?action=show"> <td height="20" colspan="5">
站长ID
<input name="upline" type="text" class="inputbox" id="upline" size="20">
开始时间 <input name="startdate" type="text" class="inputbox" id="startdate" size="20" value="<%=date()-7%>">
结束时间
<input name="enddate" type="text" class="inputbox" id="enddate" value="<%=date()%>" size="20">
<input name="Submit" type="submit" class="inputbutton" value=" 立即查询 "></td> </form>
</tr>
</table>
<%
case "ship"
i=count_mobile(upline)
if i>=1 then
set Rs=GrateRs("select * from mobile where state=0 and value='有效' and upline='"&upline&"' order by id desc",3)
if not Rs.eof then
preNumber=""
i=0
do while not Rs.eof
if not Rs("number")=preNumber then
i=i+1
preNumber=Rs("number")
Rs("state")=1
else
Rs("state")=2
Rs("value")="无效"
end if
Rs.update
Rs.movenext
loop
else
i=0
end if
Rs.movefirst
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr bgcolor="#EDEDE1">
<td height="26" colspan="3"><span class="forumRow"> <strong> : : 结算<%=date()%>之前未结算的手机注册用户 : :</strong></span></td>
</tr>
<tr align="center" bgcolor="#E3E2C3">
<td width="30%" height="20">手机号</td>
<td width="30%" height="20">注册时间</td>
<td width="30%" height="20">状态</td>
</tr>
<%
do while not Rs.eof
%>
<tr align="center" bgcolor="#F1F1F1">
<td width="30%" height="20"><%=Rs("number")%></td>
<td width="30%" height="20"><%=Rs("regDate")%></td>
<td width="30%" height="20">
<%
select case Rs("state")
case 1
response.write("已结")
case 2
response.write("重复")
case else
response.write("无效")
end select
%>
</td>
</tr>
<%
Rs.movenext
loop
set Rs=GrateRs("select * from member where username='"&upline&"'",3)
if not Rs.eof then
totalm=Rs("moneyTotal")+i*jg
removeM=Rs("removeMoney")
Rs("moneyTotal")=totalM
Rs.update
%> <tr align="center" bgcolor="#E3E2C3">
<td colspan="3"><table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr align="left" bgcolor="#FFFFFF">
<td height="26" colspan="2" bgcolor="#E3E2C3"> <strong>: : 本次结算列表 : : </strong> <font color=red>注意:重复手机号只结算一个,其它均为无效</font> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="21%" height="20" align="center">站长ID</td>
<td width="79%" height="20"><%=upline%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20" align="center">本次结算</td>
<td height="20">有效手机个数:<font color=red><%=i%></font>个 金额:<font color=red><%=i*jg%></font>元</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20" align="center">本次结算后</td>
<td height="20">站长总金额为:<font color=red><%=totalm%></font>元 已支付金额:<font color=red><%=removeM%></font>元 未支付金额:<font color=red><%=totalm-removeM%></font>元</td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="20"> </td>
<td height="20" align="left"><input name="Submit" type="submit" class="inputbutton" value=" 继续结算 " onclick="window.location='<%=Request.ServerVariables("HTTP_REFERER")%>';">
<input name="Submit" type="submit" class="inputbutton" value="支付[<%=upline%>]" onclick="window.location='pay.asp?action=pay&upline=<%=upline%>';">
<input name="Submit" type="submit" class="inputbutton" value=" 关闭窗口 " onclick="window.close();"></td>
</tr>
</table></td>
</tr>
</table>
<%
set Rs=GrateRs("select * from ship",3)
Rs.addnew
Rs("upline")=upline
Rs("count")=i
Rs("total")=i*jg
Rs.update
else
response.write "<script language='JavaScript'>{window.alert('对不起,该站长不存在,无法完成结算!');window.location='"&Request.ServerVariables("HTTP_REFERER")&"';}</script>"
end if
else
response.write "<script language='JavaScript'>{window.alert('对不起,该站长的手机会员个数未满10个,还不能结算!');window.location='"&Request.ServerVariables("HTTP_REFERER")&"';}</script>"
end if
end select
%>
</td>
</tr>
<tr align="center" bgcolor="#EDEDE1">
<td height="35" align="right"> <span class="style1">Copyright 2003 - 2005 IFBEST Inc. AllRights Reserved Design By <a href="http://www.258sp.com" target="_blank">258sp商务平台</a></span> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<%
call DBConnEnd
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -