网吧会员消费查询的一个asp文件出错!

xionglijie 2009-11-14 11:15:48
这是一个网吧会员消费查询系统的文件,“查询消费记录”是正常是,

但是“查询加钱记录”不正常,问题出在翻页,比如查询加钱记录有4页,你点下一页,就跳转到消费记录上面去了!

各位大哥帮小弟看看!小弟只是家网吧的小网管!


<td width="50%" height="26" align="center" bgcolor="#757575"><a href="info.asp"><font color="#FFFF00"><u>您的上机记录</u></font></a></td>
<td width="50%" height="26" align="center" bgcolor="#757575"><a href="info.asp?money=add"><font color="#FFFF00"><u>您的加钱记录</u></font></a></td>
</tr>
<tr>
<td width="101%" height="4" colspan="2" valign="top">
<table width="100%" cellspacing="1" height="1">
<tr><%if request.querystring("money")="add" then%>
<td width="13%" bgcolor="#757575" align="center" height="22"><font color="#FFFFFF">卡号</font></td>
<td width="20%" bgcolor="#757575" align="center" height="22"><font color="#FFFFFF">加钱时间</font></td>
<td width="19%" bgcolor="#757575" align="center" height="22"><font color="#FFFFFF">类型</font></td>
<td width="13%" bgcolor="#757575" align="center" height="22"><font color="#FFFFFF">会员类型</font></td>
<td width="18%" bgcolor="#757575" align="center" height="22"><font color="#FFFFFF">加入金额</font></td>
</tr>
<tr><%do while not rs.eof%>
<td width="13%" bgcolor="#FFFFFF" height="20"><%=rs("sCardID")%></td>
<td width="20%" bgcolor="#FFFFFF" height="20"><%=rs("dtTime")%></td>
<td width="19%" bgcolor="#FFFFFF" height="20">
<p align="center"><%=rs("sType")%></td>
<td width="13%" bgcolor="#FFFFFF" height="20">
<p align="center"><%=rs("sDis")%></td>
<td width="18%" bgcolor="#FFFFFF" height="20"><%=rs("cRemain")%></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%><%else%>
<tr>
<td width="13%" bgcolor="#757575" align="center" height="22"><font color="#FFFFFF">卡号</font></td>
<td width="20%" bgcolor="#757575" align="center" height="22"><font color="#FFFFFF">上机时间</font></td>
<td width="19%" bgcolor="#757575" align="center" height="22"><font color="#FFFFFF">下机时间</font></td>
<td width="13%" bgcolor="#757575" align="center" height="22"><font color="#FFFFFF">机器名</font></td>
<td width="18%" bgcolor="#757575" align="center" height="22"><font color="#FFFFFF">本次消费金额</font></td>

</tr>
<tr>

<%do while not rs.eof%>
<td width="13%" bgcolor="#FFFFFF" height="20"><%=rs("sCardID")%></td>
<td width="20%" bgcolor="#FFFFFF" height="20"><%=rs("dtTime1")%></td>
<td width="19%" bgcolor="#FFFFFF" height="20"><%=rs("dtTime2")%></td>
<td width="13%" bgcolor="#FFFFFF" height="20">
<p align="center"><%=rs("sCom")%></td>
<td width="18%" bgcolor="#FFFFFF" height="20"><%=rs("cReceived")%>元</td>

</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%><%end if%>
<tr>

<td width="83%" bgcolor="#FFFFFF" colspan="5" height="1">
<%
end sub

function showpage(totalnumber,maxperpage,filename)
dim n

if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<table cellspacing=1 width='100%' border=0 colspan='4' ><form method=Post action="""&filename&"""><tr><td align=center> "
if CurrentPage<2 then
response.write "共有<strong><font color=red>"&totalnumber&"</font></strong>条 <font face=Webdings>9</font> <font face=Webdings>7</font> "
else
response.write "共有<strong><font color=red>"&totalnumber&"</font></strong>条 <a href="&filename&"?page=1><font face=Webdings>9</font></a> "
response.write "<a href="&filename&"?page="¤tPage-1&"><font face=Webdings>7</font></a> "
end if

if n-currentpage<1 then
response.write "<font face=Webdings>8</font> <font face=Webdings>:</font>"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
response.write "<font face=Webdings>8</font></a> <a href="&filename&"?page="&n&"><font face=Webdings>:</font></a>"
end if
response.write " 页次:<strong><font color=red>"¤tPage&"</font>/"&n&"</strong>页 "
response.write " <b>"&maxperpage&"</b>条/页 "
end function
%>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>

</body>

</html>
<%
if request.querystring("out")="ok" then
Response.Cookies("user_name")=""
response.redirect"login.asp"
response.end
end if
%>
...全文
161 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
gingerkang 2009-11-15
  • 打赏
  • 举报
回复
"&filename&"?==>"& filename &"?money="& request.querystring("money") &"&
gingerkang 2009-11-15
  • 打赏
  • 举报
回复
现在数据库里面有没有所谓积分的这个字段呢?
还有怎么获取或消费积分,想好这些再在相应的地方做相应的处理就好了.
xionglijie 2009-11-15
  • 打赏
  • 举报
回复
其实只要加一条语句而已,就是sql定义一下,然后像上面两条列出来就可以了!我是用万象2008sql版本的!

基本上把上面的复制粘贴一下就可以了!


sql="SELECT * from tUsers where sCardID='"&Request.Cookies("sname")&"'"

这个sCardID就是卡的ID,比如弄个卡积分,我就不是很清楚了
gingerkang 2009-11-15
  • 打赏
  • 举报
回复
不熟
谈钱20块太少了,你要想研究的一下的话,有问题就问一下,这里或许有人解答
xionglijie 2009-11-15
  • 打赏
  • 举报
回复
<!-- #include file="conn.asp" -->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link href="all.css" rel="stylesheet" type="text/css" />
<title>会员详细资料</title>
</head>

<%
const MaxPerPage=15
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
dim title

if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
dim sql
dim rs
%>
<body topmargin="0" leftmargin="0">

<div align="center">
<center>
<table width="72%" height="135" bgcolor="#E8E8E8" cellspacing cellpadding>
<tr>
<td width="100%" height="18">
<table width="100%" cellspacing cellpadding>
<tr>
<%
set rs=server.createobject("adodb.recordset")
sql="SELECT * from tUsers where sCardID='"&Request.Cookies("sname")&"'"
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.write "<script>alert('没有!!');location.href='javascript:history.back(1)';</Script>"
response.end
end if
%>
<td width="100%" bgcolor="#757575" height="22">
<p align="center"><font color="#FFFFFF">会员详细资料  
<a href="logout.asp"></a></font><a href="info.asp?out=ok"><font color="#FF0000">退出系统</font></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="2"> </td>
</tr>
<tr>
<td width="100%" height="122">
<table width="100%" height="128" cellpadding="2" bordercolordark="#FFFFFF">
<tr>
<td width="14%" height="25" align="center" bgcolor="#757575"><font color="#FFFFFF">会员卡号</font></td>
<td width="32%" height="25" bgcolor="#FFFFFF"><%=rs("sCardID")%></td>
<td width="13%" height="25" align="center" bgcolor="#757575"><font color="#FFFFFF">会员姓名</font></td>
<td width="41%" height="25" bgcolor="#FFFFFF"><%=rs("sName")%></td>
</tr>
<tr>
<td width="14%" height="25" align="center" bgcolor="#757575"><font color="#FFFFFF">卡号类型</font></td>
<td width="32%" height="25" bgcolor="#FFFFFF"><%=rs("sDis")%></td>
<td width="13%" height="25" align="center" bgcolor="#757575"><font color="#FFFFFF">剩余金额</font></td>
<td width="41%" height="25" bgcolor="#FFFFFF"><%=rs("mRemain")%></td>
</tr>
<tr>
<td width="14%" height="26" align="center" bgcolor="#757575"><font color="#FFFFFF">会员密码</font></td>
<td width="32%" height="26" bgcolor="#FFFFFF"><input type="password" name="T1" size="16" value="<%=rs("sPassword")%>"></td>
<td width="13%" height="26" align="center" bgcolor="#757575"><font color="#FFFFFF">会员积分</font></td>
<td width="41%" height="26" bgcolor="#FFFFFF"><%=rs("iHeap")%></td>
</tr>
<tr>
<td width="14%" height="26" align="center" bgcolor="#757575"><font color="#FFFFFF">会员状态</font></td>
<td width="32%" height="26" bgcolor="#FFFFFF"><%=rs("sState")%></td>
<td width="13%" height="26" align="center" bgcolor="#757575"><font color="#FFFFFF">最后下机</font></td>
<td width="41%" height="26" bgcolor="#FFFFFF"><%=rs("dtLast")%></td>
</tr>
<tr>
<td width="14%" height="11" align="center" bgcolor="#757575"><font color="#FFFFFF">证件类型</font></td>
<td width="32%" height="11" bgcolor="#FFFFFF"><%=rs("sCardType")%></td>
<td width="13%" height="11" align="center" bgcolor="#757575"><font color="#FFFFFF">证件号码</font></td>
<td width="41%" height="11" bgcolor="#FFFFFF"><%=rs("sIDCard")%></td>
</tr>
<tr>
<td width="14%" height="3" align="center" bgcolor="#757575"><font color="#FFFFFF">开通时间</font></td>
<td width="32%" height="3" bgcolor="#FFFFFF"><%=rs("dtAccount")%></td>
<td width="13%" height="3" align="center" bgcolor="#757575"><font color="#FFFFFF">到期时间</font></td>
<td width="41%" height="3" bgcolor="#FFFFFF"><%=rs("dValidity")%></td>
</tr>
</table>
<%
set rs=Nothing
%>
</td>
</tr>
<tr>
<%
set rs=server.createobject("adodb.recordset")
if request.querystring("money")="add" then
sql="SELECT * from tAdd where sCardID='"&Request.Cookies("sname")&"' order by cremain desc"
else
sql="SELECT * from tLogs where sCardID='"&Request.Cookies("sname")&"' order by dtTime1 desc"


end if



If IsSql = 1 Then
rs.open sql,qqconn,1,1
else
rs.open sql,conn,1,1
end if
if rs.eof and rs.bof then
response.write " <br>抱歉,数据库里没有!"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if

if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"info.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"info.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"info.asp"
end if
end if
rs.close
end if

sub showContent
dim i
i=0
%>
<td width="100%" height="1" valign="top">
<table width="100%" height="1" cellpadding="2">
<tr>
xionglijie 2009-11-15
  • 打赏
  • 举报
回复
大哥,现在完美了,我是下载的一个别人写的万象消费查询源码,只有有消费记录和加钱记录查询

您对万象的系统熟悉吗?我想加个的积分查询,不知道我的想法现不现实!

如果您能帮我实现,我可以给您充值20元的QQ币,实在很感激你。您的时间也很宝贵的!

我的QQ是1220614
xionglijie 2009-11-15
  • 打赏
  • 举报
回复
set rs=server.createobject("adodb.recordset")
if request.querystring("money")="add" then
sql="SELECT * from tAdd where sCardID='"&Request.Cookies("sname")&"' order by cremain desc"
else
sql="SELECT * from tLogs where sCardID='"&Request.Cookies("sname")&"' order by dtTime1 desc"


end if


我把cremain改成dtTime就好了,这位大哥,你真是要好人。祝你幸福美满!
gingerkang 2009-11-15
  • 打赏
  • 举报
回复
你给代码里面看不到,要修改sql语句,找到order by 的地方
xionglijie 2009-11-15
  • 打赏
  • 举报
回复
可以了,还请教下兄弟,我需要查询的结果是按照时间排序的,现在这个加钱的结果是按照金额的多少排序的!请问在哪改!
xionglijie 2009-11-15
  • 打赏
  • 举报
回复
按照您说的,解决了!太谢谢您了!gingerkang 好人有好报!感激!!!

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧