<!--#include file="conn.asp"-->
<%
if request("bookname")="" then
response.Write "对不起,添加失败,请用正确的方式添加票品!"
response.End
end if
function HTMLEncode2(fString)
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
HTMLEncode2 = fString
end function
dim bookdate,dazhe
dazhe=trim(request("huiyuanjia"))
dim action,bookid
bookid=request.QueryString("id")
action=request.QueryString("action")
shjianame=request.cookies("cnhww")("shjianame")
select case action
case "add"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from products",conn,1,3
rs.AddNew
rs("mch")=trim(request("mch"))
rs("pp")=trim(request("pp"))
rs("isbn1")=trim(request("isbn1"))
rs("jj")=trim(request("jj"))
rs("jg")=trim(request("jg"))
rs("zl")=trim(request("zl"))
rs("tp")=trim(request("tp"))
rs("nr")=trim(request("nr"))
rs("bh")=trim(request("bh"))
rs("anclassid")=int(request("anclassid"))
rs("nclassid")=int(request("nclassid"))
rs("bookname")=trim(request("bookname"))
rs("grade")=trim(request("grade"))
rs("pingpai")=trim(request("pingpai"))
rs("isbn")=trim(request("isbn"))
rs("jssj")=trim(request("jssj"))
rs("bookchuban")=trim(request("bookchuban"))
rs("huiyuanjia")=trim(request("huiyuanjia"))
rs("vipjia")=trim(request("vipjia"))
rs("dazhe")=dazhe
rs("bookpic")=trim(request("bookpic"))
rs("zhuang")=trim(request("zhuang"))
rs("qwtp")=Trim(request("qwtp"))
rs("ditu")=Trim(request("ditu"))
rs("bookcontent")=htmlencode2(trim(request("bookcontent")))
if request("bestbook")=1 then
rs("bestbook")=1
else
rs("bestbook")=0
end if
if request("newsbook")=1 then
rs("newsbook")=1
else
rs("newsbook")=0
end if
if request("tejiabook")=1 then
rs("tejiabook")=1
else
rs("tejiabook")=0
end If
if request("huigubook")=1 then
rs("huigubook")=1
else
rs("huigubook")=0
end if
rs("liulancount")=0
rs("adddate")=now()
rs("pingji")=0
rs("pingjizong")=0
rs.Update
bookid=rs("bookid")
rs.Close
set rs=Nothing
set rs1=server.CreateObject("adodb.recordset")
rs1.Open "select * from piaojiab",conn,1,3
rs1.AddNew
rs1("piaojia")=trim(request("shichangjia1"))
rs1("kucun")=trim(request("kucun"))
rs1("chengjiaocount")=Trim(request("chengjiaocount"))
rs1("leiyanbid")=bookid
rs1("piaojiaid")=bookid
rs1("jifen")=trim(request("yeshu"))
rs1.close
Set rs1=nothing
response.Write "<script language=javascript>alert('添加成功!');history.go(-2);</script>"
response.End
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from products where bookid="&bookid,conn,1,3
rs("mch")=trim(request("mch"))
rs("pp")=trim(request("pp"))
rs("isbn1")=trim(request("isbn1"))
rs("jj")=trim(request("jj"))
rs("jg")=trim(request("jg"))
rs("zl")=trim(request("zl"))
rs("tp")=trim(request("tp"))
rs("nr")=trim(request("nr"))
rs("bh")=trim(request("bh"))
rs("anclassid")=int(request("anclassid"))
rs("nclassid")=int(request("nclassid"))
rs("bookname")=trim(request("bookname"))
rs("pingpai")=trim(request("pingpai"))
rs("grade")=trim(request("grade"))
rs("isbn")=trim(request("isbn"))
rs("jssj")=trim(request("jssj"))
rs("bookchuban")=trim(request("bookchuban"))
rs("huiyuanjia")=trim(request("huiyuanjia"))
rs("vipjia")=trim(request("vipjia"))
rs("dazhe")=dazhe
rs("bookpic")=trim(request("bookpic"))
rs("zhuang")=trim(request("zhuang"))
rs("qwtp")=trim(request("qwtp"))
rs("ditu")=trim(request("ditu"))
rs("bookcontent")=trim(request("bookcontent"))
if request("bestbook")=1 then
rs("bestbook")=1
else
rs("bestbook")=0
end if
if request("newsbook")=1 then
rs("newsbook")=1
else
rs("newsbook")=0
end if
if request("tejiabook")=1 then
rs("tejiabook")=1
else
rs("tejiabook")=0
end If
if request("huigubook")=1 then
rs("huigubook")=1
else
rs("huigubook")=0
end if
rs.Update
rs.Close
set rs=Nothing
set rs1=server.CreateObject("adodb.recordset")
rs1.Open "select * from piaojiab",conn,1,3
rs1("piaojia")=trim(request("piaojia"))
rs1("kucun")=trim(request("kucun"))
rs1("chengjiaocount")=Trim(request("chengjiaocount"))
rs1("leiyanbid")=bookid
rs1("piaojiaid")=bookid
rs1("jifen")=trim(request("jifen"))
rs1.close
Set rs1=Nothing
response.Write "<script language=javascript>alert('修改成功!');history.go(-2);</script>"
response.End
end select
%>
这个是数据存储页,请高手看下,哪儿错了要改!!!