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

<%Call head()
Call saycardd("种植")
dim action
dim userid,ids,TP,id,qq
dim name,intname
dim ssqa
randomize timer
ssqa=Int((25)*Rnd +5)
id=request("id")
ids=request("ids")
if id="" or IsNumeric(userid)=False then
  Call Error("土地ID无效！")
  end if
if ids="" or IsNumeric(userid)=False then
  Call Error("作物ID无效！")
  end if

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from sd where id="&ids,connnong,1,1
jinyan=rs("jinyan")
rs.close
Set rs=nothing

Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT * FROM farm where id="&id&" and usid="&myid&"",connnong,1,2
if rs.eof then
response.write "种植失败<br/>"
else
if rs("chenzhang")<=0 then
rs("intname")=ids
rs("times")=now()
rs("chenzhang")="1"
rs("ji1")="1"
rs("ji")="1"
rs("chanl")=ssqa

connnong.execute("update beibao set shuliang=shuliang-1 where usid="&myid&" and lx="&ids)

rs.update
response.write nonglx(ids)
response.write "种植成功,经验+"&jinyan&"<br/>"

if myid<>0 then
mz="[url=/bbs/nongchang/?userid="&myid&"&amp;saytk=[saytk]&amp;sid=[sid]]"&myni&"[/url]"
else
mz="游客"&Replace(time(),":","")&""
end If
connnong.execute("insert into nongdt(shijian,dz,fid,tid,ids) values('"&now&"','"&mz&"播种了满满一块地','"&userid&"','"&myid&"','"&ids&"')")


else
response.write "请勿重复种植<br/>"
end if
rs.close
set rs=Nothing
connnong.execute("update farm set jinyan=jinyan+"&jinyan&" where usid="&myid)
end if


Response.write "<br/>------------<br/>"
Response.write "<br/><a href='index.asp?sid="&sid&"&amp;saytk="&saytk&"'>返回我的农场</a><br/>"&chr(13)
connnong.close
set connnong=Nothing
%>
<!--#include file="../../fanhui.asp"-->
<%Call head1()%>