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

📄 toll.asp

📁 本源代码为 网雷弹窗联盟程序的源代码,欢迎大家的下载,学习与交流
💻 ASP
字号:
<html>
<!--#include file="head.asp"-->
<title><%=NetName%> - 流量交易</title>
<%
'当有人打开这个页面的时候,首先撤消过期的订单.
sql="select * from Business where TradeState='未成交' and datediff('d',PostTime,now()) > "&TollOverdue&" order by id desc"
set rs=conn.execute(sql)
if not rs.eof then
	do while not rs.eof
	if rs("TradeType")="购买" then
		'先返钱,然后再删除订单
		conn.execute ("Update Users [Money]=[Money]+"&rs("Amount")&" where Id="&rs("UserId"))
		conn.execute ("Delete * from Business where Id="&rs("Id"))
	else
		' 先把流量返回给用户,然后再删除订单
		conn.execute ("Update Users [RemainPop]=[RemainPop]+"&rs("Quantity")&" where Id="&rs("UserId"))
		conn.execute ("Delete * from Business where Id="&rs("Id"))
	end if
	loop
end if
rs.close
%>
<body>
<!--#include file="toper.asp"-->
<table width="750" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td></td>
	</tr>
</table>
<table width="750" height="10" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align=left>
	<%
	if Session("Id")<>"" and Session("UserName")<>"" then
		  response.write "<br>"
		  call ShowMenu
		  response.write "<br>"
	  else
		  response.write "<br>"
		  call ShowMenuToll
		  response.write "<br>"
	end if%>
	</td></tr>
</table>
<%
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 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,"lljy.asp"
		else
			if (currentPage-1)*MaxPerPage<totalPut then
				rs.move  (currentPage-1)*MaxPerPage
				dim bookmark
				bookmark=rs.bookmark
				showContent2
				showpage totalput,MaxPerPage,"lljy.asp"
			else
				currentPage=1
				showContent2
				showpage totalput,MaxPerPage,"lljy.asp"
			end if
		end if
		rs.close
		set rs = nothing	
   	end if 

	%>
</TABLE>
<table width="750" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><p>
      <%ShowContent()%>
    </p>
    <p>&nbsp; </p></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;"& GetName(rs("UserId"))&"</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
		if rs("TradeType")="购买" then 
			response.write "<a href=wycs.asp?BuyId="&rs("Id")&">我来出售</a></td>"
		else
			response.write "<a href=wygm.asp?BuyId="&rs("Id")&">我来购买</a></td>"
		end if
	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 + -