<!--#include file="inc.asp"-->
<!--#include file="conn.asp"-->
<card title="球类投注后台">
<p>
<%

dim ids
ids=request("ids")
if ids="" or Isnumeric(ids)=False then
  Call Error("ID无效！")
  end if
  set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select id from users where id=" & ids &" order by id desc",conn,1,1
  if rs.eof then
  rs.close
  set rs=nothing
  call error("请输入正确的会员ID！")
  end if
  rs.close
  set rs=nothing

response.write "【TA历史投注】<br/>"
dim typeID,TP
TP=Request.Querystring("TP")
if TP="" or IsNumeric(TP)=False then TP=0
typeID=Request.Querystring("typeID")
if typeID="" or IsNumeric(typeID)=False then typeID=1
typeID=Trim(typeID)
if typeID<>1 then
response.write "<a href=""admin_ball_y.asp?TP="&TP&"&amp;ids="&ids&"&amp;typeID=1&amp;saytk="&saytk&"&amp;sid="&sid&""">让球盘</a>"&chr(13)
else
response.write "让球盘"&chr(13)
end if
if typeID<>2 then
response.write "<a href=""admin_ball_y.asp?TP="&TP&"&amp;ids="&ids&"&amp;typeID=2&amp;saytk="&saytk&"&amp;sid="&sid&""">大小盘</a>"&chr(13)
else
response.write "大小盘"&chr(13)
end if
if typeID<>3 then
response.write "<a href=""admin_ball_y.asp?TP="&TP&"&amp;ids="&ids&"&amp;typeID=3&amp;saytk="&saytk&"&amp;sid="&sid&""">单双盘</a>"&chr(13)
else 
response.write "单双盘"&chr(13)
end if
response.write "<br/><a href=""admin_ball_y.asp?TP=0&amp;ids="&ids&"&amp;saytk="&saytk&"&amp;sid="&sid&""">全部</a>"&chr(13)
response.write "<a href=""admin_ball_y.asp?TP=1&amp;ids="&ids&"&amp;saytk="&saytk&"&amp;sid="&sid&""">足球</a>"&chr(13)
response.write "<a href=""admin_ball_y.asp?TP=2&amp;ids="&ids&"&amp;saytk="&saytk&"&amp;sid="&sid&""">篮球</a>"&chr(13)
response.write "<a href=""admin_ball_y.asp?TP=3&amp;ids="&ids&"&amp;saytk="&saytk&"&amp;sid="&sid&""">其它</a><br/>"&chr(13)

set rs=Server.CreateObject("ADODB.Recordset")

if TP<>0 then
sql="select * from YD_voteid where Active=1 and usid="&ids&" and balltype="&TP&" and vote="&typeID&" order by ID desc"
else
sql="select * from YD_voteid where Active=1 and usid="&ids&" and vote="&typeID&" order by ID desc"
end if
rs.open sql,ydzqconn,1,1
If Not rs.eof	Then
	Dim PageSize,i
	PageSize=10						
	Dim Count,page,pagecount,gopage			
	gopage="admin_ball_y.asp?TP="&TP&"&amp;ids="&ids&"&amp;typeID="&typeID&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;"
	Count=rs.recordcount
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1		
	pagecount=(count+pagesize-1)\pagesize
        if page>pagecount then page=pagecount
	rs.move(pagesize*(page-1))					
	For i=1 To PageSize     						
	If rs.eof Then Exit For	
	   set rs1=Server.CreateObject("ADODB.Recordset")
   rs1.open"select * from YD_vote where id="&rs("ballid")&" order by ID desc",ydzqconn,1,1
if not rs1.eof then

    if rs("balltype")=1 then
	if rs("vote")=1 then
	if rs1("ballvote")="(让平手)" and clng(rs1("ballresult1")-rs1("ballresult2"))=0 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")平盘返还本金"&rs("paycent")&getcent&""
Response.write "<br/>"
	elseif rs1("ballvote")="(让一球)" and clng(rs1("ballresult1")+rs1("ballresult2"))=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")平盘返还本金"&rs("paycent")&getcent&""
Response.write "<br/>"

	elseif rs1("ballvote")="(让二球)" and clng(rs1("ballresult1")+rs1("ballresult2"))=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")平盘返还本金"&rs("paycent")&getcent&""
Response.write "<br/>"

	elseif rs1("ballvote")="(让一球)" and Trim(clng(rs1("ballresult1")-rs1("ballresult2")))=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")平盘返还本金"&rs("paycent")&getcent&""
Response.write "<br/>"

	elseif rs1("ballvote")="(让二球)" and Trim(clng(rs1("ballresult1")-rs1("ballresult2")))=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")平盘返还本金"&rs("paycent")&getcent&""
Response.write "<br/>"

	elseif rs1("ballvote")="(让半球)" and clng(rs1("ballresult1")-rs1("ballresult2"))>=1 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu1")&getcent&""
Response.write "<br/>"
    elseif rs1("ballvote")="(让半球)" and clng(rs1("ballresult1")-rs1("ballresult2"))<1 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让平手)" and clng(rs1("ballresult1")-rs1("ballresult2"))>=1 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu1")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让平手)" and clng(rs1("ballresult1")-rs1("ballresult2"))<1 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让一球)" and clng(rs1("ballresult1")-rs1("ballresult2"))>=2 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu1")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让一球)" and clng(rs1("ballresult1")-rs1("ballresult2"))<2 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让一球半)" and clng(rs1("ballresult1")-rs1("ballresult2"))>=2 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu1")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让一球半)" and clng(rs1("ballresult1")-rs1("ballresult2"))<2 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让一球半)" and clng(rs1("ballresult2")-rs1("ballresult1"))>=0 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让二球)" and clng(rs1("ballresult1")-rs1("ballresult2"))>=3 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu1")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让二球)" and clng(rs1("ballresult1")-rs1("ballresult2"))<3 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让二球半)" and clng(rs1("ballresult1")-rs1("ballresult2"))>=3 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu1")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让二球半)" and clng(rs1("ballresult1")-rs1("ballresult2"))<3 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让二球半)" and clng(rs1("ballresult2")-rs1("ballresult1"))>=0 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让平手/半球)" and clng(rs1("ballresult1")-rs1("ballresult2"))=0 and rs("typeID")=2 then
dim paycent1,paycent2
paycent1=rs("paycent")*rs1("ballvotelu2")-rs("paycent")
paycent2=paycent1/2
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")赢半,中"&rs("paycent")+paycent2&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让平手/半球)" and clng(rs1("ballresult1")-rs1("ballresult2"))=0 and rs("typeID")=1 then

Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")输半,返还"&rs("paycent")/2&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让平手/半球)" and clng(rs1("ballresult1")-rs1("ballresult2"))>=1 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu1")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让平手/半球)" and clng(rs1("ballresult2")-rs1("ballresult1"))>=0 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让半球/一球)" and clng(rs1("ballresult1")-rs1("ballresult2"))=1 and rs("typeID")=1 then
dim paycent3,paycent4
paycent3=rs("paycent")*rs1("ballvotelu1")-rs("paycent")
paycent4=paycent3/2

Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")赢半,中"&rs("paycent")+paycent4&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让半球/一球)" and clng(rs1("ballresult1")-rs1("ballresult2"))=1 and rs("typeID")=2 then


Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")输半,返还"&rs("paycent")/2&getcent&""
Response.write "<br/>"


    elseif rs1("ballvote")="(让半球/一球)" and clng(rs1("ballresult1")-rs1("ballresult2"))>=2 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu1")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让半球/一球)" and clng(rs1("ballresult2")-rs1("ballresult1"))>=0 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让一球/球半)" and clng(rs1("ballresult1")-rs1("ballresult2"))=1 and rs("typeID")=2 then
dim paycent5,paycent6
paycent5=rs("paycent")*rs1("ballvotelu1")-rs("paycent")
paycent6=paycent5/2

Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")赢半,中"&rs("paycent")+paycent6&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让一球/球半)" and clng(rs1("ballresult1")-rs1("ballresult2"))=1 and rs("typeID")=1 then
    

Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")输半,返还"&rs("paycent")/2&getcent&""
Response.write "<br/>"


    elseif rs1("ballvote")="(让一球/球半)" and clng(rs1("ballresult1")-rs1("ballresult2"))>=2 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu1")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让一球/球半)" and clng(rs1("ballresult2")-rs1("ballresult1"))>=0 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让两球/两球半)" and clng(rs1("ballresult1")-rs1("ballresult2"))=2 and rs("typeID")=2 then
dim paycent7,paycent8
paycent7=rs("paycent")*rs1("ballvotelu1")-rs("paycent")
paycent8=paycent7/2

Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")赢半,中"&rs("paycent")+paycent8&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让两球/两球半)" and clng(rs1("ballresult1")-rs1("ballresult2"))=2 and rs("typeID")=1 then


Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")输半,返还"&rs("paycent")/2&getcent&""
Response.write "<br/>"


    elseif rs1("ballvote")="(让两球/两球半)" and clng(rs1("ballresult1")-rs1("ballresult2"))>=3 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu1")&getcent&""
Response.write "<br/>"

    elseif rs1("ballvote")="(让两球/两球半)" and clng(rs1("ballresult2")-rs1("ballresult1"))>=0 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"

else
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")未中<br/>"
	end if
	
elseif rs("vote")=2 then

if clng(rs1("ballresult1")+rs1("ballresult2"))-rs1("balldx")=0 then

Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")平盘返还本金"&rs("paycent")&getcent&""
Response.write "<br/>"

    elseif clng(rs1("ballresult1")+rs1("ballresult2"))-rs1("balldx")<0 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("balldxlu1")&getcent&""
Response.write "<br/>"

	elseif clng(rs1("ballresult1")+rs1("ballresult2"))-rs1("balldx")>0 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("balldxlu2")&getcent&""
Response.write "<br/>"

else
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")未中<br/>"
	end if
   
elseif rs("vote")=3 then
    dim ballresult
    ballresult=clng(rs1("ballresult1")+rs1("ballresult2"))
    if ballresult mod 2 =1 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("balldslu1")&getcent&""
Response.write "<br/>"

    elseif ballresult mod 2 <>1 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("balldslu2")&getcent&""
Response.write "<br/>"

else
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")未中<br/>"
	end if
   end if
   
   ELSE
'-----------------------------------------------------
if rs("vote")=1  then
      if clng(rs1("ballresult1")+rs1("ballresult2"))-rs1("ballvote")=0 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")平盘返还本金"&rs("paycent")&getcent&""
Response.write "<br/>"

     elseif clng(rs1("ballresult1")-rs1("ballresult2"))-rs1("ballvote")=0 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")平盘返还本金"&rs("paycent")&getcent&""
Response.write "<br/>"

      elseif clng(rs1("ballresult1")-rs1("ballresult2"))-rs1("ballvote")>0 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu1")&getcent&""
Response.write "<br/>"

    elseif clng(rs1("ballresult1")-rs1("ballresult2"))-rs1("ballvote")<0 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"


    elseif clng(rs1("ballresult1")-rs1("ballresult2"))-rs1("ballvote")=0 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("ballvotelu2")&getcent&""
Response.write "<br/>"
   
   else
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")未中<br/>"
	end if
	
elseif rs("vote")=2 then
if clng(rs1("ballresult1")+rs1("ballresult2"))-rs1("balldx")=0 then

Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")平盘返还本金"&rs("paycent")&getcent&""
Response.write "<br/>"


    elseif clng(rs1("ballresult1")+rs1("ballresult2"))-rs1("balldx")<0 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("balldxlu1")&getcent&""
Response.write "<br/>"

	elseif clng(rs1("ballresult1")+rs1("ballresult2"))-rs1("balldx")>0 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("balldxlu2")&getcent&""
Response.write "<br/>"

else
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")未中<br/>"
	end if
   
elseif rs("vote")=3 then

    ballresult=clng(rs1("ballresult1")+rs1("ballresult2"))
    if ballresult mod 2 =1 and rs("typeID")=1 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("balldslu1")&getcent&""
Response.write "<br/>"

    elseif ballresult mod 2 <>1 and rs("typeID")=2 then
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")中"&rs("paycent")*rs1("balldslu2")&getcent&""
Response.write "<br/>"

else
Response.write ""&rs("votetxt")&"(结果:"&rs1("ballresult1")&":"&rs1("ballresult2")&")未中<br/>"
	end if
   end if
   end if
  ' Else
'Response.write "暂时没有可以兑奖的投注记录！<br/>"
    end if
    rs1.close
set rs1=nothing
	rs.moveNext
 	Next
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页</a>"
	if pagecount>1 then response.write "<br/>"&page&"/"&pagecount&"页,共"&Count&"条<br/><input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">跳到该页</a><br/>"
Else
Response.write "暂时没有TA的记录！<br/>"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
ydzqconn.close
set ydzqconn=nothing
Response.write "----------------<br/>"
response.write "<a href=""admin_so.asp?saytk="&saytk&"&amp;sid="&sid&""">返回继续搜索</a>"
%>
<!--#include file="fanhui.asp"-->
</p></card></wml>