⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zhxx.asp

📁 本源代码为 网雷弹窗联盟程序的源代码,欢迎大家的下载,学习与交流
💻 ASP
字号:
<%
Response.Buffer = True  
Response.ExpiresAbsolute = Now() - 1  
Response.Expires = 0  
Response.CacheControl = "no-cache"  
Response.AddHeader "Pragma", "No-Cache"
%>
<html>
<!--#include file="head.asp"-->
<!--#include file="UserSession.asp"-->
<title><%=NetName%> - 帐户信息</title>
<%
if Session("usertype")<>"VIP用户" then
	response.write "<script>alert('发生错误:您不是VIP用户,不能查看帐户信息,请申请VIP用户.');window.history.back();</script>"	
	response.end()
end if

if request("t")<>"" then
	BuyId=request("BuyId")
	if Cint(request("t"))=1 then
		sql="select * from Business where Id="&BuyId
		set rs=conn.execute (sql)
		if rs("TradeState")<>"未成交" then
			response.write "<script>alert('发生错误:您不能操作已成交的订单.');window.history.back();</script>"	
			response.end()
		end if
		if rs("UserId")<>Session("Id") then
			response.write "<script>alert('发生错误:您不能操作不属于您的订单.');window.history.back();</script>"	
			response.end()
		end if
		conn.BeginTrans '事务开始
		'如果是买流量的订单
		if rs("TradeType")="购买" then
			conn.execute ("Update Users set [Money]=Money+"&rs("Amount")&" where Id="&Session("Id"))
		'如果是卖流量的订单
		elseif  rs("TradeType")="出售" then
			conn.execute ("Update Users set [RemainPop]=RemainPop+"&rs("Quantity")&" where Id="&Session("Id"))
		end if
		conn.execute("Delete * from Business where Id="&BuyId)
		if conn.Errors.Count=0 then  
		  conn.CommitTrans  '如果没有conn错误,则执行事务提交
		else 
		  conn.RollbackTrans '否则回滚
		end if
		response.write "<script>alert('操作成功.');document.URL='zhxx.asp';</script>"	
		response.end()
	end if
end if
sql="select RemainPop,Money from Users where Id="&Session("Id")
set rs=conn.execute (sql)
if not rs.eof then
	RemainPop=rs("RemainPop")
	Money=rs("Money")
	rs.close
end if
%>
<body>
<!--#include file="toper.asp"-->
<table width="750" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td></td>
	</tr>
</table>
<table cellspacing="0" cellpadding="0" width="500" align="center" border="0" styel="line-height:200px;">
<tr><td styel="line-height:200px;">
<BR><%ShowMenuBuy%><BR>
· 欢迎您回来  - <SPAN class="User"><%=Session("UserName")%></SPAN>,您目前是“<%=NetName%>”<SPAN class="User"><%=Session("usertype")%></SPAN>!<br>
· 帐号状态:<FONT color=#FF0000><%=Session("Flag")%></Font>   积分模式:<FONT color=#FF0000><%=Session("InType")%></Font><BR>
· 上次登陆时间: <FONT color=#FF0000><%=Session("LastLogin")%></Font> 上次登陆IP: <FONT color=#FF0000><%=Session("LastLoginIP")%></Font><br>
· 剩余流量: <FONT color=#FF0000><%=RemainPop%></Font> 帐户余额: <FONT color=#FF0000><%=Money%></Font><br>
<br><br>
<%
dim maxperpage
dim totalPut
dim CurrentPage
'修改此处用于修改每页显示的记录数量
maxperpage=20
if not isempty(request("page")) then
		currentPage=cint(request("page"))
else
		currentPage=1
end if
%>

<TABLE borderColor=#cccccc cellSpacing=0 cellPadding=2 width=750 align=center border=1>
    <TR>
      <TD width="7%" height="25"><DIV align="center">交易类型</DIV></TD>
      <TD width="10%"><DIV align=center>发布人</DIV></TD>
      <TD width="10%"><DIV align=center>交易数量[点]</DIV></TD>
      <TD width="8%"><DIV align=center>单价[分]</DIV></TD>
      <TD width="10%"><DIV align=center>总金额[元]</DIV></TD>
      <TD width="7%"><DIV align=center>交易状态</DIV></TD>
	  <TD width="16%"><DIV align=center>发布时间</DIV></TD>
	  <TD width="16%"><DIV align=center>成交时间</DIV></TD>
      <TD width="9%"><DIV align=center>操作</DIV></TD>
    </TR>
	<%
	set rs=server.createobject("adodb.recordset")
	sql="select * from Business where UserId="&Session("Id")&" or TollUserId="&Session("Id")&" order by id desc"
	rs.open sql,conn,1,1
 	if not rs.eof then
		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
			showContent2
			showpage totalput,MaxPerPage,"zhxx.aspp"
		else
			if (currentPage-1)*MaxPerPage<totalPut then
				rs.move  (currentPage-1)*MaxPerPage
				dim bookmark
				bookmark=rs.bookmark
				showContent2
				showpage totalput,MaxPerPage,"zhxx.aspp"
			else
				currentPage=1
				showContent2
				showpage totalput,MaxPerPage,"zhxx.aspp"
			end if
		end if
		rs.close
		set rs = nothing	
   	end if 

	%>
</TABLE>

</td></tr>
</table>
<table width="750" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td></td>
	</tr>
</table>
<!--#include file="foot.asp"-->
</body>
</html>
<%
Function ShowContent ()
	sql="select [Business] from Notice"
	set rs=conn.execute (sql)
	if not rs.eof then
		response.write rs(0)
		rs.close
	end if
End Function

sub showContent2
	dim i
	i=1
	do while not rs.eof
	response.write "<tr> "
	response.write "<td height=25 align=center>&nbsp;"
	if rs("TradeType")="购买" then 
		response.write "<font color=cc0000>"&rs("TradeType")&"</font></td>"
	else
		response.write rs("TradeType")&"</td>"
	end if
	response.write "<td height=25 align=center>&nbsp;<a target=_blank href='to.asp?id="&rs("UserId")&"'>"& GetName(rs("UserId"))&"</a></td>"
	response.write "<td height=25 align=center>&nbsp;"&(rs("Quantity"))&"</td>"
	response.write "<td height=25 align=center>&nbsp;"&rs("UnitPrice")&"</td>"
	response.write "<td height=25 align=center>&nbsp;"&rs("Amount")&"</td>"
	response.write "<td height=25 align=center>&nbsp;"&rs("TradeState")&"</td>"
	response.write "<td height=25 align=center>&nbsp;"&rs("PostTime")&"</td>"
	response.write "<td height=25 align=center>&nbsp;"&rs("BargainTime")&"</td>"
	response.write "<td height=25 align=center>&nbsp;"
	if rs("TradeState")<>"已成交" then
		response.write "<a href=?t=1&BuyId="&rs("Id")&">删除</a></td>"
	end if
	response.write "</tr>"
	i=i+1
	if i>=MaxPerPage then exit do
	rs.movenext
	loop
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='750' border=0 colspan='4' align=center><form method=Post action="""&filename&"""><tr><td align=center> <br>"
	if CurrentPage<2 then
		response.write "共<b><font color=red>"&totalnumber&"</font></b>条记录&nbsp;首页 上一页&nbsp;"
	else
		response.write "共<b><font color=red>"&totalnumber&"</font></b>条记录&nbsp;<a href="&filename&"?page=1>首页</a>&nbsp;"
		response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a>&nbsp;"
	end if
	
	if n-currentpage<1 then
		response.write "下一页 尾页"
	else
		response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
		response.write "下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
	end if
	response.write "&nbsp;页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
	response.write "&nbsp;<b>"&maxperpage&"</b>条记录/页 "
	%>
	  转到: 
	  <select name='page' size='1' style="font-size: 9pt" onChange='javascript:submit()'>
		<%for i = 1 to n%>
		<option value='<%=i%>' <%if CurrentPage=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
		<%next%>
	  </select>
	<input type=hidden name=channel id=channel value=<%=channel_en%>>
	<%   
	response.write "</td></tr></FORM></table>"
end function

Function GetName(UserId)
	sql="select UserName from Users where Id="&UserId
	set rs_User=conn.execute (sql)
	if not rs_User.eof then
		GetName=rs_User(0)
	else
		GetName=""
	end if
	rs_User.close
End Function

Function GetStatus(Flag)
	if Flag=0 then
		GetStatus="等待审核"
	elseif Flag=1 then
		GetStatus="已经认证"
	elseif Flag=2 then
		GetStatus="已经锁定"
	end if
End Function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -