<!--#include file="conn.asp"-->
<%
if request.cookies("bjx")("shjianame")="" then
response.Redirect "shjia.asp"
response.End
end if
action=request("action")
select case action
case "add"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from card ",conn,1,3
rs.AddNew
rs("cardhao")=trim(request("cardhao")) 
rs("cardmima")=trim(request("cardmima")) 
rs("bookid")=trim(request("bookid")) 
rs.Update
rs.Close
set rs=nothing
response.Write "<script language='javascript'>alert('添加成功！');window.location.href='addcard.asp?bookid="&request("bookid")&"';</script>"
response.End

case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from card where cardid="&request("cardid")&" ",conn,1,3
rs("cardhao")=trim(request("cardhao")) 
rs("cardmima")=trim(request("cardmima")) 
rs.Update
rs.Close
set rs=nothing
response.Write "<script language='javascript'>alert('添加成功！');window.location.href='addcard.asp?bookid="&request("bookid")&"';</script>"
response.End
case "del"
conn.execute "delete from card where cardid="&request("cardid")&"  "
response.Write "<script language='javascript'>alert('删除成功！');window.location.href='addcard.asp?bookid="&request("bookid")&"';</script>"
response.End
end select
%>