<!--#include file="conn.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
else
if session("flag")>1 then
response.Write "<p align=center><font color=red>您没有此项目管理权限！</font></p>"
response.End
end if
end if

dim id,youbian,dizhiname,danweino,i
if request("action")="update" then
    for i=1 to request.form("id").count
	id=replace(request.form("id")(i),"'","")
	shuoming=replace(request.form("shuoming")(i),"'","")
	smvip=replace(request.form("smvip")(i),"'","")
	smhy=replace(request.form("smhy")(i),"'","")
	pyvip=replace(request.form("pyvip")(i),"'","")
	pyhy=replace(request.form("pyhy")(i),"'","")
	emsvip=replace(request.form("emsvip")(i),"'","")
	emshy=replace(request.form("emshy")(i),"'","")
	If shuoming="" Then
		response.write "请填写说明！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If smvip="" Then smvip=0
	If smhy="" Then smhy=0
	If pyvip="" Then pyvip=0
	If pyhy="" Then pyhy=0
	If emsvip="" Then emsvip=0
	If emshy="" Then emshy=0
	
	conn.execute("update shop_fudong set shuoming='"&shuoming&"',smvip="&smvip&",smhy="&smhy&",pyvip="&pyvip&",pyhy="&pyhy&",emsvip="&emsvip&",emshy="&emshy&" where id="&id)

    next
conn.close
set conn=nothing
response.write "<script language=javascript>alert('浮动价修改成功！');window.location.href='sysset_fudong.asp';</script>"
end if


if request("action")="add" then
	shuoming=trim(request("shuoming"))
	smvip=request.form("smvip")
	smhy=request.form("smhy")
	pyvip=request.form("pyvip")
	pyhy=request.form("pyhy")
	emsvip=request.form("emsvip")
	emshy=request.form("emshy")
	If shuoming="" Then
		response.write "请填写说明！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If smvip="" Then smvip=0
	If smhy="" Then smhy=0
	If pyvip="" Then pyvip=0
	If pyhy="" Then pyhy=0
	If emsvip="" Then emsvip=0
	If emshy="" Then emshy=0
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "select * from shop_fudong",conn,1,3
rs.addnew
rs("shuoming")=shuoming
rs("smvip")=smvip
rs("smhy")=smhy
rs("pyvip")=pyvip
rs("pyhy")=pyhy
rs("emsvip")=emsvip
rs("emshy")=emshy
rs.update
rs.close
set rs=nothing

conn.close
set conn=nothing
response.write "<script language=javascript>alert('浮动价添加成功！');window.location.href='sysset_fudong.asp';</script>"
end if
%>