<!--#include file="inc.asp"-->
<!--#include file="conn.asp"-->
<%call saycardd("编辑开奖")%>
<%
dim id,qi,num,qi2
id=request("id")
tm=request("tm")
pm1=request("pm1")
pm2=request("pm2")
pm3=request("pm3")
pm4=request("pm4")
pm5=request("pm5")
pm6=request("pm6")

qi2=request("qi2")
TP=request("TP")
if id="" or IsNumeric(ID)=False then
  Call Error("ID无效！")
  end if

if TP<>"" then
if tm="" or IsNumeric(tm)=False then
  Call Error("号码无效！")
  end if
  tm=clng(tm)
if qi2="" or IsNumeric(qi2)=False then
  Call Error("期数无效！")
  end if
if pm1="" or IsNumeric(pm1)=False or pm2="" or IsNumeric(pm2)=False or pm3="" or IsNumeric(pm3)=False or pm4="" or IsNumeric(pm4)=False or pm5="" or IsNumeric(pm5)=False or pm6="" or IsNumeric(pm6)=False then
call error("平码填写错误！")
end if

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from YD_info where id="&id,ydzqconn,1,2
rs("tm")=tm
rs("qinum")=qi2
rs("pm1")=pm1
rs("pm2")=pm2
rs("pm3")=pm3
rs("pm4")=pm4
rs("pm5")=pm5
rs("pm6")=pm6
rs.update
rs.close
set rs=nothing
response.write"编辑成功！<br/>"
else
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from YD_info where id="&id,ydzqconn,1,1
if rs.eof then
rs.close
set rs=nothing
call error(" 不存在的记录！")
end if
 Response.Write "编辑第"&qi&"开奖："
  Response.Write "期数:"

if saytk>1 then

call xlanlj("tmedit.asp?ID="&id&"&amp;saytk="&saytk&"&amp;sid="&sid&"")
 Response.Write "<input name=""qi2"" value="""&rs("qinum")&"""/><br/>"
 
 Response.Write "特码:"
 Response.Write "<input name=""tm"" value="""&rs("tm")&"""/><br/>"%>
平码:<input emptyok="true" name="pm1" value="<%=rs("pm1")%>" size="2"/>-<input emptyok="true" name="pm2" value="<%=rs("pm2")%>" size="2"/>-<input emptyok="true" name="pm3" value="<%=rs("pm3")%>" size="2"/>-<input emptyok="true" name="pm4" value="<%=rs("pm4")%>" size="2"/>-<input emptyok="true" name="pm5" value="<%=rs("pm5")%>" size="2"/>-<input emptyok="true" name="pm6" value="<%=rs("pm6")%>" size="2"/><br/>
<%
call xltjlj("tp","1")
call xlanlj1("确定提交")
rs.close
set rs=nothing
conn.close
set conn=nothing
ydzqconn.close
set ydzqconn=nothing
else
 Response.Write "<input name=""qi2"&tt&""" value="""&rs("qinum")&"""/><br/>"
 
 Response.Write "特码:"
 Response.Write "<input name=""tm"&tt&""" value="""&rs("tm")&"""/><br/>"%>
平码:<input emptyok="true" name="pm1<%=tt%>" value="<%=rs("pm1")%>" size="2"/>-<input emptyok="true" name="pm2<%=tt%>" value="<%=rs("pm2")%>" size="2"/>-<input emptyok="true" name="pm3<%=tt%>" value="<%=rs("pm3")%>" size="2"/>-<input emptyok="true" name="pm4<%=tt%>" value="<%=rs("pm4")%>" size="2"/>-<input emptyok="true" name="pm5<%=tt%>" value="<%=rs("pm5")%>" size="2"/>-<input emptyok="true" name="pm6<%=tt%>" value="<%=rs("pm6")%>" size="2"/><br/>
<%

rs.close
set rs=nothing
conn.close
set conn=nothing
ydzqconn.close
set ydzqconn=nothing
Response.Write "<anchor>[确定提交]"
 Response.Write "<go href=""tmedit.asp?ID="&id&"&amp;saytk="&saytk&"&amp;sid="&sid&""" method=""post"" accept-charset='utf-8'>"
 Response.Write "<postfield name=""qi2"" value=""$(qi2"&tt&")""/>"
 Response.Write "<postfield name=""tm"" value=""$(tm"&tt&")""/>"
 Response.Write "<postfield name=""pm1"" value=""$(pm1"&tt&")""/>"
 Response.Write "<postfield name=""pm2"" value=""$(pm2"&tt&")""/>"
 Response.Write "<postfield name=""pm3"" value=""$(pm3"&tt&")""/>"
 Response.Write "<postfield name=""pm4"" value=""$(pm4"&tt&")""/>"
 Response.Write "<postfield name=""pm5"" value=""$(pm5"&tt&")""/>"
 Response.Write "<postfield name=""pm6"" value=""$(pm6"&tt&")""/>"
 Response.Write "<postfield name=""TP"" value=""1""/>"
 Response.Write "</go></anchor><br/>"
 end if
 Response.Write "<a href='dellist.asp?ID="&id&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>[删除记录]</a><br/>"
end if
 Response.Write "<a href='tmlist.asp?saytk="&saytk&"&amp;sid="&sid&"'>返回开奖记录</a>"
%>
<br/><a href="adminvote.asp?saytk=<%=saytk%>&amp;sid=<%=sid%>">[投注管理]</a>
<!--#include file="fanhui.asp"-->
<%call head1()%>