<!--#include file="conn.asp"-->
<%
response.Write session("admin")
'response.End()
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('帐号信息丢失,请重新登录!');window.open('login0.asp','_self');</script>"
response.End
end if
if session("rank")>2 then
response.Write "<script language='javascript'>alert('你无权添加修改商品信息!');history.go(-1);</script>"
response.End
end if
dim action,id,temp,strContent,i,strDetail
id=SafeRequest("id",1)
action=FormatSQL(SafeRequest("action",0))
select case action
case "add"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from product",conn,1,3
rs.AddNew
rs("admin")=session("admin")
rs("name")=trim(request.form("name"))
if trim(request.form("mark"))<>"" then
rs("mark")=trim(request.form("mark"))
else
rs("mark")="其他"
end if
rs("introduce")=trim(request.form("introduce"))
rs("pic")=trim(request.form("pic"))
rs("photo")=trim(request.form("photo"))
rs("addlink")=trim(request.form("addlink"))
rs("categoryid")=int(request.form("categoryid"))
rs("sortsid")=int(request.form("sortsid"))
rs("recommend")=trim(request.form("recommend"))
rs("adddate")=Now()
rs("viewnum")=0
For i = 1 To Request.Form("detail").Count
strDetail = strDetail & Request.Form("detail")(i)
Next
rs("detail")=strDetail
For i = 1 To Request.Form("content").Count
strContent = strContent & Request.Form("content")(i)
Next
rs("content")=strContent
rs.Update
rs.close
conn.close
set conn=nothing
response.Write "<script language=javascript>alert('添加成功!');history.go(-1);</script>"
response.End