<!--#include file="../common/conn.asp"-->
<!--#include file ="upload.inc" -->

<%
set upload=new upload_5xsoft
  strID=upload.form("id")
  strName=trim(upload.Form("txtname"))
  strPrice=trim(upload.Form("txtprice"))

  if strPrice="" then strPrice=0
  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="update web_product set "
	strsql=strsql &	 "p_class=" & strClass & ", "
	strsql=strsql &	 "p_name='" & strName & "', "
	strsql=strsql &	 "p_detail='" & strContent & "', "
	strsql=strsql &	 "p_Code='" & upload.Form("txtCode") & "', "
	strsql=strsql &	 "p_price=" & strPrice & ", "
	
	strsql=strsql &	 "p_symbol='" & upload.Form("txtsymbol") & "', "
	strsql=strsql &	 "p_size='" & upload.Form("txtsize") & "', "
	strsql=strsql &	 "p_weight='" & upload.Form("txtweight") & "', "
	strsql=strsql &	 "p_face='" & upload.Form("txtface") & "', "
	strsql=strsql &	 "p_place='" & upload.Form("txtplace") & "', "
	strsql=strsql &	 "p_producer='" & upload.Form("txtproducer") & "' "
	if strPic<>"" then
		strsql=strsql &	 ",p_pic='" & strPic & "' "
	end if
	
	if strSmallPic<>"" then
		strsql=strsql &	 ",p_smallpic='" & strSmallPic & "' "
	end if
	strsql=strsql &	" where id=" & strID

conn.execute strsql,0,1

  conn.close
  set conn=nothing 
%>
<body onLoad="window.parent.opener.location=window.parent.opener.location;window.parent.window.close();"></body>