<!-- #include file="conn.asp" -->
<%
 type_id=Request.Form("new_type_id")
 type_son_id=Request.Form("new_type_son_id")
 brand_id=Request.Form("new_brand_id")
 new_pro_id_1=Request.Form("new_pro_id_1")
 new_pro_id_2=Trim(Request.Form("new_pro_id_2"))
 new_pro_radio=Request.Form("new_pro_radio")
 price=Trim(request.form("price"))
 price_in=Trim(request.form("price_in"))
 com_id=session("com_id")
 if new_pro_radio=1 then
 pro_id=new_pro_id_1
 else
 set rs=server.createobject("adodb.recordset")
 sql="select * from products"
 rs.open sql,conn,1,3
 rs.addnew
 rs("type_id")=type_id
 rs("type_son_id")=type_son_id
 rs("brand_id")=brand_id
 rs("pro_name")=new_pro_id_2
 rs("pas")=0
 rs("hit")=0
 rs("idate")=now()
 rs.update
 pro_id=rs("pro_id")
 rs.close
 set rs=nothing
 end if
 set rs=server.createobject("adodb.recordset")
 sql="select * from offer where pro_id="&pro_id&" and com_id="&com_id
 rs.open sql,conn,1,3
 if not rs.eof then
response.write"<SCRIPT language=JavaScript>alert('该商品您已经报过价了！');"
response.write"this.location.href='com_add_baojia.asp';</SCRIPT>" 
response.end
else
 rs.addnew
 rs("type_id")=type_id
 rs("type_son_id")=type_son_id
 rs("brand_id")=brand_id
 rs("pro_id")=pro_id
 rs("com_id")=com_id
 rs("price")=price
 rs("price_in")=price_in
 rs("pas")=1
 rs("idate")=now()
 rs.update
end if
 rs.close
 set rs=nothing
 conn.close
 set conn=nothing
response.write"<SCRIPT language=JavaScript>alert('报价成功！');"
response.write"this.location.href='com_add_baojia.asp';</SCRIPT>" 
response.end%>
 
 