<%dbdns="../../"%>
<!--#include file="../../inc/conn.asp"-->
<!--#include file="../cook.asp"-->
<%if fla7<>1 then
response.write "<script>alert('操作权限出错，您没有权限操作些功能');history.go(-1);</Script>"
Response.End 
end if%>
<%page=request("page")
if page="" then page=1
'====================================================获取数据
z_name=request("z_name")
z_web=request("z_web")
by=request("by")
bm=request("bm")
bd=request("bd")
ly=request("ly")
lm=request("lm")
ld=request("ld")
jzy=request("jzy")
jzm=request("jzm")
jzd=request("jzd")
addone_id=request("addone_id")
addtwo_id=request("addtwo_id")
z_zgname=request("z_zgname")
z_lr=request("z_lr")
z_jb=request("z_jb")
z_cb=request("z_cb")
z_xb=request("z_xb")
z_others=request("z_others")
z_zq=request("z_zq")
z_sj=request("z_sj")
z_cbdate=request("z_cbdate")
z_qy=request("z_qy")
ypxxone_id=request("ypxxone_id")
ypxxtwo_id=request("ypxxtwo_id")
z_xz=request("z_xz")
key2=request("key2")

z_begindate=cdate(by&"-"&bm&"-"&bd)
z_lastdate=cdate(ly&"-"&lm&"-"&ld)
z_jzdate=cdate(jzy&"-"&jzm&"-"&jzd)
if addone_id="" then addone_id=0
if addtwo_id="" then addtwo_id=0
if ypxxone_id="" then ypxxone_id=0
if ypxxtwo_id="" then ypxxtwo_id=0

if cb="" then cb=null
if xb="" then xb=null
if z_others="" then z_others=null
if z_zq="" then z_zq=null
if z_sj="" then z_sj=0
if z_cbdate="" then z_cbdate=null
if z_web="" then z_web=null
if z_qy="国际展会" then
addone_id=0
addtwo_id=0
end if
'====================================================添加数据
if request("action")="add" then

set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from dlxf_exhibit"
rs.open sql,conn,1,3
rs.addnew
rs("dlxf_z_name")=z_name
rs("dlxf_z_web")=z_web
rs("dlxf_addone_id")=addone_id
rs("dlxf_addtwo_id")=addtwo_id
rs("dlxf_z_zgname")=z_zgname
rs("dlxf_z_lr")=z_lr
rs("dlxf_z_jb")=z_jb
rs("dlxf_z_cb")=z_cb
rs("dlxf_z_xb")=z_xb
rs("dlxf_z_others")=z_others
rs("dlxf_z_zq")=z_zq
rs("dlxf_z_sj")=z_sj
rs("dlxf_z_cbdate")=z_cbdate
rs("dlxf_z_qy")=z_qy
rs("dlxf_ypxxone_id")=ypxxone_id
rs("dlxf_ypxxtwo_id")=ypxxtwo_id
rs("dlxf_z_xz")=z_xz
rs("dlxf_key2")=key2
rs("dlxf_z_begindate")=z_begindate
rs("dlxf_z_lastdate")=z_lastdate
rs("dlxf_z_jzdate")=z_jzdate
rs("dlxf_z_enrol")=1
rs("dlxf_key")=1
rs.update
rs.close
set rs=nothing

response.redirect"exhibit_add.asp"

elseif request("action")="edit" then
cityping=split(cityping,"|")
for i=0 to UBound(cityping)
if instr(z_name,cityping(i)) or instr(z_zgname,cityping(i)) or instr(z_lr,cityping(i)) or instr(z_others,cityping(i)) then
response.write"<script>alert('发布展会出错，下面是产生错误的可能原因：\n\n·在您的展会内容中含有敏感字符');history.go(-1);</script>"
response.end
end if
next

set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from dlxf_exhibit where dlxf_id="&request("id")
rs.open sql,conn,1,3

rs("dlxf_z_name")=z_name
rs("dlxf_z_web")=z_web
rs("dlxf_addone_id")=addone_id
rs("dlxf_addtwo_id")=addtwo_id
rs("dlxf_z_zgname")=z_zgname
rs("dlxf_z_lr")=z_lr
rs("dlxf_z_jb")=z_jb
rs("dlxf_z_cb")=z_cb
rs("dlxf_z_xb")=z_xb
rs("dlxf_z_others")=z_others
rs("dlxf_z_zq")=z_zq
rs("dlxf_z_sj")=z_sj
rs("dlxf_z_cbdate")=z_cbdate
rs("dlxf_z_qy")=z_qy
rs("dlxf_ypxxone_id")=ypxxone_id
rs("dlxf_ypxxtwo_id")=ypxxtwo_id
rs("dlxf_z_xz")=z_xz
rs("dlxf_key2")=key2
rs("dlxf_z_begindate")=z_begindate
rs("dlxf_z_lastdate")=z_lastdate
rs("dlxf_z_jzdate")=z_jzdate
rs.update
rs.close
set rs=nothing

response.redirect"exhibit.asp?page="&page
end if%>