<!--#include file="../common/conn.asp"-->
<!--#include file ="upload.inc" -->
<%
set upload=new upload_5xsoft
  strName=trim(upload.Form("txtname"))
  strPrice=trim(upload.Form("txtprice"))
  if strPrice="" then strPrice=0
  strClass=upload.Form("selClass")
  strContent=trim(upload.Form("content"))
	  
	'检查用户权限
	call checkuser(upload.Form("WindowName"))

  
'上传全图
set file=upload.file("filepic")
	UPLoadDate=year(now) & month(now) & day(now)
	UPLoadTime=hour(now) & minute(now) & second(now)
	strPic=UPLoadDate & UPLoadTime & right(file.filename,4)
	if file.filesize>0 then         ''如果 filesize > 0 说明有文件数据
		ExeName=".gif,.jpg,.swf,.png"
		if Instr(Lcase(ExeName),right(Lcase(file.filename),4))<=0 then
			ShowMsg "文件格式不对，这里只能上传：" & ExeName & "　格式的文件！"
		end if
	
		file.saveas server.mappath("../../UpFile/" & strPic)   ''保存文件
	else
		strPic=""
	end if

'上传缩图
set file=upload.file("filesmallpic")
	strSmallPic="s" & UPLoadDate & UPLoadTime & right(file.filename,4)
	if file.filesize>0 then         ''如果 filesize > 0 说明有文件数据
		ExeName=".gif,.jpg,.swf,.png"
		if Instr(Lcase(ExeName),right(Lcase(file.filename),4))<=0 then
			ShowMsg "文件格式不对，这里只能上传：" & ExeName & "　格式的文件！"
		end if
	
		file.saveas server.mappath("../../UpFile/" & strSmallPic)   ''保存文件
	else
		strSmallPic=""
	end if

	'添加信息
	strsql="Insert Into web_product(p_class,p_name, p_code, p_price, p_detail, p_pic, p_smallpic, p_symbol, p_size, p_weight, p_face, p_place, p_producer, mn_id) values("
	strsql=strsql &	 "" & strClass & ", "
	strsql=strsql &	 "'" & strName & "', "
	strsql=strsql &	 "'" & upload.Form("txtCode") & "', "
	strsql=strsql &	 "" & strPrice & ", "
	strsql=strsql &	 "'" & strContent & "', "
	strsql=strsql &	 "'" & strPic & "', "
	strsql=strsql &	 "'" & strSmallPic & "',"
	strsql=strsql &	 "'" & upload.Form("txtsymbol") & "', "
	strsql=strsql &	 "'" & upload.Form("txtsize") & "', "
	strsql=strsql &	 "'" & upload.Form("txtweight") & "', "
	strsql=strsql &	 "'" & upload.Form("txtface") & "', "
	strsql=strsql &	 "'" & upload.Form("txtplace") & "', "
	strsql=strsql &	 "'" & upload.Form("txtproducer") & "', "
	strsql=strsql &	 "'" & upload.Form("mnid") & "') "

conn.execute strsql,0,1
'response.Write(strSQL)

  conn.close
  set conn=nothing 
%>
<body onLoad="window.parent.opener.location=window.parent.opener.location;window.parent.document.newform.btSubmit.style.display='none';alert('产品保存成功！ \n\n如果要继续发布产品，请点击继续发布按钮！　');"></body>