 <!--#include file="../Inc.asp"-->
<!--#include file="../ydzq.asp"-->
<!--#include file="conn.asp"-->

<%'=============================
call head()
Call cardgame("开出结果",yanse12)

dim id,ballresult1,ballresult2,gettxt
id=request("id")
ballresult1=request("ballresult1")
ballresult2=request("ballresult2")

if id="" or IsNumeric(id)=False then
call error("ID无效！")
end if

if ballresult1="" or ballresult2="" then
call error("结果无效！")
end if
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select ID from YD_vote where id="&id&"  order by ID desc",ydzqconn,1,1
if rs.eof then
rs.close
set rs=nothing
call error("不存在的投注")
end if
rs.close
set rs=nothing
'更新开奖
  ydzqconn.Execute("update YD_vote set ballresult1='"&ballresult1&"',ballresult2='"&ballresult2&"' Where id=" & id)

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from YD_voteid where ballid="&id&"  order by ID desc",ydzqconn,1,1
 Do While Not rs.EOF   '遍历当期所有
   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 abs(rs1("ballresult1"))-abs(rs1("ballresult2"))=0 then
conn.Execute("update users set myjb=myjb+"&rs("paycent")&" Where id=" & rs("usid"))
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为：平盘，返回本金"&rs("paycent")&",多谢您的参与！"
Call qfmsg

	elseif rs1("ballvote")="(让一球)" and abs(rs1("ballresult1"))+abs(rs1("ballresult2"))=1 then
conn.Execute("update users set myjb=myjb+"&rs("paycent")&" Where id=" & rs("usid"))
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为：平盘，返回本金"&rs("paycent")&",多谢您的参与！"
Call qfmsg

	elseif rs1("ballvote")="(让二球)" and abs(rs1("ballresult1"))+abs(rs1("ballresult2"))=2 then
conn.Execute("update users set myjb=myjb+"&rs("paycent")&" Where id=" & rs("usid"))
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为：平盘，返回本金"&rs("paycent")&",多谢您的参与！"
Call qfmsg

	elseif rs1("ballvote")="(让一球)" and abs(abs(rs1("ballresult1"))-abs(rs1("ballresult2")))=1 then
conn.Execute("update users set myjb=myjb+"&rs("paycent")&" Where id=" & rs("usid"))
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为：平盘，返回本金"&rs("paycent")&",多谢您的参与！"
Call qfmsg

	elseif rs1("ballvote")="(让二球)" and abs(abs(rs1("ballresult1"))-abs(rs1("ballresult2")))=2 then
conn.Execute("update users set myjb=myjb+"&rs("paycent")&" Where id=" & rs("usid"))
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为：平盘，返回本金"&rs("paycent")&",多谢您的参与！"
Call qfmsg

	elseif rs1("ballvote")="(让半球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=1 and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
	elseif rs1("ballvote")="(让半球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=1 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg

    elseif rs1("ballvote")="(让半球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<1 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让半球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<1 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg

    
    elseif rs1("ballvote")="(让平手)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=1 and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让平手)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=1 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg  
    
    elseif rs1("ballvote")="(让平手)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<1 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让平手)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<1 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg  

    elseif rs1("ballvote")="(让一球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=2 and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让一球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=2 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg  
 
    
    elseif rs1("ballvote")="(让一球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<2 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让一球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<2 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg  
    
    elseif rs1("ballvote")="(让一球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=2 and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让一球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=2 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg  
    
    elseif rs1("ballvote")="(让一球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<2 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让一球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<2 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg   
    
    elseif rs1("ballvote")="(让一球半)" and abs(rs1("ballresult2"))-abs(rs1("ballresult1"))>=0 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让一球半)" and abs(rs1("ballresult2"))-abs(rs1("ballresult1"))>=0 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg   

    elseif rs1("ballvote")="(让二球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=3 and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让二球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=3 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg   

    elseif rs1("ballvote")="(让二球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<3 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让二球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<3 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg   
    
    elseif rs1("ballvote")="(让二球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=3 and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让二球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=3 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg   
    
    elseif rs1("ballvote")="(让二球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<3 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让二球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<3 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg     
    

    elseif rs1("ballvote")="(让二球半)" and abs(rs1("ballresult2"))-abs(rs1("ballresult1"))>=0 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让二球半)" and abs(rs1("ballresult2"))-abs(rs1("ballresult1"))>=0 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg     

    elseif rs1("ballvote")="(让平手/半球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))=0 and rs("typeID")=1 then
V_votenum=0.5
V_jbnum=int(rs("paycent")/2)
call addlist(V_votenum,V_jbnum)
'-------------输半
conn.Execute("update users set myjb=myjb+"&abs(V_jbnum)&" Where id=" & rs("usid"))
    elseif rs1("ballvote")="(让平手/半球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))=0 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，赢半返彩"&rs("paycent")/2&""&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg    


    elseif rs1("ballvote")="(让平手/半球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=1 and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让平手/半球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=1 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg    

    elseif rs1("ballvote")="(让平手/半球)" and abs(rs1("ballresult2"))-abs(rs1("ballresult1"))>=0 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让平手/半球)" and abs(rs1("ballresult2"))-abs(rs1("ballresult1"))>=0 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg    
    
    elseif rs1("ballvote")="(让半球/一球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))=1 and rs("typeID")=2 then
V_votenum=0.5
V_jbnum=int(rs("paycent")/2)
call addlist(V_votenum,V_jbnum)
'-------------输半
conn.Execute("update users set myjb=myjb+"&abs(V_jbnum)&" Where id=" & rs("usid"))
    elseif rs1("ballvote")="(让半球/一球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))=1 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，赢半返彩"&rs("paycent")/2&""&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg   
    
   
    elseif rs1("ballvote")="(让半球/一球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=2 and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让半球/一球)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=2 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg    
    
    elseif rs1("ballvote")="(让半球/一球)" and abs(rs1("ballresult2"))-abs(rs1("ballresult1"))>=0 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让半球/一球)" and abs(rs1("ballresult2"))-abs(rs1("ballresult1"))>=0 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg    

    elseif rs1("ballvote")="(让一球/球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))=1 and rs("typeID")=2 then
V_votenum=0.5
V_jbnum=int(rs("paycent")/2)
call addlist(V_votenum,V_jbnum)
'-------------输半
conn.Execute("update users set myjb=myjb+"&abs(V_jbnum)&" Where id=" & rs("usid"))
    elseif rs1("ballvote")="(让一球/球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))=1 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，赢半返彩"&rs("paycent")/2&""&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg    
     
    elseif rs1("ballvote")="(让一球/球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=2 and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum) 
    elseif rs1("ballvote")="(让一球/球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=2 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg    
    
     
    elseif rs1("ballvote")="(让一球/球半)" and abs(rs1("ballresult2"))-abs(rs1("ballresult1"))>=0 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让一球/球半)" and abs(rs1("ballresult2"))-abs(rs1("ballresult1"))>=0 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg    
    

    elseif rs1("ballvote")="(让两球/两球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))=2 and rs("typeID")=2 then
V_votenum=0.5
V_jbnum=int(rs("paycent")/2)
call addlist(V_votenum,V_jbnum)
'-------------输半
conn.Execute("update users set myjb=myjb+"&abs(V_jbnum)&" Where id=" & rs("usid"))
    elseif rs1("ballvote")="(让两球/两球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))=2 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，赢半返彩"&rs("paycent")/2&""&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg    
    
    
    elseif rs1("ballvote")="(让两球/两球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=3 and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让两球/两球半)" and abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>=3 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg    
    
    
    elseif rs1("ballvote")="(让两球/两球半)" and abs(rs1("ballresult2"))-abs(rs1("ballresult1"))>=0 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif rs1("ballvote")="(让两球/两球半)" and abs(rs1("ballresult2"))-abs(rs1("ballresult1"))>=0 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg    
	end if
	
elseif rs("vote")=2 then

if abs(rs1("ballresult2"))+abs(rs1("ballresult1"))<abs(rs1("balldx")) and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif abs(rs1("ballresult2"))+abs(rs1("ballresult1"))<abs(rs1("balldx")) and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg     
 
	elseif abs(rs1("ballresult2"))+abs(rs1("ballresult1"))>abs(rs1("balldx")) and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
	elseif abs(rs1("ballresult2"))+abs(rs1("ballresult1"))>abs(rs1("balldx")) and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg    
	
   end if
   
elseif rs("vote")=3 then
    dim ballresult
    ballresult=abs(rs1("ballresult2"))+abs(rs1("ballresult1"))
    if ballresult mod 2 =1 and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif ballresult mod 2 =1 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg  
    elseif ballresult mod 2 <>1 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg  
    elseif ballresult mod 2 <>1 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
   end if
   end if
   
   ELSE
   if rs("vote")=1 then
    if abs(rs1("ballresult2"))+abs(rs1("ballresult1"))=abs(rs1("ballvote")) then
 conn.Execute("update users set myjb=myjb+"&rs("paycent")&" Where id=" & rs("usid"))
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为：平盘，返回本金"&rs("paycent")&",多谢您的参与！"
Call qfmsg
 
 
    elseif abs(abs(rs1("ballresult1"))-abs(rs1("ballresult2"))) = abs(rs1("ballvote")) then
 conn.Execute("update users set myjb=myjb+"&rs("paycent")&" Where id=" & rs("usid"))
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为：平盘，返回本金"&rs("paycent")&",多谢您的参与！"
Call qfmsg
 
 
elseif abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>abs(rs1("ballvote")) and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
elseif abs(rs1("ballresult1"))-abs(rs1("ballresult2"))>abs(rs1("ballvote")) and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg   


    elseif abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<abs(rs1("ballvote")) and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif abs(rs1("ballresult1"))-abs(rs1("ballresult2"))<abs(rs1("ballvote")) and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg 
    
    
    
    elseif abs(rs1("ballresult1"))-abs(rs1("ballresult2"))=abs(rs1("ballvote")) and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif abs(rs1("ballresult1"))-abs(rs1("ballresult2"))=abs(rs1("ballvote")) and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg 


   elseif rs("vote")=2 then
if abs(rs1("ballresult2"))+abs(rs1("ballresult1"))<abs(rs1("balldx")) and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif abs(rs1("ballresult2"))+abs(rs1("ballresult1"))<abs(rs1("balldx")) and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg 
	elseif abs(rs1("ballresult2"))+abs(rs1("ballresult1"))>abs(rs1("balldx")) and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg 

	elseif abs(rs1("ballresult2"))+abs(rs1("ballresult1"))>abs(rs1("balldx")) and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
   end if
   
elseif rs("vote")=3 then
    ballresult=abs(rs1("ballresult2"))+abs(rs1("ballresult1"))
    if ballresult mod 2 =1 and rs("typeID")=2 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
    elseif ballresult mod 2 =1 and rs("typeID")=1 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg 
    elseif ballresult mod 2 <>1 and rs("typeID")=2 then
gettxt="您好，您在"&rs("votetxt")&",赛事中结果为："&rs1("ballresult1")&":"&rs1("ballresult2")&"，返彩"&rs("paycent")&getcent&",请到(url=/bbs/ball/ball_f.asp?sid=[sid]&saytk=[saytk])兑奖中心(/url)兑奖吧！多谢您的参与！"
Call qfmsg 
    
    elseif ballresult mod 2 <>1 and rs("typeID")=1 then
V_votenum=1
V_jbnum=rs("paycent")
call addlist(V_votenum,V_jbnum)
   end if
  end if
   END IF
       end if
   
    end if
    rs1.close
set rs1=nothing


  rs.MoveNext
  Loop
rs.close
set rs=nothing

Function addlist(V_votenum,V_jbnum)

dim rs2 
set rs2=Server.CreateObject("ADODB.Recordset")
rs2.open"select * from YD_plist where userid="&rs("usid"),ydzqconn,1,2
if not rs2.eof then
rs2("votenum")=rs2("votenum")-V_votenum
rs2("jbnum")=rs2("jbnum")-V_jbnum
else
rs2.addnew
rs2("userid")=myid
rs2("votenum")=rs2("votenum")-V_votenum
rs2("jbnum")=rs2("jbnum")-V_jbnum
end if
rs2.update
rs2.close
set rs2=nothing
'更新开奖
ydzqconn.Execute("update YD_voteid set  active=1 Where ballid=" & id)  
ydzqconn.Execute("update YD_vote set active=1 Where id=" & id)

End function

Function qfmsg()
  sql="insert into guest(fid,sid,fnr) values ("
  sql=sql & sqlstr(adminmsg) & ","
  sql=sql & sqlstr(rs("usid")) & ","
  sql=sql & sqlstr(gettxt) & ")"
  Application.Lock
  conn.execute(sql)
  Application.Unlock
End function
function sqlstr(data)
sqlstr="'" & Replace(data,"'","'") & "'"
End function

'更新开奖
ydzqconn.Execute("update YD_voteid set  active=1 Where ballid=" & id)  
ydzqconn.Execute("update YD_vote set active=1 Where id=" & id)
response.write "操作成功！开出结果为："&ballresult1&":"&ballresult2&"<br/>"
Response.write "<br/>----------------<br/>"
conn.close
set conn=nothing
ydzqconn.close
set ydzqconn=nothing
%>
<!--#include file="fanhui2.asp"-->
<%call headsay()%>