<!--#include file="../prohead.asp"-->
<!--#include file="../../inc/Safe.asp"-->
<!--#include file="../checkrole.asp"-->
<script>
function firm()
{
    if(confirm("你确信要转去 天轰穿的博客？"))
    {
	history.go(-1);
    }
    else
    {
    }
}
</script>
<%
pid=request("id")
set rss=server.CreateObject("adodb.recordset")
	sql="select * from yixiang_productshow where id="&pid
	rss.open sql,conn,1,1
If rss.eof then 
	response.Write "<script>alert('选择有误，或者此产品已删除！');history.go(-1);</script>"
Else
	set rsd=server.createobject("adodb.recordset")
sqld="select showname from yixiang_info where showname='"&rss("cpmc")&"' and gsid="&rss("gsid")&" and Specifications='"&rss("cpgg")&"'"
	rsd.open sqld,conn,1,1
	response.write srd("showname")
				if rsd.eof then 
				call addproduct()
				response.Write "<script>alert('成功添加！');history.go(-1);</script>"
				else
			    response.Write "<script>alert('销售表中存在贵公司的同名产品,添加失败！');history.go(-1);</script>"
			    end if
				rsd.close
				set rsd=nothing 
End if 

sub addproduct() 
		set rsadd=server.createobject("adodb.recordset")
		sqladd="select * from yixiang_info "
		rsadd.open sqladd,conn,1,3
		rsadd.addnew 
		rsadd("showname")=rss(2)
    	rsadd("PriceTerms")=rss("cpjg")
		rsadd("type")="卖"
		rsadd("period")=""
        rsadd("keywords")=rss(19)
		rsadd("content")=rss("xxsm")
    	rsadd("picture_summ")=rss("picture_summ")
        rsadd("picture")=rss("picture")
		rsadd("sortid")=rss("sortid")
		rsadd("typeid")=rss("typeid")
		rsadd("typeid_2")=rss("typeid_2")
		rsadd("Specifications")=rss("cpgg")
		rsadd("Quantity")=rss("Quantity")
		rsadd("Packaging")=rss("Packaging")
		rsadd("TrustpassFlag")=0
		rsadd("FeedbackFlag")=rss("FeedbackFlag")
		rsadd("dateandtime")=now
		rsadd("Gsid")=rss("gsid")
		rsadd("hits")=rss("hits")
		rsadd("Flag")=0
		rsadd("jinji")=0
		rsadd("draw")=rss("picture")
		rsadd("draw1")=rss("picture")
		rsadd("draw2")=rss("picture")
		'rsadd("picsample_0")=rss()
		'rsadd("picsample_1")=rss()
		'rsadd("picsample_2")=rss()
		'rsadd("jinji")=rss()
		rsadd("html_pass")=0
		'rsadd("upsize_ts")=rss()
		rsadd("tsbz")=rss("iscpbj")
		'rsadd("infostartdate")=rss()
		'rsadd("infoenddate")=rss()
		rsadd("toprice")=rss("toprice")
		rsadd("priceid")=rss("priceid")
		rsadd("tjhome")=0
		rsadd("setup")=0
		rsadd.update()
		rsadd.close
		set rsadd= nothing
end sub

rss.close
set rss=nothing

%>