<% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="61"
	dir="../err.asp" 
  %>
<!--#include file="../../conn/conn.asp"-->
  <!--#include file="../../inc/filesystem.asp"-->
 <!--#include file="../../inc/safe.asp"-->
    <!--#include file="../rolecheck.asp"-->
 <META http-equiv=Content-Type content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../css/style.css">
<%
   Response.Buffer = true
  Response.ExpiresAbsolute=now()-1
  Response.Expires=0
  Response.CacheControl="no-cache"
 
if Not ChkPost then 
response.redirect ("../../login/chklogin.asp?login=4")
response.end
end if
oldpic=Replace_Text(request.form("oldpic"))
cimg=Replace_Text(Request("cimg"))
picture=Replace_Text(Request("picture"))
 id=Replace_Text(request.form("id"))
if Replace_Text(request.form("title"))="" then
response.write"<SCRIPT language=JavaScript>alert('没有填写展会名称！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if

if Replace_Text(request.form("title"))>"" then
title=Replace_Text(request.form("title"))
sql="select id from Websen_expo where title='"&title&"' and id<>"&id&""
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if not (rs.Bof and rs.eof) then
response.write"<SCRIPT language=JavaScript>alert('您已经发布过这条展会信息了！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
end if


if Replace_Text(request.form("holdCountry"))="" then
response.write"<SCRIPT language=JavaScript>alert('没有填写举办国家！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if

if Replace_Text(request.form("beginDate"))="" then
response.write"<SCRIPT language=JavaScript>alert('没有填写参展开始日期！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if

if Replace_Text(request.form("endDate"))="" then
response.write"<SCRIPT language=JavaScript>alert('没有填写参展结束日期！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if

if Replace_Text(request.form("expireDate"))="" then
response.write"<SCRIPT language=JavaScript>alert('没有填写报名截止日期！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if

if Replace_Text(request.form("place"))="" then
response.write"<SCRIPT language=JavaScript>alert('没有填写参展地(展馆)！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if

if Replace_Text(request.form("frontFor"))="" then
response.write"<SCRIPT language=JavaScript>alert('没有填写主办单位！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if

if Replace_Text(request.form("brief"))="" then
response.write"<SCRIPT language=JavaScript>alert('没有填写展会简介！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if

if Replace_Text(request.form("product"))="" then
response.write"<SCRIPT language=JavaScript>alert('没有填写参展范围！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if

if Replace_Text(request.form("linkman"))="" then
response.write"<SCRIPT language=JavaScript>alert('没有填写联系人！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if

if Replace_Text(request.form("country1"))="中国" then
if Replace_Text(request.form("province"))=""  or Replace_Text(request.form("city"))="" then
response.write"<SCRIPT language=JavaScript>alert('国家如果选择了中国，必须选择地级市和市、县！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
end if

if Replace_Text(request.form("address"))="" then
response.write"<SCRIPT language=JavaScript>alert(没有填写联系地址！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if

if Replace_Text(request.form("phone"))="" then
response.write"<SCRIPT language=JavaScript>alert('没有填写固定电话！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if


set rs=server.createobject("adodb.recordset")
sql="select * from Websen_expo where id="&id&""
 rs.open sql,conn,1,3
rs("brief")=Replace_Text(request.form("brief"))
rs("city")=Replace_Text(request.form("city"))
rs("aidance")=Replace_Text(request.form("aidance"))
rs("province")=Replace_Text(request.form("province"))
rs("title")=Replace_Text(request.form("title"))
rs("company")=Replace_Text(request.form("company"))
rs("address")=Replace_Text(request.form("address"))
rs("beginDate")=Replace_Text(request.form("beginDate"))
rs("endDate")=Replace_Text(request.form("endDate"))
rs("activity")=Replace_Text(request.form("activity"))
rs("fax")=Replace_Text(request.form("fax"))
rs("mobile")=Replace_Text(request.form("mobile"))
rs("holdCountry")=Replace_Text(request.form("holdCountry"))
rs("undertake")=Replace_Text(request.form("undertake"))
rs("zip")=Replace_Text(request.form("zip"))
rs("expireDate")=Replace_Text(request.form("expireDate"))
rs("place")=Replace_Text(request.form("place"))
rs("linkman")=Replace_Text(request.form("linkman"))
rs("phone")=Replace_Text(request.form("phone"))
rs("homepage")=Replace_Text(request.form("homepage"))
rs("authorize")=Replace_Text(request.form("authorize"))
rs("charge")=Replace_Text(request.form("charge"))
rs("email")=Replace_Text(request.form("email"))
rs("frontFor")=Replace_Text(request.form("frontFor"))
rs("product")=Replace_Text(request.form("product"))
rs("country1")=Replace_Text(request.form("country1"))
 if Replace_Text(request.form("pic_on"))<>"" then 
if Replace_Text(request.form("pic_on"))=1 then
 if Replace_Text(Request("cimg"))=1 then
   '删除新上传的而又不使用的图片^^^^^^^^^^^^^^^^^^ 
    if picture<>oldpic then
	if picture<>"nopicture.gif" then
 	 call FileDel(HOPE_InstallDir&"UploadFile/"&picture)
	 end if
 	end if
   '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   end if
  if Replace_Text(Request("cimg"))=2 then
     rs("picture")=picture
   '删除原有图片^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    if picture<>oldpic then
	if oldpic<>"nopicture.gif"  then
 	 call FileDel(HOPE_InstallDir&"UploadFile/"&oldpic)
	 end if
 	end if
   '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  end if
  end if
end if
rs("dateandtime")=now()
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write"<table cellpadding=2 cellspacing=1 border=0 width=100% class=tableBorder align=center>"
response.write"<TR>"
response.write"<TH class=tableHeaderText colSpan=2 height=25>展会信息管理</TH>"
response.write"<TR><tr><td height=85 valign=top class=forumRow>"
Response.write("<iframe src='../../manage/makehtml/expo/makedetail_expo.asp?all=update&id1="&id&"&id2="&id&"' width=100% height=40  frameborder=0></iframe>")	
Response.write("<iframe src='../../manage/makehtml/expo/makelist.asp?all=all'  width=100% height=40  frameborder=0></iframe>")	
 Response.write "<div align=center><br><br>展会信息修改成功！</div></td></tr>"
response.write"<tr align=center><td height=30 class=forumRowHighlight><a href='expo.asp?pass=1'>&lt;&lt; 返回上一页</a></td>"
response.write"</tr>"
response.write"</table>"
%>
<br>
<!--#include file="../copy.asp" -->