<!--#include file="admin_start.asp"-->
<%
dim Search_Sort_Ids
function SearchSortIds(table,id)

	Dim rs_g
	If table = "" or id = "" Then
		SearchSortIds = False
		Exit Function
	End If
	
	'if Search_Sort_Ids="" then Search_Sort_Ids=","
	set rs_g=conn.execute("select object_id,object_up from "&table&" where object_up="&id&" ")

	'if rs_g.eof then
	if Search_Sort_Ids="" then Search_Sort_Ids=id else Search_Sort_Ids=Search_Sort_Ids&","&id
	'else
		do while Not rs_g.EOF
			SearchSortIds table,rs_g("object_id")
			rs_g.movenext
		loop
	'end if

	Set rs_g = Nothing

end function
if request("action")="delete" then

id=request("id")
SearchSortIds "jins_object_list",id 

conn.execute("delete from jins_object_list where object_id in ("&Search_Sort_Ids&") ")
MySys.error.info="delete success！"
MySys.error.location="back"
MySys.error.suc()

end if

dim object_id
dim qu
dim grade
dim show
dim i_s

object_id=trim(request("id"))

if not MySys.check.isInteger(object_id) then
MySys.error.info="请选择您要设置的栏目！"
MySys.error.location="back"
MySys.error.err()
end if

qu=int(request.form("object_qu"))

if qu<0 then
MySys.error.info="请不要将栏目分页数设置为负数！"
MySys.error.location="back"
MySys.error.err()
end if


if (request.form("object_grade_radio_1")="" and request.form("object_grade_checkbox_1")="") or request.form("object_grade_0")="" then
MySys.error.info="请正确设置栏目权限！"
MySys.error.location="back"
MySys.error.err()
end if

select case request.form("object_grade_0")
case ">="
grade=request.form("object_grade_0")&"|"&int(request.form("object_grade_radio_1"))
case "<="
grade=request.form("object_grade_0")&"|"&int(request.form("object_grade_radio_1"))
case "="
grade=request.form("object_grade_0")&"|"&request.form("object_grade_checkbox_1")
end select

if request.form("object_show_0")<>"" then
	show=request.form("object_show_0")
	for i_s=1 to 4
		if request.form("object_show_"&request.form("object_show_0")&"_"&i_s)<>"" then show=show&","&request.form("object_show_"&request.form("object_show_0")&"_"&i_s)
	next
	'response.write show
	'response.end
end if
'///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
rs.open "select * from jins_object_list where object_id ="&object_id&" ",conn,1,3
rs("object_description")=request.form("object_description")
rs("object_open")=request.form("object_open")
rs("object_open_temp")=request.form("object_open_temp")
rs("object_customer_grade")=grade&"|"&split(rs("object_customer_grade"),"|")(2)
rs("object_qu")=qu
rs("object_show")=show
rs.update
rs.close

MySys.error.info="栏目基本设置成功！"
MySys.error.location="back"
MySys.error.suc()
%>
<!--#include file="admin_end.asp"-->