📄 agent_manage.asp
字号:
</tr>
</table>
<%
if request("sql")="" or isnull(request("sql")) then
set rs=server.createobject("adodb.recordset")
rs.open "select * from agents order by id desc",conn,1,1
end if
if request("sql")=1 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from agents where agent_id like '%"&request("var")&"%' order by id desc",conn,1,1
end if
if request("sql")=2 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from agents where agent_money<"&CCur(request("var"))&" order by id desc",conn,1,1
end if
if request("sql")=3 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from agents where agent_money2>"&CCur(request("var"))&" order by id desc",conn,1,1
end if
if request("sql")=4 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from agents where agent_tel='"&request("var")&"' order by id desc",conn,1,1
end if
if request("sql")=5 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from agents where agent_from='"&request("var")&"' order by id desc",conn,1,1
end if
if rs.eof and rs.bof then
%>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td height="100" align="center" bgcolor="#F7F7F7">没有查询到任何符合条件的代理商</td>
</tr>
</table>
<%
else
maxpage=10 '每页最大显示数
dim totalhow '数据库中的总记录数
dim totalpage '总共页数
dim CurrentPage '当前处于的页数
currentPage=request.Querystring("page")
totalhow=rs.recordcount
if totalhow mod maxpage=0 then
totalpage= totalhow \ maxpage
else
totalpage = totalhow \ maxpage +1
end if
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPage>totalhow then
if (totalhow mod MaxPage)=0 then
currentpage= totalhow \ MaxPage
else
currentpage= totalhow \ MaxPage + 1
end if
end if
if (currentPage-1)*MaxPage<totalhow then
rs.move (currentPage-1)*MaxPage
else
currentPage=1
end if
%>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td height="25" align="center" bgcolor="#F7F7F7">代理商账号</td>
<td align="center" bgcolor="#F7F7F7">预付金额</td>
<td align="center" bgcolor="#F7F7F7">透支金额</td>
<td align="center" bgcolor="#F7F7F7">所在地区</td>
<td align="center" bgcolor="#F7F7F7">注册时间</td>
<td align="center" bgcolor="#F7F7F7"> 操作 </td>
</tr>
<%
i=0
do while not rs.eof
i=i+1
%>
<tr>
<td height="25" align="center" bgcolor="#FFFFFF"><%=rs("agent_id")%></td>
<td height="25" align="center" bgcolor="#FFFFFF"><%=CCur(rs("agent_money"))%></td>
<td height="25" align="center" bgcolor="#FFFFFF"><%=CCur(rs("agent_money2"))%></td>
<td height="25" align="center" bgcolor="#FFFFFF"><%=rs("agent_from")%></td>
<td height="25" align="center" bgcolor="#FFFFFF"><%=rs("reg_time")%></td>
<td height="25" align="center" bgcolor="#FFFFFF"><a href="agent_cz_log.asp?agent_id=<%=rs("agent_id")%>" title="查看该代理商的充值记录">记录</a>/<a href="agent_edit.asp?id=<%=rs("id")%>" title="<%=rs("agent_id")%>">编辑</a>/<a href="<%=filename%>?action=agent_del&id=<%=rs("id")%>" title="<%=rs("agent_id")%>" onclick="javascript:{if(confirm('注意!删除代理商后,该代理商的充值记录也将被清空。确定要删除代理商:<%=rs("agent_id")%> 吗?')){return true;}return false;}">删除</a></td>
</tr>
<%
if i>=maxpage then exit do
rs.movenext
loop
%>
</table>
<%if request("sql")="" then%>
<table width="550" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="form1" method="post">
<tr>
<td width="421" align="right"><!-- ########### 开始判断分页类型 ############### -->
<font face="Webdings">7</font>
<%if currentpage>1 then%>
<a href="<%=filename%>"><%end if%>首页<%if currentpage>1 then%></a>
<%end if%>
<%if currentpage>1 then%>
<a href="<%=filename%>?page=<%=currentPage-1%>"><%end if%>上一页<%if currentpage>1 then%></a>
<%end if%>
<%if cint(currentpage)<totalpage then%>
<a href="<%=filename%>?page=<%=currentPage+1%>"><%end if%>下一页<%if cint(currentpage)<totalpage then%></a>
<%end if%>
<%if cint(currentpage)<totalpage then%>
<a href="<%=filename%>?page=<%=totalpage%>"><%end if%>尾页<%if cint(currentpage)<totalpage then%></a>
<%end if%>
<font face="Webdings">8</font> 共有<span class="font3"><%=totalhow%></span>条记录 共<span class="font3"><%=currentPage%></span>/<span class="font3"><%=totalpage%></span>页</td>
<td width="129">
<select name="topage" size="1" class="select1" onChange="JavaScript:tourl(document.form1.topage.options[document.form1.topage.selectedIndex].value)">
<%
for j=1 to totalpage
%>
<option value="<%=filename%>?page=<%=j%>" <%if cint(request.Querystring("page"))=j then%>selected<%end if%>> 第<%=j%>页 </option>
<%next%>
</select></td>
</form>
<!-- ############################ 判断分页类型结束 ######################## -->
</table>
<%else%>
<table width="550" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="form1" method="post">
<tr>
<td width="421" align="right"><!-- ########### 开始判断分页类型 ############### -->
<font face="Webdings">7</font>
<%if currentpage>1 then%>
<a href="<%=filename%>?sql=<%=request("sql")%>&var=<%=request("var")%>"><%end if%>首页<%if currentpage>1 then%></a>
<%end if%>
<%if currentpage>1 then%>
<a href="<%=filename%>?page=<%=currentPage-1%>&sql=<%=request("sql")%>&var=<%=request("var")%>"><%end if%>上一页<%if currentpage>1 then%></a>
<%end if%>
<%if cint(currentpage)<totalpage then%>
<a href="<%=filename%>?page=<%=currentPage+1%>&sql=<%=request("sql")%>&var=<%=request("var")%>"><%end if%>下一页<%if cint(currentpage)<totalpage then%></a>
<%end if%>
<%if cint(currentpage)<totalpage then%>
<a href="<%=filename%>?page=<%=totalpage%>&sql=<%=request("sql")%>&var=<%=request("var")%>"><%end if%>尾页<%if cint(currentpage)<totalpage then%></a>
<%end if%>
<font face="Webdings">8</font> 共有<span class="font3"><%=totalhow%></span>条记录 共<span class="font3"><%=currentPage%></span>/<span class="font3"><%=totalpage%></span>页</td>
<td width="129">
<select name="topage" size="1" class="select1" onChange="JavaScript:tourl(document.form1.topage.options[document.form1.topage.selectedIndex].value)">
<%
for j=1 to totalpage
%>
<option value="<%=filename%>?page=<%=j%>&sql=<%=request("sql")%>&var=<%=request("var")%>" <%if cint(request.Querystring("page"))=j then%>selected<%end if%>> 第<%=j%>页 </option>
<%next%>
</select></td>
</form>
<!-- ############################ 判断分页类型结束 ######################## -->
</table>
<%
end if
end if
if request.Querystring("action")="agent_del" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from agents where id="&request.querystring("id")&"",conn,1,1
agent_id=rs("agent_id")
rs.close
conn.execute"delete from agents where id="&request.Querystring("id")&""
conn.execute"delete from cz_log where agent_id='"&agent_id&"'"
response.write"<script language=javascript>alert('代理商删除成功');location.href = '"&filename&"';</Script>"
response.end
end if
%>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -