<!--#include file="../Inc.asp"-->
<!--#include file="../ydzq.asp"-->
<!--#include file="conn.asp"-->
<%
Call head()
dim paycent,vote,TP
paycent=usb(request("paycent"))
vote=usb(request("vote"))
TP=usb(request("TP"))

if TP="ok" then
if paycent="" or Isnumeric(paycent)=False then
  Call Error("<card title=""出错""><p>下注数额无效！")
  end if
  if vote="" or isnumeric(vote)=False then
    Call Error("<card title=""出错""><p>选择无效！")
  end if
if abs(vote)<0 or abs(vote)>9 then 
  Call Error("<card title=""出错""><p>选择无效！")
  end if
  
  dim bigpay,smallpay,fortime
  set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select bigpay,smallpay,fortime from YD_all where id=1",ydzqconn,1,1
if not rs.eof then
bigpay=rs("bigpay")
smallpay=rs("smallpay")
fortime=rs("fortime")
end if
rs.close
set rs=nothing
if abs(int(paycent))>abs(int(bigpay)) then
  Call Error("<card title=""出错""><p>为了增强互动性，每个投注最多"&abs(int(bigpay))&getcent&"！")
  end if
if abs(int(paycent))<abs(int(smallpay)) then
  Call Error("<card title=""出错""><p>为了增强互动性，每个投注最少"&abs(int(smallpay))&getcent&"！")
  end if
  

  '=-=========================
if clng(DateDiff("n", now(), jietime))<clng(fortime) then
 Call Error("<card title=""出错""><p>太可惜了，本期截止时间已到，不能再下注了！")
end if

if now()>jietime then
 Call Error("<card title=""出错""><p>太可惜了，本期截止时间已到，不能再下注了！")
end if
if myjb<abs(int(payCent)) then
  Call Error("<card title=""出错""><p>您的"&getcent&"不足本次投注！")
  end if
Call saycarda("独尾投注")

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from YD_vote where votetime >= DateAdd('s', -10, Now()) and userid="&myid,ydzqconn,1,2
if not rs.eof then
  Call Error("投注太快，请等待10秒再进行投注！")
  end if
rs.addnew
rs("typeID")=11
rs("vote")=vote
rs("username")=myni
rs("userid")=myid
rs("payCent")=payCent
rs("qinum")=qinum
rs("votetime")=now()
rs.update
rs.close
set rs=nothing

conn.execute("update Users set myjb=myjb-"&abs(int(payCent))&" where ID="&myid)
ydzqconn.execute("update YD_info set tznum=tznum+1,jbnum=jbnum+"&abs(int(payCent))&" where qinum='"&qinum&"'")



response.write "投注成功！系统扣除您的"&payCent&getcent&"！<br/>"

else
set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select dwcent from YD_payCent where id=1",ydzqconn,1,1
if not rs.eof then
dwcent=rs("dwcent")
end if
rs.close
set rs=nothing
Call saycarda("独尾投注")



Response.write "您目前共有"&myjb&getcent&"<br/>"
Response.write "第"&qinum&"期独尾投注,买中赔率"&dwcent&"倍！<br/>"
call xlanlj("voteadddw.asp?sid="&sid&"&amp;saytk="&saytk&"")
Response.write "请输入您的下注额:<input name=""paycent"" emptyok=""true"" format=""*N"" value=""0""/>"&getcent&"<br/>"
response.write "请选择平码尾数:"
response.write "<select title='尾数' name='vote' value='0'>"&chr(13)
response.write "<option title='0' value='0'>0尾</option>"&chr(13)
response.write "<option title='1' value='1'>1尾</option>"&chr(13)
response.write "<option title='2' value='2'>2尾</option>"&chr(13)
response.write "<option title='3' value='3'>3尾</option>"&chr(13)
response.write "<option title='4' value='4'>4尾</option>"&chr(13)
response.write "<option title='5' value='5'>5尾</option>"&chr(13)
response.write "<option title='6' value='6'>6尾</option>"&chr(13)
response.write "<option title='7' value='7'>7尾</option>"&chr(13)
response.write "<option title='8' value='8'>8尾</option>"&chr(13)
response.write "<option title='9' value='9'>9尾</option>"&chr(13)
response.write "</select><br/>"
if saytk>1 then
call xltjlj("tp","ok")
call xlanlj1("OK!决定了")
else
response.write "<anchor>OK!决定了"
response.write "<go href=""voteadddw.asp?sid="&sid&"&amp;saytk="&saytk&""" method=""post"" accept-charset=""utf-8"">"

response.write "<postfield name=""paycent"" value=""$(paycent)""/>"
response.write "<postfield name=""vote"" value=""$(vote)""/>"
response.write "<postfield name=""TP"" value=""ok""/>"
response.write "</go></anchor><br/>"
end if
end if
response.write "【我的投注】<br/>"
response.write "<a href=""mynowvote.asp?sid="&sid&""">我的投注</a>"&chr(13)
response.write "<a href=""myvote.asp?sid="&sid&""">历史投注</a><br/>"&chr(13)

response.write "<a href=""index.asp?sid="&sid&""">返回虚拟投注</a>"

conn.close
set conn=nothing
ydzqconn.close
set ydzqconn=nothing

%>
<!--#include file="fanhui.asp"-->
<%call head1()%>