<!--#include file="inc.asp"-->
<!--#include file="conn.asp"-->
<%
call saycardd("开通下期投注")

dim TP,qi1
TP=request("TP")
IF TP<>"" then
jietime=request("jietime")
qi1=request("qi1")

if jietime="" then
  Call Error("时间不能为空！")
end if
if IsDate(jietime)=False then
  Call Error("时间格式不对！")
end if
if qi1="" or Isnumeric(qi1)=False then
call error("期数无效！")
end if
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from YD_info",YdZQconn,1,2
rs.addnew
rs("qinum")=qi1
rs("jietime")=jietime
rs.update
rs.close
set rs=nothing
Response.Write ""&qi1&"期开通成功！截止时间到"&jietime&"<br/>"
else

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select top 1 * from YD_info order by id desc",ydzqconn,1,1
if not rs.eof then
tum=rs("tm")
end if
rs.close
set rs=nothing

if tum="" or isnumeric(tum)=False then
call error("上期没有开奖，不能开通下期！")
end if
response.write"请准确输入期数，不能在期数前面加0，如001期应写成1<br/>"
if saytk>1 then
call xlanlj("openvote.asp?saytk="&saytk&"&amp;sid="&sid&"")
response.write"第<input name=""qi1"" value="""&qinum+1&""" size=""3""/>期"
response.write"截止时间<br/>"
response.write"<input name=""jietime"" value="""&now&"""/><br/>"
call xltjlj("tp","1")
call xlanlj1("确定开通")
else
response.write"第<input name=""qi1"&tt&""" value="""&qinum+1&""" size=""3""/>期"
response.write"截止时间<br/>"
response.write"<input name=""jietime"&tt&""" value="""&now&"""/><br/>"
response.write"<anchor>确定开通<go href='openvote.asp?saytk="&saytk&"&amp;sid="&sid&"' method='post' accept-charset='utf-8'>"
response.write"<postfield name='qi1' value='$(qi1"&tt&")'/>"
response.write"<postfield name='jietime' value='$(jietime"&tt&")'/>"
response.write"<postfield name='TP' value='1'/>"
response.write"</go></anchor><br/>"
end if
end if
%>
----------<br/><a href="adminvote.asp?saytk=<%=saytk%>&amp;sid=<%=sid%>">[投注管理]</a>
<!--#include file="fanhui.asp"-->
<%call head1%>