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

dim shengid,shengorder,shengname,shengno,i
if request("action")="update" then
    for i=1 to request.form("shengid").count
	shengid=replace(request.form("shengid")(i),"'","")
	shengorder=replace(request.form("shengorder")(i),"'","")
	shengname=replace(request.form("shengname")(i),"'","")
	shengno=replace(request.form("shengno")(i),"'","")
	if replace(request.form("shengorder")(i),"'","")="" then
%>
<script language=javascript>
history.back()
alert("请填写省的显示排序！")
</script>
<%
		Response.End
	end if
	conn.execute("update shop_szsheng set shengorder="&shengorder&",shengname='"&shengname&"',shengno='"&shengno&"' where id="&shengid)

    next

response.write "<p align=center><font color=red>省设置成功!<br>2秒钟后返回上页!</font>"
response.write "<meta http-equiv=""refresh"" content=""2;url=sheng_manage.asp"">"
end if





if request("action")="update2" then
    for i=1 to request.form("shengid").count
	shengid=replace(request.form("shengid")(i),"'","")
	shengorder=replace(request.form("shengorder")(i),"'","")
	shengname=replace(request.form("shengname")(i),"'","")
	shengno=replace(request.form("shengno")(i),"'","")
	fy=replace(request.form("fy")(i),"'","")
	if replace(request.form("shengorder")(i),"'","")="" or replace(request.form("fy")(i),"'","")=""  then
%>
<script language=javascript>
history.back()
alert("请填写省的显示排序和价格浮动生活系数！")
</script>
<%
		Response.End
	end if
	conn.execute("update shop_szsheng set shengorder="&shengorder&",shengname='"&shengname&"',shengno='"&shengno&"',fy="&fy&" where id="&shengid)

    next

response.write "<p align=center><font color=red>省设置运费浮动系数成功!<br>2秒钟后返回上页!</font>"
response.write "<meta http-equiv=""refresh"" content=""2;url=shengyf_manage.asp"">"
end if









if request("action")="add" then
	shengno=request.form("shengno")
	shengname=trim(request("shengname"))
	shengorder=request.form("shengorder")
	If shengname="" Then
		response.write "省名称不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If shengno="" Then
		response.write "省编号名称不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If shengorder="" Then
		response.write "排序不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "select * From shop_szSheng",conn,1,3
rs.addnew
rs("shengname")=shengname
rs("shengno")=shengno
rs("shengorder")=shengorder
rs.update
response.write "<p align=center><font color=red>省添加成功!<br>2秒钟后返回上页!</font>"
response.write "<meta http-equiv=""refresh"" content=""2;url=sheng_manage.asp"">"
end if


if request("action")="add2" then
	shengno=request.form("shengno")
	shengname=trim(request("shengname"))
	shengorder=request.form("shengorder")
	fy=request.form("fy")
	If shengname="" Then
		response.write "省名称不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If shengno="" Then
		response.write "省编号名称不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If shengorder="" Then
		response.write "排序不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If fy="" Then
		response.write "浮动系数不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "select * From shop_szSheng",conn,1,3
rs.addnew
rs("shengname")=shengname
rs("shengno")=shengno
rs("shengorder")=shengorder
rs("fy")=fy
rs.update
response.write "<p align=center><font color=red>省添加成功!<br>2秒钟后返回上页!</font>"
response.write "<meta http-equiv=""refresh"" content=""2;url=shengyf_manage.asp"">"
end if


%>