<!--#include file="conn.asp"-->
<%
if request("kahao")="" or request("mima")="" 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 action

action=request.QueryString("action")
 
select case action
case "add"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from ka where id=null",conn,1,3
rs.AddNew
rs("kahao")=request("kahao") '大类
rs("mima")=request("mima") '小类
rs("bookid")=request("bookid") '小类
rs.Update
id=rs("id")
rs.Close
set rs=nothing
response.Write "<script language=javascript>alert('添加成功！返回列表！');window.location.href='manageka.asp';</script>"
response.End

case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from ka where id="&id,conn,1,3
rs("kahao")=request("kahao") '大类
rs("mima")=request("mima") '小
rs("bookid")=request("bookid") '小类
rs.Update
rs.Close
set rs=nothing
response.Write "<script language=javascript>alert('修改成功！');window.location.href='manageka.asp';</script>"
response.End
end select
%>
