<!--#include file="connn.asp"-->
<!--#include file="cookies.asp"-->
<%
if request.form("name")="" then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('请填写名称！');history.go(-1);</script>"
response.End
end if

if Not isNumeric(request.form("vipprice")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('折扣必须是数字！');history.go(-1);</script>"
response.End
end if

dim productdate
productdate=trim(request.form("date"))
dim action,id,temp,strContent,i,strDetail
id=Request("id")
action=Request("action")




select case action
case "add"
	For i = 1 To Request.Form("detail").Count 
		strDetail = strDetail & Request.Form("detail")(i) 
	Next 
	sql="Insert into FOX_xiao(name,mark,vipprice,spic,pic,foxq,p1,p2,p3,p4,p5,p6,p7,p8,categoryid,recommend,waitime,sheng,shi,beizhu,detail,code,pweight,adddate,telll,luuu) values('"&trim(request.form("name"))&"','"&trim(request.form("mark"))&"',"&trim(request.form("vipprice"))&",'"&trim(request.form("spic"))&"','"&trim(request.form("pic"))&"','"&trim(request.form("foxq"))&"','"&trim(request.form("p1"))&"','"&trim(request.form("p2"))&"','"&trim(request.form("p3"))&"','"&trim(request.form("p4"))&"','"&trim(request.form("p5"))&"','"&trim(request.form("p6"))&"','"&trim(request.form("p7"))&"','"&trim(request.form("p8"))&"',"&trim(request.form("categoryid"))&",'"&trim(request.form("recommend"))&"','"&trim(request.form("waitime"))&"',"&trim(request.form("sheng"))&","&trim(request.form("shi"))&",'"&trim(request.form("beizhu"))&"','"&strDetail&"','"&trim(request.form("code"))&"','"&trim(request.form("pweight"))&"','"&now&"','"&trim(request.form("telll"))&"','"&trim(request.form("luuu"))&"')"
	'response.write sql
	'response.end
	conn.execute(sql)
response.Write "<script language=javascript>alert('添加成功！');history.go(-1);</script>"
response.End

case "edit"
	For i = 1 To Request.Form("detail").Count 
		strDetail = strDetail & Request.Form("detail")(i) 
	Next 

	sql = "Update Fox_xiao set name='"&trim(request.form("name"))&"',mark='"&trim(request.form("mark")) &"',code='"&trim(request.form("code")) &"',telll='"&trim(request.form("telll")) &"',luuu='"&trim(request.form("luuu")) &"',pweight='"&trim(request.form("pweight")) &"',vipprice="&trim(request.form("vipprice"))&",foxq='"&trim(request.form("foxq")) &"',p1='"&trim(request.form("p1")) &"',p2='"&trim(request.form("p2")) &"',p3='"&trim(request.form("p3")) &"',p4='"&trim(request.form("p4")) &"',p5='"&trim(request.form("p5")) &"',p6='"&trim(request.form("p6")) &"',p7='"&trim(request.form("p7")) &"',p8='"&trim(request.form("p8")) &"',pic='"&trim(request.form("pic")) &"',spic='"&trim(request.form("spic"))&"',waitime='"&trim(request.form("waitime"))&"',beizhu='"&trim(request.form("beizhu"))&"',categoryid="&int(request.form("categoryid"))&",recommend="&trim(request.form("recommend"))&",detail='"&strDetail&"' where id="&id			    
	'response.write sql
	'response.end
	conn.execute(sql)
	response.Write "<script language=javascript>alert('修改成功！');history.go(-1);</script>"
	response.End
end select
%>

</body></html>