<!--#include file="ljconn.asp"-->
<%
lb=request("lb")
aid=request("s1")
aaid=request("s2")
aaaid=request("s3")
if aaaid="" then
aaaid=0
else
aaaid=request("s3")
end if
title=request("title")
content=request("content")

px=request("px")
if px="" then
px=0
end if

userid=request("userid")
zxtj=request("zxtj")
rmwz=request("rmwz")
gjz=request("gjz")
fbsj=request("fbsj")
img=request("img")
%>

<%
id=request("id")
action=request.QueryString("action")
select case action
case "add"
'检查排序是否被占用开始－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from shop_books",conn,1,3
rs.AddNew
rs("aid")=aid
rs("aaid")=aaid
rs("aaaid")=aaaid
rs("title")=title
rs("content")=content
rs("px")=px
rs("userid")=userid
rs("zxtj")=zxtj
rs("rmwz")=rmwz
rs("gjz")=gjz
rs("fbsj")=fbsj
rs("img")=img
rs.Update
rs.Close
response.Write "<script language=javascript>alert('添加成功！');location.href='addbook.asp';</script>"
response.End
case "edit"
if lb=1 then
if aid="" or aaid="" then
response.Write "<script language=javascript>alert('一级分类或二级分类不能为空！');history.go(-1);</script>"
response.End
end if
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from shop_books where id="&id,conn,1,3
if lb=1 then
rs("aid")=aid '
rs("aaid")=aaid '
rs("aaaid")=aaaid '
end if
rs("title")=title
rs("content")=content
rs("px")=px
rs("userid")=userid
rs("zxtj")=zxtj
rs("rmwz")=rmwz
rs("gjz")=gjz
rs("fbsj")=fbsj
rs("img")=img
rs("adddate")=Now()
rs.Update
rs.Close
set rs=nothing
response.Write "<script language=javascript>alert('修改成功！');location.href='manageshop_books.asp';</script>"
response.End
end select
%>