<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<!--#include file="conn.asp"-->
<%
call head
dim TP,Action,id
Action=Request.QueryString("Action")
id=usb(request("id"))
tp=usb(request("tp"))
mc=usb(request("mc"))
tpian=usb(request("tpian"))
jg=usb(request("jg"))
sl=usb(request("sl"))
cl=usb(request("cl"))
jy=usb(request("jy"))
sj=usb(request("sj"))
if tp<>1 then
if mc="" then
  Call Error("名称不能为空！")
  end if
  if jg="" then
  Call Error("价格不能为空！")
  end if
  if sl="" then
  Call Error("数量不能为空！")
  end if
   if cl="" then
  Call Error("产量不能为空！")
  end if
   if jy="" then
  Call Error("经验不能为空！")
  end if
   if sj="" then
  Call Error("时间不能为空！")
  end if
  Call saycardd("添加商品成功")
  set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from sd",connnong,1,2
rs.addnew
rs("name")=mc
rs("tou")=tpian
rs("jiage")=jg
rs("shuliang")=sl
rs("chanl")=cl
rs("jinyan")=jy
rs("times")=sj
rs.update
rs.close
set rs=nothing
 Response.Write "商品添加成功"
else
  Call saycardd("添加商品")
  if saytk<>1 then
	Response.write "<form name=""form"" method=""post""action=""?action=t&amp;sid="&sid&"&amp;saytk="&saytk&"&amp;TP=2"">"
end if
 Response.Write "商品名称："
 Response.Write "<input name=""mc"" emptyok=""true"" maxlength=""30"" value=""""/><br/>"
 Response.Write "商品图片："
 Response.Write "<input name=""tpian"" emptyok=""true"" maxlength=""30""/><br/>"
 Response.Write "商品价格："
 Response.Write "<input name=""jg""  emptyok=""true"" maxlength=""30""/><br/>"
 Response.Write "商品数量："
 Response.Write "<input name=""sl"" emptyok=""true"" maxlength=""30""/><br/>"
  Response.Write "植物产量："
 Response.Write "<input name=""cl"" emptyok=""true"" maxlength=""30""/><br/>"
  Response.Write "播种经验："
 Response.Write "<input name=""jy"" emptyok=""true"" maxlength=""30""/><br/>"
   Response.Write "成熟时间(小时制)："
 Response.Write "<input name=""sj"" emptyok=""true"" maxlength=""30"" size=""8""/><br/>"
 if saytk<>1 then
%>
<input type="submit" name="Submit" value="确定提交"></form><br/>
<%else
Response.Write "<anchor>[确定提交]"
Response.Write "<go href=""?action=t&amp;sid="&sid&"&amp;saytk="&saytk&"&amp;tp=2"" method=""post"" accept-charset='utf-8'>"
Response.Write "<postfield name=""mc"" value=""$(mc)""/>"
Response.Write "<postfield name=""tpian"" value=""$(tpian)""/>"
Response.Write "<postfield name=""jg"" value=""$(jg)""/>"
Response.Write "<postfield name=""sl"" value=""$(sl)""/>"
Response.Write "<postfield name=""cl"" value=""$(cl)""/>"
Response.Write "<postfield name=""jy"" value=""$(jy)""/>"
Response.Write "<postfield name=""sj"" value=""$(sj)""/>"
Response.Write "</go></anchor><br/>"
 end if
end if
Response.Write "<br/><a href=""cksd.asp?sid="&sid&"&amp;saytk="&saytk&""">返回商店后台</a>"
%>
<!--#include file="fanf.asp"-->
<%call head1()%>