<!--#include file="admin_start.asp"-->

<%
dim id
dim ids
dim n_ids

id=request("id")
ids=request("ids")
ids=replace(ids," ","")
n_ids=""
set im=MySys.image
Set fso = CreateObject("Scripting.FileSystemObject")

if not MySys.check.isInteger(id) and request("action")="edit" then
MySys.error.info="请选择您要操作的项目！"
MySys.error.location="back"
MySys.error.err()
end if

select case request("action")
case "delete"

	if ids="" then
		MySys.error.info="请选择你要删除的商品！"
		MySys.error.location="back"
		MySys.error.err()
	end if		

	conn.execute("delete from jins_goods_pic_list where goods_id in ("&ids&") ")
	conn.execute("delete from jins_goods_price where goods_id in ("&ids&") ")
	
	set rs_t=conn.execute("select goods_id from jins_goods_list where goods_id in ("&ids&") ")
	do while not rs_t.eof
		if fso.FolderExists(server.mappath("../GOODSPIC/"&rs_t("goods_id"))) then fso.deletefolder server.mappath("../GOODSPIC/"&rs_t("goods_id")),true
	rs_t.movenext
	loop

	conn.execute("delete from jins_goods_list where goods_id in ("&ids&") ")
	
	MySys.error.info="删除商品成功！"
	MySys.error.location="back"
	MySys.error.suc()
	
case else
	rs.open"select * from jins_goods_list",conn,1,3
	for i_add=0 to 2000
		rs.addnew
		rs("sort_id")=34
		rs("goods_price_mart")=i_add+500
		rs("goods_name")="测试商品_"&i_add
		rs("goods_open")=1	
		rs("goods_unit_deliver")=100
		rs("goods_commend")=1	
		rs("goods_special")=1	
		rs("goods_new")=1	
	
		rs("goods_publishtime")=now
	
		'rs("goods_unit")=trim(request("goods_unit"))	
		'rs("goods_standards")=trim(request("goods_standards"))	
		rs("goods_content")="jsdklfjgkldjfgkljdsfklgjkldfjgkldsjfgkjdfkljsdklfjgkldjfgkljdsfklgjkldfjgkldsjfgkjdfklgjdklfjgkldjfgkldjfgkljdfklgjdklfjgldfjgkldfjjsdklfjgkldjfgkljdsfklgjkldfjgkldsjfgkjdfklgjdklfjgkldjfgkldjfgkljdfklgjdklfjgldfjgkldfjjsdklfjgkldjfgkljdsfklgjkldfjgkldsjfgkjdfklgjdklfjgkldjfgkldjfgkljdfklgjdklfjgldfjgkldfjjsdklfjgkldjfgkljdsfklgjkldfjgkldsjfgkjdfklgjdklfjgkldjfgkldjfgkljdfklgjdklfjgldfjgkldfjjsdklfjgkldjfgkljdsfklgjkldfjgkldsjfgkjdfklgjdklfjgkldjfgkldjfgkljdfklgjdklfjgldfjgkldfjjsdklfjgkldjfgkljdsfklgjkldfjgkldsjfgkjdfklgjdklfjgkldjfgkldjfgkljdfklgjdklfjgldfjgkldfjjsdklfjgkldjfgkljdsfklgjkldfjgkldsjfgkjdfklgjdklfjgkldjfgkldjfgkljdfklgjdklfjgldfjgkldfjjsdklfjgkldjfgkljdsfklgjkldfjgkldsjfgkjdfklgjdklfjgkldjfgkldjfgkljdfklgjdklfjgldfjgkldfjjsdklfjgkldjfgkljdsfklgjkldfjgkldsjfgkjdfklgjdklfjgkldjfgkldjfgkljdfklgjdklfjgldfjgkldfjjsdklfjgkldjfgkljdsfklgjkldfjgkldsjfgkjdfklgjdklfjgkldjfgkldjfgkljdfklgjdklfjgldfjgkldfjjsdklfjgkldjfgkljdsfklgjkldfjgkldsjfgkjdfklgjdklfjgkldjfgkldjfgkljdfklgjdklfjgldfjgkldfjjsdklfjgkldjfgkljdsfklgjkldfjgkldsjfgkjdfklgjdklfjgkldjfgkldjfgkljdfklgjdklfjgldfjgkldfjgjdklfjgkldjfgkldjfgkljdfklgjdklfjgldfjgkldfj"
		rs("goods_stocks")=100
		rs("goods_addtime")=now()	
		rs("goods_sellnum")=0	
		rs("goods_clicknum")=0
		rs.update
	next
	rs.close
	MySys.error.info="成功！"
	MySys.error.location="back"
	MySys.error.suc()

	'/////////////////////////////////////////////
end select
set im=nothing
Set fso = nothing

%>
<!--#include file="admin_end.asp"-->
