<!--#include file="conn.asp"-->
<%if session("bjxadmin")="" 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 shiheid,shiheorder,shihename,shiheno,i
if request("action")="update" then
    for i=1 to request.form("shiheid").count
	shiheid=replace(request.form("shiheid")(i),"'","")
	shiheorder=replace(request.form("shiheorder")(i),"'","")
	shihename=replace(request.form("shihename")(i),"'","")
	if replace(request.form("shiheorder")(i),"'","")="" then
%>
<script language=javascript>
history.back()
alert("请填写适合年龄的显示排序！")
</script>
<%
		Response.End
	end if
	conn.execute("update shihe set shiheorder="&shiheorder&",shihename='"&shihename&"' where id="&shiheid)

    next
conn.close
set conn=nothing
response.write "<script language=javascript>alert('适合年龄设置成功！');window.location.href='shihemanage.asp';</script>"
end if


if request("action")="add" then
	shiheno=request.form("shiheno")
	shihename=trim(request("shihename"))
	shiheorder=request.form("shiheorder")
	If shihename="" Then
		response.write "适合年龄名称不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If shiheorder="" Then
		response.write "排序不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "select * from BJX_shihe",conn,1,3
rs.addnew
rs("shihename")=shihename
rs("shiheorder")=shiheorder
rs.update
rs.close
set rs=nothing

conn.close
set conn=nothing
response.write "<script language=javascript>alert('适合年龄添加成功！');window.location.href='shihemanage.asp';</script>"
end if
%>
