<% data_path="../../" 'ACC连接数据库路径，对SQL无效 %>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../../inc/filesystem.asp"-->
 <!--#include file="../checkrole.asp"-->
<%
  call checkuser("cp")
	if issession=0 then
	username=Replace_Text(request.Cookies("Yxmember"))
	gsid=Replace_Text(request.Cookies("Yxmemberid"))
	else
	username=session("user")
	gsid=session("id")
	end if 
dim photo,logo,photopath,logopath

 id=Replace_Text(request.Form("id"))
 
 sql="select qymc from Yixiang_corporation where id="&gsid&""
Set rss= Server.CreateObject("ADODB.Recordset") 
rss.open sql,conn,1,1
qymc=rss("qymc")
rss.close

set rss=nothing
bigclassid=Replace_Text(Request.form("bigclassid"))
smallclassid=Replace_Text(Request.form("smallclassid"))
if  smallclassid="" then
	smallclassid=0
end if
cpmc=Replace_Text(Request.form("cpmc"))
cpgg=Replace_Text(Request.form("cpgg"))
cpcd=Replace_Text(Request.form("cpcd"))
proprice= Replace_Text(Request.form("proprice"))

'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'处理种类的id号 
 
sortid=Replace_Text(Request.form("topCatFormKey"))                                     '第一类
typeid=Replace_Text(Request.form("secondCatFormKey"))
                                                                                '第二类
if typeid="" then
	typeid=0
end if
typeid_2=Replace_Text(Request.form("leafCatFormKey"))
if typeid_2="" then
	typeid_2=0
end if
   
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
p_z_Z_Keywords=Replace_Text(Request.form("p_z_Z_Keywords"))
xxsm=Replace_Text(Request.form("xxsm"))
more_info=Replace_Text(Request.form("more_info"))
cpsb=Replace_Text(Request.form("cpsb"))
Quantity=Replace_Text(Request.form("Quantity"))
Packaging=Replace_Text(Request.form("Packaging"))
cpjg=Replace_Text(Request.form("cpjg"))
 yx_pic=Replace_Text(Request.form("yx_pic"))
yx_pic2=Replace_Text(Request.form("yx_pic2"))
iscpbj=Replace_Text(Request.form("iscpbj"))
if iscpbj="" then 
iscpbj=0
end if 
if not isnumeric(proprice)  then
proprice=0
end if
 
user= username

sql="select id from Yixiang_productshow where cpmc='"&cpmc&"' and cpgg='"&cpgg&"' and gsid="&gsid&" and id<>"&id&"" 
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
if not rs.eof 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 Yixiang_productshow where id="&id&""
 rs.open sql,conn,1,3
 flagc=rs("flag")
 sid=rs("sortid")
 tid=rs("typeid")
 tid2=rs("typeid_2")
 hname=sid&"-"&tid&"-"&tid2
 
 '^^^^^^^^^^^^^^^^^^^^^^^^^^^^
rs("cpmc")=cpmc
rs("cpgg")=cpgg
rs("cpcd")=cpcd
rs("sortid")=sortid
rs("typeid")=typeid
rs("typeid_2")=typeid_2
rs("keywords")=p_z_Z_Keywords
rs("xxsm")=xxsm
 rs("idate")=now()
 
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
if yx_pic="" and yx_pic2="" then 
 rs("picture")="../../UploadFile/nopicture.gif"
rs("picture_summ")="../../UploadFile/nopicture.gif"
elseif yx_pic2<>"" and yx_pic="" then 
rs("picture")=yx_pic2
rs("picture_summ")=yx_pic2
elseif yx_pic2="" and yx_pic<>"" then 
rs("picture")=yx_pic
rs("picture_summ")=yx_pic
else 
rs("picture")=yx_pic2
rs("picture_summ")=yx_pic
end if 
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
rs("iscpbj")=iscpbj '产品报价
rs("proprice")=proprice
rs("cpsb")=cpsb
rs("Quantity")=Quantity
rs("Packaging")=Packaging
rs("cpjg")=cpjg
 rs("gsid")=gsid
rs("bigclassid")=bigclassid
rs("FeedbackFlag")=0
rs("smallclassid")=smallclassid
rs("html_pass")=0
rs.update
		id1=rs("id")
	    id2=rs("id")
rs.close
set rs=nothing
 
 '删除当种类变化时原有的html页面^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 if trim(hname)<>trim(sortid&"-"&typeid&"-"&typeid_2) then
      call FileDel(HOPE_InstallDir&"productshow/offerdetail/"&hname&"-"&id&".html")
  end if
 
 
 '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 if flagc="1" then
%>
<iframe src="../../manage/Autohtml/productshow/makedetail.asp?all=update&id1=<%=id1%>&id2=<%=id2%>&schtml=开始生成>>&M_other=Product" frameborder="0" scrolling="no" width=0 height=0></iframe>
<%
end if
  %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>操作成功</title>
<link href="../../images/css.css" rel="stylesheet" type="text/css">
<meta HTTP-EQUIV=refresh Content='3;url=edit.asp'>
</head>

<%
Content="<center>恭喜您，您的产品已经发布成功!<br><br><input name='' type='button' value='返回上一页' onclick='javascript:history.go(-1)'></center>"

Call Operation(Content,1)
Response.end
conn.close
set conn=nothing
%>
<body>
</body>
</html>