<%guidedisplay=1%>
<!--#include file="admin_start.asp" -->
<%
dim g
dim g_n
dim id
id=int(request("id"))
rs.open"select sort_reg_property from jins_customer_sort where sort_id="&id&" ",conn,1,3
if rs.eof then
   MySys.Error.info = "不存在此用户分类"
   MySys.Error.location = "back"
   MySys.Error.err()
End If

g=rs("sort_reg_property")
if g<>"" then g=split(g,",")

if request("action")="delete" then
	c=""
	n=int(request("n"))
	for i=0 to ubound(g)
	if i-n<>0 then c=c+","+g(i)
	next
	if c<>"" then c=right(c,len(c)-1)
	rs("sort_reg_property")=c
	rs.update
	rs.close
	'/////////////////////////
	rs.open "select customer_reg_property from jins_customer_list where sort_id="&id&" ",conn,1,3
	do while not rs.eof 
		g=rs("customer_reg_property")
		if g<>"" then 
			g=split(g,",")
			c=""
			n=int(request("n"))
			for i=0 to ubound(g)
			if i-n<>0 then c=c+","+g(i)
			next	
			if c<>"" then c=right(c,len(c)-1)
			rs("customer_reg_property")=c
			rs.update
		end if
		rs.movenext
	loop
	rs.close
	'/////////////////////////
	
	MySys.Error.info = "删除成功！"
	MySys.Error.location = "back"
	MySys.Error.suc()
end if

if request("action")="edit" then
	c=""
	if rs("sort_reg_property")<>"" then
		for i=0 to ubound(g)
			cc=""
			if request("p_"&i&"_3")<>"3" then
				for ii=0 to 4
				cc=cc+"|"&request("p_"&i&"_"&ii)
				next
				cc=right(cc,len(cc)-1)
			else
				for ii=0 to 3
				cc=cc+"|"&request("p_"&i&"_"&ii)
				next
				cc=right(cc,len(cc)-1)
			end if
			c=c+","+cc
		next
		rs("sort_reg_property")=right(c,len(c)-1)
		rs.update
	end if
	rs.close
	
	MySys.Error.info = "编辑成功！"
	MySys.Error.location = "back"
	MySys.Error.suc()
end if

if request("action")="add" then
	c=""
	cc=""
	if request("p_3")<>"3" then
		for ii=0 to 4
		cc=cc+"|"&request("p_"&ii)
		next
		cc=right(cc,len(cc)-1)
	else
		for ii=0 to 3
		cc=cc+"|"&request("p_"&ii)
		next
		cc=right(cc,len(cc)-1)
	end if
	c=c+","+cc
	if rs("sort_reg_property")<>"" then rs("sort_reg_property")=rs("sort_reg_property")&","+right(c,len(c)-1) else rs("sort_reg_property")=right(c,len(c)-1)
	rs.update
	rs.close
	
	MySys.Error.info = "添加成功！"
	MySys.Error.location = "back"
	MySys.Error.suc()
end if

%>
<body topmargin="10" leftmargin="10" rightmargin="10" bottommargin="10" marginwidth="10" marginheight="10">
<form name=admin_customer_sort_property method=post action='admin_user_customer_sort_property_edit.asp?action=edit&id=<%=id%>'>
<div valign=top>
<table cellpadding="0" cellspacing="0"  width="100%" align=center style='border:0px solid #ebebeb' >
	<tr>
	<td  valign=top align=center>
	<table cellpadding="3" cellspacing="3" width="100%" height="30" align=center style='border:1px solid #ebebeb' >
			<tr>
				<td  width="5%" align=center valign=center >必填字段</td>
				<td  width="15%" align=left valign=center>中文说明</td>
				<td  width="15%" align=left valign=center>英文标示</td>
				<td  width="10%" align=left valign=center>可选类型</td>
				<td  width="45%" align=left valign=center>备选值(用 & 隔开)</td>
				<td  width="5%" align=left valign=center>删除</td>
			</tr>
			
			<tr>
			    <td height='1' colspan="8" width='100%' background='images/dot03.gif'></td>
			</tr>
			<%
			if rs("sort_reg_property")<>"" then
			for i=0 to ubound(g)
			g(i)=split(g(i),"|")
			%>
			<tr id=cat_<%=i%>>
				<td  width="5%" align=left valign=center>
				<select name=p_<%=i%>_0 >
				<option value=1 <%if g(i)(0)="1" then response.write "selected"%> >必填项</option>
				<option value=0 <%if g(i)(0)="0" then response.write "selected"%> >选填项</option>
			    </select>
				</td>
				<td  width="15%" align=left valign=center><input name=p_<%=i%>_1 value='<%=g(i)(1)%>' type=text size=15></td>
				<td  width="15%" align=left valign=center><input name=p_<%=i%>_2 value='<%=g(i)(2)%>' type=text size=15></td>
				<td  width="10%" align=left valign=center>
				<select name=p_<%=i%>_3 >
				<option value=1 <%if g(i)(3)="1" then response.write "selected"%> >单选</option>
				<option value=2 <%if g(i)(3)="2" then response.write "selected"%> >多选</option>
				<option value=3 <%if g(i)(3)="3" then response.write "selected"%> >文本</option>
			    </select>
				</td>
				<td  width="45%" align=left valign=center><input name=p_<%=i%>_4 value='<%if ubound(g(i))>3 then %><%=g(i)(4)%><%end if%>' type=text size=50></td>
				<td  width="5%" align=left valign=center><a title='点击删除此项！' href='admin_user_customer_sort_property_edit.asp?action=delete&id=<%=id%>&n=<%=i%>'><img border='0' src='Images/delete.gif' align='bottom' alt='点击删除此项！'></a></td>
			</tr>
			<tr>
			    <td height='1' colspan="8" width='100%' background='images/dot03.gif'></td>
			</tr>
			<%
			next
			end if
			%>
	<tr>
	<td colspan="8" height="20" align="center">
	<input type=submit value='提 交'>
	<input type=reset value='重置' >
	</td>
	</tr>
		
	</table>
</td>
</tr>
	
</table>
</div>
</form>

<form name=admin_customer_sort_property_add method=post action='admin_user_customer_sort_property_edit.asp?action=add&id=<%=id%>'>
<div valign=top>
<table cellpadding="0" cellspacing="0"  width="100%"  align=center style='border:0px solid #ebebeb' >
	<tr>
	<td  valign=top align=center>
	<table cellpadding="3" cellspacing="3" width="100%" height="30" align=center style='border:1px solid #ebebeb' >
			<tr>
				<td  width="5%" align=center valign=center>必填字段</td>
				<td  width="15%" align=left valign=center>中文说明</td>
				<td  width="15%" align=left valign=center>英文标示</td>
				<td  width="10%" align=left valign=center>可选类型</td>
				<td  width="45%" align=left valign=center>备选值(用 & 隔开)</td>
				<td  width="5%" align=left valign=center></td>
			</tr>
			
			<tr>
			    <td height='1' colspan="8" width='100%' background='images/dot03.gif'></td>
			</tr>
			<tr >
				<td  width="5%" align=left valign=center>
				<select name=p_0 >
				<option value=1 >必填项</option>
				<option value=0 >选填项</option>
			    </select>
				</td>
				<td  width="15%" align=left valign=center><input name=p_1  type=text size=15></td>
				<td  width="15%" align=left valign=center><input name=p_2  type=text size=15></td>
				<td  width="10%" align=left valign=center>
				<select name=p_3 >
				<option value=1 >单选</option>
				<option value=2 >多选</option>
				<option value=3 >文本</option>
			    </select>
				</td>
				<td  width="45%" align=left valign=center><input name=p_4  type=text size=50></td>
				<td  width="5%" align=left valign=center></td>
			</tr>
			<tr>
			    <td height='1' colspan="8" width='100%' background='images/dot03.gif'></td>
			</tr>
	<tr>
	<td colspan="8" height="20" align="center">
	<input type=submit value='添 加'>
	<input type=reset value='重置' >
	</td>
	</tr>
		
	</table>
</td>
</tr>
	
</table>
</div>
</form>
</body>
<!--#include file="admin_end.asp" -->