<!--#include file="book_conn.asp"-->
<%
if request("shop_name")="" then
response.write "<script LANGUAGE='javascript'>alert('请输入房间名称！');history.go(-1);</script>"
response.End
end if
if request("shop_bh")="" then
response.write "<script LANGUAGE='javascript'>alert('请输入房间编号！');history.go(-1);</script>"
response.End
end if
if request("shop_bh")<>"" then
prodid=request("shop_bh")
sql="select * from shop where prodid='"&prodid &"'"
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.open sql,conn,1,1
if not (rs1.eof or rs1.bof) then
response.write "<script LANGUAGE='javascript'>alert('房间编号已存在，请重新输入！');history.go(-1);</script>"
response.end
end if
end if
rs1.close
set rs1=nothing
if request("shop_msj")="" then
response.write "<script LANGUAGE='javascript'>alert('请输入房间门市价!');history.go(-1);</script>"
response.End
end if
if request("shop_jg")="" then
response.write "<script LANGUAGE='javascript'>alert('请输入房间会员价！');history.go(-1);</script>"
response.End
end if



if request("shop_sm")="" then
response.write "<script LANGUAGE='javascript'>alert('请输入房间说明！');history.go(-1);</script>"
response.End
end if

Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "SELECT  * From shop",conn,1,3
rs.addnew
rs("shop_name")=request("shop_name")
rs("prodid")=request("shop_bh")
rs("shoppic")=request("shoppic")
rs("ss")=request("ss")
rs("eng_name")=request("eng_name")
rs("shop_lx")=request("shop_lx")
rs("shop_msj")=request("shop_msj")
rs("shop_jg")=request("shop_jg")
rs("shop_dw")=request("shop_dw")
rs("shop_sl")=request("shop_sl")
rs("shop_tp")=request("bookpic1")
rs("shop_jj")=request("shop_jj")
rs("shop_sm")=request("shop_sm")
if request("shop_tj") <> "" then
rs("shop_tj")=request("shop_tj")
end if 
if request("shop_tbtj") <> "" then
rs("shop_tbtj")=request("shop_tbtj")
end if 
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "<script language='javascript'>"
response.write "alert('添加成功！');"
response.write "location.href='shop.asp';"			
response.write "</script>"
%>
 
